#Intercept otel logs during dagger-in-dagger

1 messages · Page 1 of 1 (latest)

vague dragon
#

I am trying to understand why there is a difference in behavior between running this reproducible on my host machine vs dagger-in-dagger: https://github.com/frantjc/dag-intercept-otel-logs

go run ./cmd/repro

Intercepts the otel logs and prints them as expected, but

dagger call repro

does not.

Alternatively, if there's a better way to get ahold of the otel logs, that'd be great

mighty matrix
#

@vague dragon that's because when using dagger-in-dagger we override the OTEL endpoints for the containers that Dagger creates as they need to use our internal proxy to be routed all the way to the client.

When using the dagger CLI, the only way to set custom OTEL endpoints is by setting those in the caller's environment before effectively running dagger call

vague dragon
#

@mighty matrix thanks for the clarification!

does the client get ahold of the logs from the internal proxy via the sse event stream @ http://localhost:$DAGGER_SESSION_PORT/v1/logs or from somewhere else that I could take advantage of?

I'm trying to get a stream of the logs from the container that my client spawns.

I also looked into using RedirectStdout to a MountedDirectory, but no luck there so far

vague dragon
#

I hear that you're the cache mount tricks and hacks guy, so maybe you'll have a better idea than I about the RedirectStd___ option 🙂

mighty matrix
vague dragon
#

no. I'd be happy to explain more on why if you're interested, but it'd be a pretty long answer