open-telemetry / opentelemetry-swift

OpenTelemetry API for Swift
https://opentelemetry.io/docs/instrumentation/swift/
Apache License 2.0
207 stars 124 forks source link

Set headers for request in HTTP Metric exporter #533

Closed redryerye closed 4 months ago

redryerye commented 4 months ago

Background

I have noticed that headers in OtlpConfiguration or OtlpHttpExporterBase.envVarHeaders do not get added to the request when exporting through OtlpHttpMetricExporter.

What's changed in this PR?

This PR will set custom headers to OtlpHttpTraceExporter requests. I followed the implementation in OtlpHttpTraceExporter.

vvydier commented 4 months ago

yes, OtlpHttpMetricExporter also needs to honor the headers in OtlpConfiguration. Thanks for your contribution.