-
Notifications
You must be signed in to change notification settings - Fork 848
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
Add ZipkinSpanExporter option to add resource attributes to spans #3009
Comments
Hi @edwardxia - are you using Zipkin? We currently don't have a spec on how to map resource to spans because of the potential cost explosion. open-telemetry/opentelemetry-specification#823 But it is important to get that solved eventually. In the meantime, while the exporters are final you should be able to delegate them with a wrapping exporter. We have some classes in sdk-extensions/trace-incubator that might help with it. Would it work? |
Yes.
I understand tagging every single resource attribute would be too expensive, which is why I'm proposing let user explicitly choose which ones to be tagged. And of course, by default nothing would be tagged.
Not really, take Lines 203 to 207 in fc149c4
If you look at the quoted lines above, you will see that there is no way I can reuse |
The span is generated from |
Ok, it will work but I will have to wrap |
If we want to add this feature, it will need to go through the spec process so it's not a java-only option and so that the configuration is standard across all languages. I've added the blocked:spec tag until that happens. @edwardxia Are you interested in working to make this part of the official specification? |
In the mean time of solving the spec (I think I saw a similar proposal elsewhere), I think we need to put a warning in the doc of opentelemetry-java-instrumentation that the zipkin exporter ignores all resource attributes except for |
Currently the spec does not say what is supposed to happen with the Resource and zipkin: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk_exporters/zipkin.md
|
Is your feature request related to a problem? Please describe.
OT has the concept of ResourceAttributes but they are not tagged to spans.
For example, if I have:
-Dotel.resource.attributes=service.name=cats,service.namespace=mammals
Currently only service.name will be used as localEndpoint's service_name. However, I'd like to have
service.namespace=mammals
to be tagged to all spans, so that I can search spans byservice.namespace=mammals
.Describe the solution you'd like
A configuration option,
-Dotel.traces.resource.attributes
, which is a comma separated list. User can specify either just names, or name value pairs. If a list item is just a name, the value would be read from-Dotel.resource.attributes
. All the pairs will be tagged to all the spans.For example:
With these options, it will tag all spans with
service.namespace=mammals
(value is not specified directly, getting it from declared ResourceAttributes), andcloud.provider=aws
(value is specified directly).Describe alternatives you've considered
Manually adding the same tag to all spans during code execution and instrumentation turns out to be very difficult, especially for client side of a PRC call under auto-instrumentation.
Theoretically, this can also be achieved by writing customized exporter, however:
final
, so that they are not overridable.generateSpan
logic in exporters can be reused, but this method is package-private, making it a headache to maintain a fork rather than just a call and further customization.Given these conditions, I think it's better for OT to provide an option that automatically tagging user picked ResourceAttributes to all spans, and should OT handles this internally either during instrumentation or exporter.
The text was updated successfully, but these errors were encountered: