-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[exporter/awsxray] Forward X-Ray annotations from receiver to exporter #17550
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Please assign this to me. |
Per offline convos, have signed off on this approach 👍 |
I worry that this approach would result in unexpected behavior for users who are not exporting to X-Ray and who do not expect their attributes to be renamed. What about storing an additional attribute with a list of attribute keys that were originally annotations? Or putting that list into the context passed on to the next consumer by the receiver? |
I figured it was acceptable to prepend attribute names since the X-Ray segment metadata already does this. If we're already renaming the metadata attributes, then users are already getting unexpected behavior when using the X-Ray receiver with a different exporter.
Wasn't aware that you could attach values to the context. This sounds like a good solution that other exporters can just ignore. So I would just need to wrap the context passed into the consumer with a
That seems like it would work as long as the context is maintained throughout the pipeline. |
Discussed with @Aneurysm9 and @willarmiros. Settled on adding an attribute with a list of annotation keys. |
Pinging code owners for receiver/awsxray: @willarmiros. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Pinging code owners for exporter/awsxray: @willarmiros. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Component(s)
exporter/awsxray, receiver/awsxray
Is your feature request related to a problem? Please describe.
Currently, the X-Ray receiver receives Segments and converts them into Spans. As part of this translation, it puts the annotations into the Span's attributes along with the received Segment metadata and additional metadata. The exporter can't detect which attributes are annotations, so it depends on the configuration to contain either a list of attribute names or a flag that results in all attributes being considered annotations.
This requires a user to have knowledge of the annotations being sent by the SDK ahead of time, which isn't always possible and has an added configuration burden, or have excess and unintentional annotations indexed.
Describe the solution you'd like
X-Ray annotations that get added to the Span attributes in the X-Ray receiver could be prepended with a prefix similar to the metadata:
opentelemetry-collector-contrib/receiver/awsxrayreceiver/internal/translator/metadata.go
Lines 31 to 33 in 3c72421
This way, the exporter could detect annotations (strip prefix and add it to translated Segment) without the use of the configuration fields. The configuration fields will not be altered and will still function in the same way for backwards compatibility and usage with other non X-Ray receivers.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: