#Cannot turn off traces and logs together

1 messages · Page 1 of 1 (latest)

glass oasis
#

Hello Team,

For our integration test, we want to disable traces and logs
we are using dagger 0.13.0 and we are following old fashioned dagger run using sdk(without modules)

I searched through the dagger code, and I found, if we set this env var OTEL_EXPORTER_OTLP_LOGS_ENDPOINT to empty value(https://github.com/dagger/dagger/blob/7527e4bf607f1206afc64565fefdf78737fcef9a/sdk/go/telemetry/init.go#L125), logs exporter won't intialize(disabled)

But to disable the traces, there should not be any env var prefixed with OTEL_(https://github.com/dagger/dagger/blob/7527e4bf607f1206afc64565fefdf78737fcef9a/sdk/go/telemetry/init.go#L29), then doing so it will disable traces but then we have to remove OTEL_EXPORTER_OTLP_LOGS_ENDPOINT, which will be enabled to check logs exporter(it comes with wierd errors in logs that endpoint is not set), so basically these settings cannot work together becasue one is not allowing other to work properly.

is it by design or any plan to fix this code?

GitHub

An engine to run your pipelines in containers. Contribute to dagger/dagger development by creating an account on GitHub.

distant roost
#

Hi @glass oasis , I'm sure that is not by design but @warm moon or @limpid crown may be able to help more

warm moon
#

I'm confused - if you want to disable both traces and logs, don't you need to just unset all OTEL_* vars? But then it sounds like you want one but not the other? thinkspin

glass oasis
#

for the logs, i have to correct myself
to disable the logs i have to manully set this to empty
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=""
otherwise i see connection error keeps on printing with application logs

warm moon
#

ah I see - yeah we should probably adjust that logic, maybe there's upstream OTel code we can use for this sort of thing. can you open an issue? 🙏

glass oasis
dusk rover
#

@glass oasis as a stopgap, doesn't setting both OTEL_EXPORTER_OTLP_TRACES_ENDPOINT and OTEL_EXPORTER_OTLP_LOGS_ENDPOINT to "" works?

glass oasis
#

no it does not work, i tried that

deft hazel
#

hey @glass oasis , im new and taking a stab at your issue, but failing to repro on main with the env vars set as you describe. what do the connection error logs look like?

glass oasis
#

👋 basically error looks like this

deft hazel
#

thanks @glass oasis! still poking a bit futher, i'm curious, do you get the behavior you want with dagger logout; unset OTEL_EXPORTER_OTLP_LOGS_ENDPOINT; unset OTEL_EXPORTER_OTLP_TRACES_ENDPOINT; dagger ... ?

#

there should be some way to fall back to default-dont-send-logs-or-traces, as you've pointed out. it's surprising that unsetting doesn't get us there, but maybe there's some reason you want to be logged in and yet not sending logs or traces?

glass oasis
#

👋 @deft hazel we are not using cloud btw, its just on prem, and above settings did not work for me

deft hazel
#

Figured! I have a working fix up on GitHub, just waiting for review.

glass oasis
#

@deft hazel any update on this?