Repository navigation
feat(opentelemetry): Honor OTEL_BSP_SCHEDULE_DELAY in the agent - #6388
Merged
Merged
Conversation
Contributor
|
📲 Install BuildsAndroid
|
The agent built Sentry's BatchSpanProcessor with the OpenTelemetry default, so spans always reached Sentry in 5 second batches, whatever otel.bsp.schedule.delay said. Read it from the agent's config instead. The Boot 4 agent suites set it to 100ms. Each of their tests waited for a 5 second batch, which made them take minutes on CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runningcode
force-pushed
the
no/otel-agent-bsp-schedule-delay
branch
from
November 6, 2026 13:30
cc1295a to
0b7e042
Compare
…t 3 agent suites Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runningcode
force-pushed
the
no/otel-agent-bsp-schedule-delay
branch
from
November 6, 2026 13:32
0b7e042 to
676a5d8
Compare
runningcode
marked this pull request as ready for review
November 6, 2026 13:32
runningcode
requested review from
0xadam-brown and
romtsn
and removed request for
a team
November 6, 2026 13:32
adinauer
approved these changes
Nov 10, 2026
adinauer
left a comment
Member
There was a problem hiding this comment.
In theory this affects existing customers who may already have configured this setting (without taking effect on Sentry) and also have an oddly short or long period configured. I think we can still release this as I think the risk is very minimal.
Co-authored-by: Alexander Dinauer <adinauer@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
We spent a lot of time idling in our tests. The idea behind this PR is to reduce that time.
I asked my agent to take a look at the slowest tests we had and it found that we had some 5 second timeouts in those.
See this scan for BEFORE sorted by slowest tests: https://scans.gradle.com/s/t7basb4sfdkx6/tests/slowest-tests
See this scan for AFTER sorted by slowest tests: https://scans.gradle.com/s/5jvitr5dsslqk/tests/slowest-tests
You can see that the two longest test went from 45s to 5s which shaves a total of 80 seconds off our test time (1:20s).
The only thing to note here is that this affects production code:
The OpenTelemetry agent now honors
otel.bsp.schedule.delay(OTEL_BSP_SCHEDULE_DELAY) for theBatchSpanProcessorthat sends spans to Sentry. If it isn't set, the OpenTelemetry default of 5 seconds stays.The Boot 2, Boot 3 and Boot 4 agent suites (
integrationTestOtelAgentandintegrationTestOtelAgentWithoutAutoInit) set it to 100ms. Their one negative check (unsampled trace sends no transactions) now waits 1 second instead of 6.💡 Motivation and Context
See the first paragraph for the before and after.
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🤖 Generated with Claude Code