How to remove/rename span attributes? #1335
-
Hi, I'm trying to figure out how to rename the GraphQL instrumentation span attributes to semantic names using a span processor. I see how I can add a new attribute, but I don't see how to remove or rename an existing attribute on the span. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The best place to do this is in the OTel Collector and likely using an attribute processor1, however if you are not using a collector you can try to write some custom code for the client SDK. Span attribute processing is not a feature of the client SDK specification so it isn't something we currently support. That may change in the future with the introduction of schema upgrades/transformation. Some teams workaround that by injecting a custom span processor and edits the read/write span2, however you must insert your custom processor before you export the spans. Another option here would be to for you to submit a PR that updates the GraphQL instrumentation with the latest SemConv attributes! It would be a great way for you to get involved and help the project grow :) Footnotes |
Beta Was this translation helpful? Give feedback.
The best place to do this is in the OTel Collector and likely using an attribute processor1, however if you are not using a collector you can try to write some custom code for the client SDK. Span attribute processing is not a feature of the client SDK specification so it isn't something we currently support. That may change in the future with the introduction of schema upgrades/transformation.
Some teams workaround that by injecting a custom span processor and edits the read/write span2, however you must insert your custom processor before you export the spans.
Another option here would be to for you to submit a PR that updates the GraphQL instrumentation with the latest SemConv attribut…