open-telemetry / opentelemetry-go-instrumentation

OpenTelemetry Auto Instrumentation using eBPF
https://opentelemetry.io
Apache License 2.0
413 stars 65 forks source link

Add log verbosity configuration and move the log in controller.go to debug level #691

Open RonFed opened 4 months ago

RonFed commented 4 months ago

Currently, we print a log message for each span: https://github.com/open-telemetry/opentelemetry-go-instrumentation/blob/61ff124646105a2058863b17da1815d8d42d78b3/internal/pkg/opentelemetry/controller.go#L54

We should change that to have a debug level. We don't have a configuration for verbosity. We probably should add support for configuration via:

  1. command line arguments
  2. InstrumentationOption
  3. Enviroment variable (?)

This will need to be modified: https://github.com/open-telemetry/opentelemetry-go-instrumentation/blob/61ff124646105a2058863b17da1815d8d42d78b3/instrumentation.go#L70-L83

RonFed commented 3 months ago

@MrAlias @pellared I'd be happy to hear your thoughts on this.

khushijain21 commented 1 month ago

@RonFed is this open for contribution?

RonFed commented 1 month ago

@khushijain21 Sure

vitorhugoro1 commented 1 month ago

@khushijain21 are you going to work on this issue? If not I will work on this.

@RonFed from the three approches you provide, which one do you think is optimal?

By my experience when trying to use with k8s, if is with command line argument seems more clear which option of log level is set.

khushijain21 commented 1 month ago

@vitorhugoro1 yes, you can go ahead

RonFed commented 1 month ago

@vitorhugoro1 I think we need to support the first 2, and not sure about env var. @MrAlias What do you think?

pellared commented 1 month ago

Regarding env var I think we should support OTEL_LOG_LEVEL per https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#general-sdk-configuration