-
Notifications
You must be signed in to change notification settings - Fork 12
Add OTEL URL attributes #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add OTEL URL attributes #41
Conversation
**Motivation:** Aligning with current OTEL semantic span attributes. URL spans attributes are required by current HTTP server semantic standards: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#http-server-semantic-conventions **Modifications:** Adds OTEL URL span attributes **Result:** Increases public API to include OTEL URL span attributes
I added the current OTEL URL semantic standard, but did notice that the package currently links to OTEL Just let me know if you'd prefer that I align with v1.11.0, or what the plan is for updating to newer versions. Thanks! |
Tests/TracingOpenTelemetrySemanticConventionsTests/URLSemanticsTests.swift
Outdated
Show resolved
Hide resolved
Thanks for bringing this up 🙏 @ktoso How do we want to go forward with the OTel semantics library in general? IIRC, we discussed it doesn't make sense to tag semantic releases of this repo, but how about updating to align with newer OTel semantic conventions? |
…sTests.swift Co-authored-by: Moritz Lang <[email protected]>
Hi folks! Okey so the intent of "extras" originally was "things that are not core to tracing and also are not stable" etc. Today the world has moved on a bit and semantic conventions are stable and versioned: https://opentelemetry.io/docs/specs/semconv/ I would suggest we rename this We can version and follow along otel specifically then; i.e. the package could literarily have the same version as the semantic conventions it models. Extras we try to steer away from (I know @czechboy0 who's likely to help out here as well), also would be happy if we don't have extras repos like that. Maybe we can include not stable ones as well and just We need a moment to figure out the renames etc but I think this would be good. |
I'm also curious what @slashmo would think about this becoming non-tracing specific, to be able to include e.g. metrics OTel conventions (we could rename accordingly, since this is pre-1.0). cc @simonjbeaumont |
@ktoso wrote:
Yeah, I'm +1 for putting this all this in one place and either @czechboy0 wrote:
Again, yes. OTel is more than traces, so we should centralise all the semantic conventions in one place IMO. However, IMO that place should be the swift-otel package and we stop having an extra package. My guess is this package is here because we didn't want folks to have to depend on a backend package when they were only instrumenting their code and that this package is intended to be used in conjunction with the API package(s) only. However, I think this is a discoverability issue and I would propose we just make this a separate target in swift-otel. I often try to think about the adopter trying to glue all this together and how they will even discover where the functionality lives.
It's just for (2) and (3) you'll use different parts of what the swift-otel package offers. And that's fine, we can let target-based resolution take care of not bringing in the backend dependencies for folks that only want to instrument with the OTel conventions. To be fair, swift-otel already has precedent for this because it provides some useful functions on the logger, which add span attributes to logs regardless of what backend you're using—this functionality predates the logging support in swift-otel. |
I love that idea!
Yeah, I totally agree here too.
I would actually softly and respectfully disagree. The fact that Obviously some of the changes discussed are beyond what I have permissions to do, so let me know how I can be helpful! Thanks for the thoughtful conversation! |
That's great—I think it's important we discuss the tradeoffs before making a decision here :)
While I believe there may have been historical issues with this, it's my understanding that this has reliably worked for some time and we are relying on this in some other packages. I have some experiments that show this to be working. Specifically, I'm claiming that, given the following scenario...
...performing a build in Do you have a scenario where this is not true? If so, could you provide some details? My proposal is that libraries that wish to add tracing would depend on
We should be careful not to conflate |
Ah, thank you for this excellent outline! Yes, this is exactly the situation I was referring to but explained much more clearly!
Yes, I believe that Here's a screenshot showing that To outline my concern in the context of this example: Having |
Thank you for taking the time to put this together. I'll take a closer look at this later on. If we can't get the target-based resolution to reliably work, then I agree we'll need to much more cautious in our approach to the package structure. |
@NeedleInAJayStack I have taken a look at your repro of the target-based resolution flow and better understand it. Previously I had claimed this:
As you have pointed out, only one of the final claims is true: This was because I had misremembered how we relied on this for other packages, where I fell into the trap of thinking it went one-level deeper and only resolved based on which products were used in the graph. Probably because of the wording of the target-based resolution proposal:
☝️ This sounds exactly what we want but I guess it doesn't do what I always expect it to do 😅.
That's fair. If these packages use incompatible version constraints, there would be a problem. If they are all using
That is also a fair concern. Footnotes |
OK, this explains it; it's target-based dependency resolution was only ever partially implemented:
|
That's awesome background on the evolution. I appreciate you exploring this situation with me! 🙂 |
Hey @ktoso @czechboy0 @simonjbeaumont I got some time this weekend and pulled together a repo that automatically generates Swift code for OTEL semantic conventions: https://github.com/NeedleInAJayStack/swift-otel-semconv I'd be happy to contribute it as a jumping off point for the effort we discussed above. Just let me know if you're interested! |
That's awesome, @NeedleInAJayStack - I think that's the right solution for the base layer. We might potentially filter just a subset of the areas, and there's a question about keeping the list up-to-date, otherwise I'm in support of exploring this approach further. |
Motivation:
Aligning with current OTEL semantic span attributes. URL spans attributes are required by current HTTP server semantic standards: https://opentelemetry.io/docs/specs/semconv/http/http-spans/#http-server-semantic-conventions
Modifications:
Adds OTEL URL span attributes
Result:
Increases public API to include OTEL URL span attributes