influxdata / telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.
https://influxdata.com/telegraf
MIT License
14.53k stars 5.56k forks source link

Basic authentication for opentelemetry output #13297

Open ckt114 opened 1 year ago

ckt114 commented 1 year ago

Use Case

I've setup OTEL collector to listen on gRPC with basic authentication but there's no option to do so for telegraf's opentelemetry output. Is it possible to add basic authentication to telegraf's opentelemetry output?

Expected behavior

Unable to send metrics to OTEL OTLP that use basicauth extension.

Actual behavior

N/A

Additional info

No response

rajiv-k commented 1 year ago

I can pick this up.

ckt114 commented 1 year ago

@rajiv-k FYI that I was able to make it work for basic authentication using [outputs.opentelemetry.headers] section. I added the header authorization = "Basic BASE_64_ENCODED_USERNAME_COLON_PASSWORD". However, if you can make it an option for easier usage that'll be great.