Relevant telegraf.conf
[[outputs.opentelemetry]]
service_address = "https://{{ metrics_fqdn }}/otlp/v1/metrics"
timeout = "10s"
tls_cert = "/etc/mtls.pem"
tls_key = "/etc/mtls.key"
tls_ca = "/etc/mtls.pem"
Logs from Telegraf
Error writing to outputs.opentelemetry: Post "https://{{ metrics_fqdn }}/otlp/v1/metrics": context deadline exceeded
System info
Telegraf 1.38.2, Docker 19.03.13, Rhel 7.8
Docker
No response
Steps to reproduce
- Configure Telegraf to use the opentelemetry output via grpc; with relevant tls configuration.
- Deploy a Telegraf docker container with
HTTPS_PROXY and HTTP_PROXY set.
- Metrics are sent.
- Configure Telegraf with the same config; but switch to http instead of grpc.
- Deploy a Telegraf docker container with
HTTPS_PROXY and HTTP_PROXY set.
- Metrics are not sent, and are instead buffered.
...
Expected behavior
outputs.opentelemetry should respect HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables when using either OTLP or HTTP, including when TLS options such as tls_ca, tls_cert, and tls_key are configured.
Actual behavior
When using outputs.opentelemetry over HTTP, the plugin does not appear to respect HTTP_PROXY / HTTPS_PROXY when TLS is enabled. Instead of routing through the proxy, Telegraf attempts a direct connection to the endpoint and eventually fails.
In contrast, switching the same configuration to gRPC works as expected... Metrics are successfully delivered, suggesting that connectivity, TLS configuration, and the endpoint itself are all valid.
This means there's inconsistency between the two protocols: gRPC honours proxy environment variables, while HTTP does not...
Additional info
No response
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.38.2, Docker 19.03.13, Rhel 7.8
Docker
No response
Steps to reproduce
HTTPS_PROXYandHTTP_PROXYset.HTTPS_PROXYandHTTP_PROXYset....
Expected behavior
outputs.opentelemetryshould respectHTTP_PROXY,HTTPS_PROXY, andNO_PROXYenvironment variables when using either OTLP or HTTP, including when TLS options such astls_ca,tls_cert, andtls_keyare configured.Actual behavior
When using
outputs.opentelemetryover HTTP, the plugin does not appear to respectHTTP_PROXY/HTTPS_PROXYwhen TLS is enabled. Instead of routing through the proxy, Telegraf attempts a direct connection to the endpoint and eventually fails.In contrast, switching the same configuration to gRPC works as expected... Metrics are successfully delivered, suggesting that connectivity, TLS configuration, and the endpoint itself are all valid.
This means there's inconsistency between the two protocols: gRPC honours proxy environment variables, while HTTP does not...
Additional info
No response