open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
750 stars 186 forks source link

support v0.3.0 of configuration file format #1423

Open codeboten opened 2 weeks ago

codeboten commented 2 weeks ago

Is your feature request related to a problem? I'm trying to load the current kitchen-sink example from the opentelemetry-configuration repository, but unfortunately I'm running into a problem setting headers for my OTLP exporter. This is the error I see

Invalid type for path "open_telemetry.tracer_provider.processors.1.batch.exporter.otlp.headers.0". Expected "scalar", but got "array".

It's caused by the change in headers format from a map to an array of name/value objects in https://github.com/open-telemetry/opentelemetry-configuration/commit/f89f35ac5553b6cce0db30bb8c8d32f2d3cbfe01

Describe the solution you'd like I would like to be able to use the following header configuration

    headers:
      - name: api-key
        value: "1234"

Describe alternatives you've considered not using the latest file format, but that didn't work either because v0.3 is the only supported format :D

brettmc commented 2 weeks ago

Thanks for raising this. I've got a work-in-progress to implement the remaining features for 0.3 compatibility and I should have a PR ready in a couple of days...

codeboten commented 2 weeks ago

Thanks @brettmc!