-
Notifications
You must be signed in to change notification settings - Fork 873
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
Move PeerServiceAttributesExtractor from javaagent api to instrumentation api #4235
Conversation
The |
why is this javaagent-only? I don't understand why library instrumentations cannot use it? |
Mapping hostnames to service name is pretty fragile in practice (just run a container in docker-compose and it doesn't work anymore, having to update the mapping every time) but is the only mechanism we've come up with for setting |
You cannot assume that given library communicates only with one service. Do you mean we should provide per-call extractors? |
You're right bad example, it needs to be per stub. For example, Brave has this pattern and I think something like that, for updating service name per stub in code tends to be easiest to manage in practice compared to host mapping. |
Ok, next question about |
Hmm, what would be the source of peer service mappings for I guess we could do something like https://github.com/open-telemetry/opentelemetry-java-instrumentation/pull/4237/files#diff-e9a4a5cb8f2720dbde375382b17292bec6875d9c892f2a0f3ae51975bde40a95 for the net extractor, if the general idea in my PR gets accepted -- and the javaagent could construct those peer service mappings from the |
@mateuszrzeszutek Can you please explain again, why |
I don't think we have that documented anywhere (we should've done that though...). |
I argue that a lot of deployments will want the possibility to change instrumentation behaviour without touching application code. Platform teams and SRE will be quite happy about that. This very same peer mapping may very well be different in different environments, thus it cannot be configure programmatically. |
That's a good point - if we only provide builder settings we'll force users of library instrumentations to handle properties/env vars themselves. Which may or may not be okay |
So, now that we've decided to keep |
We need to be able to allow instrumentation to allow a programmatic knob for peer.service specifically since it's so important - I'm not sure we could do that cleanly if it was merged into NetAttributes since it would mean overriding just one part of NetAttributes not the whole thing. peer.service probably needs to be an independent concept. |
@open-telemetry/java-instrumentation-approvers please review this PR as-is and express your approval if you do. If this PR gets 2 approvals, I will merge it. Otherwise I will close it in 2 days. I personally still want to move this class to better demonstrate that |
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.
Let's give it a try. I will make an attempt to integrate this as fallback for library instrumentation as we discussed in Tue SIG.
As it does not have any dependency on javaagent