opentelemetry-js
opentelemetry-js copied to clipboard
[exporters] set a config option for `user-agent` string header
Is your feature request related to a problem? Please describe.
As a developer I might want to use the SDK to create my own agent or even an OTEL distribution. I consider this a different product that the upstream repo provides (auto-instrumentations) so I would expect to have a way to identify it.
From the OTEL specs we can read
The format of the header SHOULD follow RFC 7231
And the RFC states
The User-Agent field-value consists of one or more product identifiers
so I would expect a way to add my product identifier along the one defined in the exporter.
The goal of having such feature is to allow any receiver of the exported signal (proxy, backend) to be able to differentiate between my product and others without having to inspect the request payload to check for resource attributes like SDK attribs
Describe the solution you'd like
The exporters accept a constructor param to append a product ID in the user agent string.
Describe alternatives you've considered
Env vars were used in the past (https://github.com/open-telemetry/opentelemetry-js/issues/4447) but it was more a workaround rather than a solution. Also there was a potential issue of users overriding it with wrong values (https://github.com/open-telemetry/opentelemetry-specification/issues/4230)
spec issue as discussed in the SIG https://github.com/open-telemetry/opentelemetry-specification/issues/4479
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.
This issue was closed because it has been stale for 14 days with no activity.