-
Notifications
You must be signed in to change notification settings - Fork 45
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 OTEL_RESOURCE_ATTRIBUTES environmental variable #146
Comments
Thanks for the PR! The
I'm curious what kind of attributes you want to add, do they actually fit the model of a "resource"?
This is true, we should probably pass the rest on as span attributes since Cloud Trace doesn't have a first-class resource concept right now. Just be aware that it will be a lot of repetitive information in your spans! |
I wanted to initially add the name of the app via "service.name". We do something more manually with open census and middleware but this seems to make more sense because the information is already in the span, just not exported to gcp. In the future I was thinking of using it to tag spans globally and do some A/B testing. |
Gotcha, service name definitely belongs in resource. What kind of GCP compute are you running this on btw? I think we should add this feature but probably it should be off by default and have an option in the exporter's constructor to enable it.
This sounds more like baggage is what you want here, to propagate extra key values between services. It's still not 100% clear how baggage makes it way into a span open-telemetry/opentelemetry-specification#867, but you could write a span processor to modify the span based on the parent context. |
I think it's more that if I add a resource with the otel environmental variable, I expect to see it. I agree what I'm doing with this feature could be misguided but I need to figure that out on my own. :-) I ended up spending hours with this until I used the console exporter and realized the data was added to the span but not to the data uploaded to Google. |
@dhpollack let do this:
I'll comment on your PR |
I created a PR (#145) to support this environmental variable which is part of the OTEL specification. I want to be able to add custom attributes to all spans of a specific service and this is the easiest way to do it. The current resource attribute getter ignores these attributes and only gets gcp specific ones.
The text was updated successfully, but these errors were encountered: