Skip to content

OTel log draining follow-ups - #7605

Merged
vito merged 4 commits into
dagger:mainfrom
vito:drain-svc-logs
Jun 11, 2024
Merged

vito merged 4 commits into
dagger:mainfrom
vito:drain-svc-logs

Conversation

@vito

@vito vito commented Jun 10, 2024

Copy link
Copy Markdown
Contributor
  • Standardize on slog everywhere that we print output from the engine, instead of "faking" stdout/stderr in places.
    • Goal: SpanLogger no longer leaves ambiguity as to whether caller needs to Close(). It never does.
    • We will no longer drain to ensure we get every last log, but this was never really an issue, doesn't seem worthwhile atm.
  • Rename telemetry.Logs to telemetry.SpanStdio so its intentions are clearer.
    • Goal: again, remove ambiguity as to whether caller needs to Close(). It always does.
  • Propagate client-side NO_COLOR=true and --debug through to the engine so SpanLogger can respect it.
    • Goal: now that everything is slog we should respect the user's preferences.
    • I needed this to get the dagger up --random test to pass without choking on ANSI colors.

vito and others added 3 commits June 10, 2024 12:27
Signed-off-by: Alex Suraci <[email protected]>
I was still having to wait 5 minutes for OTEL logs to drain on some test
runs that involved service tunneling. I believe there was a race
condition where the tunnel code could end up writing logs after they
were closed, which seems to create a leak and cause us to have to wait 5
minutes before a timeout is hit.

I also saw a few other place otel logs were created and not closed, so
added a close there too.

Signed-off-by: Erik Sipsma <[email protected]>
* SpanLogger no longer writes to stdio streams, since it's unclear at
  each logging site who has responsibility to Close(); this way no one
  does.
* switch last few holdouts to slog - for better or for worse, we should
  be consistent and iterate. We've started using slog for client-side
  logs, so we might as well adopt them server-side too.

Signed-off-by: Alex Suraci <[email protected]>
@vito
vito force-pushed the drain-svc-logs branch from 6e2a6e8 to bfc389e Compare June 10, 2024 21:30

@sipsma sipsma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Tests are a lot faster than current main it seems

I saw the failure in the test workflow:

server "8n179cewnjt7l9k0z281pel15" not found

I've seen that occasionally recently before this PR, so don't think it's related. I'm tempted to just say that we should just assume #7315 fixes it since that PR completely reworks how all of that works.

uses otel baggage, which I thankfully already went through the trouble
of propagating, and hadn't used yet. neat!

Signed-off-by: Alex Suraci <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants