Skip to content

[feature request] Support best-practice tracestate mutation#3091

Description

@gearset-joe-ls

Package

OpenTelemetry

Is your feature request related to a problem?

Hi great people, 馃憢

The W3C recommend several practices when mutating the tracestate header:

  • "Vendors SHOULD NOT delete keys that were not generated by them."
  • "Modified keys SHOULD be moved to the beginning (left) of the list."
  • "the order of unmodified key/value pairs MUST be preserved"
  • "Spaces and horizontal tabs surrounding list-members are ignored"
  • "Empty list members are allowed"

It is tricky and time-consuming to write tracestate mutation code that follows these practices, so I wonder if we might consider providing an API in this package. Perhaps a TraceState struct that wraps the string value and provides "Update" methods, or a static helper class.

I am happy to author a PR if the idea meets approval.

Thanks

What is the expected behavior?

An API for performing tracestate mutation that adheres to the W3C's recommended practices

Which alternative solutions or features have you considered?

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    comp:extensionsThings related to OpenTelemetry.ExtensionsenhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions