Skip to content

Prevent server's OpenTelemetry Context getting lost on client read timeout#53115

Open
brunobat wants to merge 1 commit intoquarkusio:mainfrom
brunobat:otel-context-and-read-timeout
Open

Prevent server's OpenTelemetry Context getting lost on client read timeout#53115
brunobat wants to merge 1 commit intoquarkusio:mainfrom
brunobat:otel-context-and-read-timeout

Conversation

@brunobat
Copy link
Member

@brunobat brunobat commented Mar 17, 2026

Fixes #52239

The tryEndSpan() is needed to avoid double closing the span, if a server side response is made available.

@quarkus-bot
Copy link

quarkus-bot bot commented Mar 17, 2026

/cc @radcortez (opentelemetry)

Comment on lines +73 to +78
// Connection reset (e.g. client read timeout) can be triggered while a worker is still be running.
// Will end the span to record the failure but don't close the scope yet because it would erase the OTel context
// and mess with ongoing child spans
if (spanOperation.tryEndSpan()) {
instrumenter.end(spanOperation.getSpanContext(), (REQ) request, (RESP) response, failure);
}
Copy link
Member

Choose a reason for hiding this comment

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

When will the scope be closed?

@quarkus-bot
Copy link

quarkus-bot bot commented Mar 17, 2026

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit c78ab89.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
Build report Produce report and add it as job summary ⚠️ Check → Logs Raw logs 🚧

You can consult the Develocity build scans.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenTelemetry: Context get lost when hitting rest client read timeout

2 participants