Skip to content
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

Add support of Host header in otlphttpexporter #9395

Closed
enuret opened this issue Jan 25, 2024 · 0 comments · Fixed by #9411
Closed

Add support of Host header in otlphttpexporter #9395

enuret opened this issue Jan 25, 2024 · 0 comments · Fixed by #9411
Labels
enhancement New feature or request exporter/otlphttp

Comments

@enuret
Copy link
Contributor

enuret commented Jan 25, 2024

Is your feature request related to a problem? Please describe.
We try to use opentlelemetry collector gateway behind envoy as a gateway and send data there from collector layer in lambda function.

lambda function otel collector layer => Servicemesh gateway => otel collector gateway

Typically envoy uses authority/host headers for HTTP2/HTTP1 for request when routing
so for demonstrating the request should look like

curl https://evnoy-service -H 'host: otel-collector-host'

Describe the solution you'd like
I plan to add a config for host header into otlphttp exporter
https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlphttpexporter/config.go
and set Request.header in the moment of request
https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlphttpexporter/otlp.go#L124

Similar PR for grpc exporter:
#8228
I have a similar pull request ongoing in golang client
open-telemetry/opentelemetry-go#4780

Additional context
There is a tricky part in implementation of net.http.Request library. This library doesn't override Host header when it is passed as Request.Headers field . They have a special field Request.Host if Host header has to be overrided so configuration option for Host should be different than for generic Headers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exporter/otlphttp
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants