-
Notifications
You must be signed in to change notification settings - Fork 859
Add user agent customization #6686
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
base: main
Are you sure you want to change the base?
Add user agent customization #6686
Conversation
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs
Outdated
Show resolved
Hide resolved
e8fab7f to
3d05c14
Compare
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs
Outdated
Show resolved
Hide resolved
…ptions.cs Co-authored-by: Martin Costello <[email protected]>
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs
Outdated
Show resolved
Hide resolved
…ptions.cs Co-authored-by: Martin Costello <[email protected]>
|
Looks OK to me now - the maintainers just need to be happy with how it presents as a new public API. |
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the user agent identifier. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: make it clear that this will be prepended to the existing default string.
also, please do add a changelog entry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the documentation
Fixes #6496
Design discussion issue #
Changes
Please provide a brief description of the changes here.
This pull request enhances the configuration of the
User-AgentHTTP header in theOtlpExporterOptionsclass, allowing users to prepend custom product identifiers to the default exporter information. It introduces a new property for customization, updates header construction logic, and adds comprehensive tests to ensure correct behavior and compliance with HTTP standards.User-Agent customization improvements:
UserAgentProductIdentifierproperty toOtlpExporterOptionsthat allows users to specify a custom product identifier to be prepended to the defaultUser-Agentheader. The header updates dynamically when this property changes.User-Agentstring to include the custom identifier, ensuring proper formatting and RFC 7231 compliance (space-separated tokens).StandardHeadersfrom a static readonly array to a static property backed by a private field, so it reflects the current user agent identifier. [1] [2]Testing enhancements:
OtlpExporterOptionsTests.csto verify the default and custom behaviors of theUserAgentProductIdentifierproperty, including handling of empty/whitespace values, correct header formatting, and compliance with HTTP standards.Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial changes