Add User-Agent customization support to OTLP Exporter via headers#6500
Add User-Agent customization support to OTLP Exporter via headers#6500
Conversation
|
@rajkumar-rangaraj 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Co-authored-by: rajkumar-rangaraj <9479006+rajkumar-rangaraj@users.noreply.github.com>
|
@copilot Don’t introduce a new public API. You proposed |
Co-authored-by: rajkumar-rangaraj <9479006+rajkumar-rangaraj@users.noreply.github.com>
Updated the implementation to avoid introducing a new public API. Instead of adding a The approach now matches the Python implementation pattern - users can set Commit: 30cdce9 |
|
@copilot Build FAILED. Error: /home/runner/work/opentelemetry-dotnet/opentelemetry-dotnet/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptionsExtensions.cs(81,26): error CS8602: Dereference of a possibly null reference. [/home/runner/work/opentelemetry-dotnet/opentelemetry-dotnet/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj::TargetFramework=netstandard2.0] |
Co-authored-by: rajkumar-rangaraj <9479006+rajkumar-rangaraj@users.noreply.github.com>
Fixed all build errors:
Build now succeeds on all target frameworks and all tests pass (3/3 User-Agent tests passing). Commit: 177c222 |
|
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
|
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
✅ User-Agent Customization for OTLP Exporter - BUILD FIXED
Fixed the build errors reported in the CI:
Issues Resolved:
customUserAgent.Trim()null reference by adding null-forgiving operator (!) since the value is already checked for null/whitespaceImplementation Status:
OTEL_EXPORTER_OTLP_HEADERSvariablesUsage Examples:
Via Headers property:
Via Environment Variable:
Test Results:
The implementation now successfully builds and follows the OpenTelemetry specification 1.49.0 for User-Agent customization without introducing new public APIs.
Fixes #6496.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.