jzelinskie / cobrautil

A collection of utility functions when using Cobra.
https://github.com/jzelinskie/cobrautil
Apache License 2.0
5 stars 10 forks source link

It doesn't seem to be possible to configure WithInsecure for an opentelemetry collector endpoint #13

Closed alexb-y42 closed 2 years ago

jzelinskie commented 2 years ago

This is absolutely true if you only want to use flags. cobrautil also supports the OpenTelemetry environment variables though, which can configure this.

Because there are just an absolute ton of options as standard environment variables, I'm not sure what ones are best represented as flags or if I should remove the flags entirely and only support the standard environment variables.

alexb-y42 commented 2 years ago

It doesn't look like OTEL_EXPORTER_OTLP_INSECURE is supported in this component or in opentelemetry-go. At least I can neither make it take any effect nor can I find any code suggesting that it's actually used.

jzelinskie commented 2 years ago

hmm I was under the impression from the otlptrace readme that it was reading environment variables when we call otlptrace.New().

vroldanbet commented 2 years ago

As described in https://github.com/jzelinskie/cobrautil/pull/14#issuecomment-1249538572, you can use OTEL_EXPORTER_OTLP_ENDPOINT. If the protocol is http, the go OTEL library will automatically use insecure communication