-
Notifications
You must be signed in to change notification settings - Fork 91
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
Support template paths as part of span names for go versions >= 1.22 #740
Support template paths as part of span names for go versions >= 1.22 #740
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this LGTM, just want to double check this line from semconv:
Instrumentation MUST NOT default to using URI path as span name, but MAY provide hooks to allow custom logic to override the default span name.
I think what this is doing would count as "providing hooks" (using the option consts) rather than defaulting to using the path. But, our instrumentation agent will be using that hook by default. @MrAlias does this seem right or does that line mean this should be behind some non-default option for the agent?
This seems correct to me given it will only ever use a templatized path. The hooks are there when a templitized version of this is not available in the language, but is something the user could provide. |
For those also interested to see how this handles non-exact matches: https://go.dev/play/p/9ZZz4BjTQ6C |
Ah so |
@MrAlias Can you please have another look? |
We talked about this PR in the SIG meeting today. I'm hesitant to merge this without the offsets generator being fixed. If I understand this correctly, if a user is using a version of Go prior to 1.22 the offsets will be "found" and the instrumentation loaded, but that offset is invalid an the system would fail to handle it. I would not want to include this in the instrumentation without first having correct offsets. |
The following part should make sure that if we instrument an app with go version lower than 1.22 the pattern parts are not taken into account (we won't consider the offsets in eBPF if we are not detecting a valid version), hence I think it should not necessarily block this PR.
|
Ah! I couldn't find this. Guess closing the other PR closed this. Thanks for reopening. I'll try to review this next. |
Not sure why the offsets action is failing with |
That is strange. The image does appear to still exist: https://hub.docker.com/layers/library/golang/1.14.1/images/sha256-23405c683ba88dffcb1493c66305533bb5b3cef179e419e2e5c2f5cb92a06891?context=explore |
This seems unique to this PR. The auto-offset-gen action still works fine: https://github.com/open-telemetry/opentelemetry-go-instrumentation/actions/runs/8850141574/job/24303716999 |
I tried reproducing the failure locally, but was unsuccessful. I even deleted the local I'm wondering if there is some caching we can clear. |
I'm able to reproduce in my fork: https://github.com/MrAlias/opentelemetry-go-instrumentation/actions/runs/8851008583/job/24306583275?pr=237 |
Yikes. Looks like there is no space left on the device(?)
I bumped the logging verbosity to show this. |
Guessing this comes down to the fact that we are having to check all the old versions of Go for the new symbols added here. Prior to this we used to just hit the cache for all the symbols and never pulled the Go images. |
Guessing we're going to need to add a "hint" to the offset manifests about what minimum version the symbol was added in. |
Going to try and resolve this later today. |
That looks to resolve the "out of space" issue: https://github.com/MrAlias/opentelemetry-go-instrumentation/actions/runs/8852585249/job/24311585805?pr=237 |
Yeah, that makes sense.
Do you think we should use this as a quick fix or add some generic logic to the cache lookup? For general solution I think that if for a given module the minimal version is |
This would mean that patch releases to prior minor/major versions would not be evaluated. I don't think that is the correct approach. |
Right. Another idea is to add "null" offsets to the cache for versions where there is no valid offset. It makes sense to cache the evaluation of no valid offset in a given version, but it will make the offset file much bigger. |
That sounds reasonable to me. It would be a bit harder for a human to read, but that's not critical if we can solve #26 |
In
go v1.22
thenet/http
package added support for pattern handlers https://go.dev/blog/routing-enhancements.This allows us to add a low cardinality path for span names in http server.
There were a few discussions about this topic (one of them in #627), and I think this solution allows for a much more informative span name while keeping it with low cardinality.
{method} {http.route}
when a route is available.net/http
e2e test to use a path template.