diff --git a/cli/cmd/resources/odiglet.go b/cli/cmd/resources/odiglet.go index 36a008218..c921c41f4 100644 --- a/cli/cmd/resources/odiglet.go +++ b/cli/cmd/resources/odiglet.go @@ -532,6 +532,10 @@ func NewOdigletDaemonSet(ns string, version string, imagePrefix string, imageNam }, }, }, + { + Name: "OTEL_LOG_LEVEL", + Value: "info", + }, }, dynamicEnv...), EnvFrom: []corev1.EnvFromSource{ { diff --git a/odiglet/README.md b/odiglet/README.md index fa70ee5b5..9e356022d 100644 --- a/odiglet/README.md +++ b/odiglet/README.md @@ -7,3 +7,5 @@ Assuming a setup with an active kind cluster with Odigos installed: In addition, it will port-forward the debugger port for remote debug. 2. Using vscode launch the `Remote Odiglet` configuration. 3. Debug the code. + +Odiglet defaults to use the environment variable `OTEL_LOG_LEVEL` with value of `info`. When debugging or developing it is useful to increase the log level to `debug` for instrumentations. Note that this value only controls the log level for the instrumentations Odiglet invokes directly (eBPF) and does not apply for the k8s controllers or 3rd party agents. diff --git a/odiglet/go.mod b/odiglet/go.mod index 4a8807d45..92d198d0b 100644 --- a/odiglet/go.mod +++ b/odiglet/go.mod @@ -14,7 +14,7 @@ require ( github.com/odigos-io/odigos/opampserver v0.0.0 github.com/odigos-io/odigos/procdiscovery v0.0.0 github.com/odigos-io/opentelemetry-zap-bridge v0.0.5 - go.opentelemetry.io/auto v0.13.0-alpha.0.20240615124104-22d9af3d1a11 + go.opentelemetry.io/auto v0.13.0-alpha.0.20240705154812-28b663b26905 go.opentelemetry.io/otel v1.27.0 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 go.uber.org/zap v1.27.0 diff --git a/odiglet/go.sum b/odiglet/go.sum index d02700685..b8a3b4871 100644 --- a/odiglet/go.sum +++ b/odiglet/go.sum @@ -311,8 +311,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/auto v0.13.0-alpha.0.20240615124104-22d9af3d1a11 h1:H2w8qlDoZELdWskPATWM/yKQ3aLSokS2PxhoDP6DcPw= -go.opentelemetry.io/auto v0.13.0-alpha.0.20240615124104-22d9af3d1a11/go.mod h1:7lDId8pdd0bm8odWRLh8xdA01d7oRtLMxwLCZAuibtc= +go.opentelemetry.io/auto v0.13.0-alpha.0.20240705154812-28b663b26905 h1:jkn+mjs7Cpfzj/bjs8M9Ums2bxoABgq9ZtFI4aeL9M4= +go.opentelemetry.io/auto v0.13.0-alpha.0.20240705154812-28b663b26905/go.mod h1:7lDId8pdd0bm8odWRLh8xdA01d7oRtLMxwLCZAuibtc= go.opentelemetry.io/collector/pdata v1.7.0 h1:/WNsBbE6KM3TTPUb9v/5B7IDqnDkgf8GyFhVJJqu7II= go.opentelemetry.io/collector/pdata v1.7.0/go.mod h1:ehCBBA5GoFrMZkwyZAKGY/lAVSgZf6rzUt3p9mddmPU= go.opentelemetry.io/contrib/bridges/prometheus v0.52.0 h1:NNkEjNcUXeNcxDTNLyyAmFHefByhj8YU1AojgcPqbfs= diff --git a/odiglet/pkg/ebpf/go.go b/odiglet/pkg/ebpf/go.go index c95050e00..0dff09587 100644 --- a/odiglet/pkg/ebpf/go.go +++ b/odiglet/pkg/ebpf/go.go @@ -37,6 +37,7 @@ func (g *GoInstrumentationFactory) CreateEbpfInstrumentation(ctx context.Context inst, err := auto.NewInstrumentation( ctx, + auto.WithEnv(), // for OTEL_LOG_LEVEL auto.WithPID(pid), auto.WithResourceAttributes(utils.GetResourceAttributes(podWorkload, podName)...), auto.WithServiceName(serviceName),