Skip to content

Commit

Permalink
[headerssetter] Remove "Limitations" section from README. (#27465)
Browse files Browse the repository at this point in the history
The docs for the `headers_setter` extension state that the
`from_context` config option does not work if the batch processor is
used. I believe this comment is out of date, because it seems that the
[PR](open-telemetry/opentelemetry-collector#7578)
linked to the
[issue](open-telemetry/opentelemetry-collector#4544)
has been merged. Note that I haven't tested that this actually works
with the header setter extension. Please let me know if you think
testing is necessary.

Co-authored-by: Juraci Paixão Kröhling <juraci@kroehling.de>
  • Loading branch information
ptodev and jpkrohling authored Oct 24, 2023
1 parent 3a27029 commit d50e094
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions extension/headerssetterextension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,8 @@ service:
exporters: [ loki ]
```
## Limitations
At the moment, it is not possible to use the `from_context` option to ge the
header value if Collector's pipeline contains the batch processor. See [#4544].


[alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha
[contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib
[Mimir]: https://grafana.com/oss/mimir/
[Tempo]: https://grafana.com/oss/tempo/
[Loki]: https://grafana.com/oss/loki/
[#4544]: https://github.com/open-telemetry/opentelemetry-collector/issues/4544
[Loki]: https://grafana.com/oss/loki/

2 comments on commit d50e094

@romanvogman
Copy link

@romanvogman romanvogman commented on d50e094 Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ptodev perhaps I'm missing something - but I've used the latest image and couldn't use from_context with a pipeline containing a batch process.
Removing the batch process from pipeline resolved it, so I believe the limitation is still there (would have saved me a few good hours knowing that it exists)

here are the headers sent and received with batch process enabled (empty X-Scope-Orgid header value):

Sent:

POST /v1/traces HTTP/1.1
Host: localhost:4319
User-Agent: OTel-OTLP-Exporter-Python/1.20.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
tenant_id: foo
Content-Type: application/x-protobuf
Content-Length: 226 

Received:

POST /v1/traces HTTP/1.1
Host: ubuntu:4319
User-Agent: OpenTelemetry Collector Contrib/0.88.0 (linux/amd64)
Content-Length: 214
Content-Encoding: gzip
Content-Type: application/x-protobuf
X-Scope-Orgid:
Accept-Encoding: gzip

headers_setter config section:

    extensions:
      headers_setter:
        headers:
        - from_context: tenant_id
          key: X-Scope-OrgID

As I've said, removing the batch process resolves it.

@ptodev
Copy link
Contributor Author

@ptodev ptodev commented on d50e094 Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, and apologies for the extremely late reply! I think you just need a metadata_keys in your batch processor. I submitted a PR to make the docs more clear.

Please sign in to comment.