Repository navigation
feat(opentelemetry): Honor OTEL_BSP_SCHEDULE_DELAY in the agent - #6388
Draft
runningcode wants to merge 2 commits into
Draft
runningcode wants to merge 2 commits into
runningcode wants to merge 2 commits into
Conversation
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>
Contributor
|
📲 Install BuildsAndroid
|
This branch has not been deployed
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
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 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
SentryAutoConfigurationCustomizerProviderbuilt the processor withBatchSpanProcessor.builder(...).build(), so the standard OpenTelemetry setting was ignored and spans always arrived in 5 second batches.In the agent suites, almost every test waits for one of those batches. On CI each suite took about 2m47s, and
cache put and get produce spanstook 44s: about 34s of app startup plus two 5 second batch waits (build scan).The Boot 2 and Boot 3 agent suites don't set the delay yet. The
e2e_testsrule now says so.💚 How did you test it?
Ran both Boot 4 agent suites locally: 25 tests each, all passing (build scan). Most tests went from about 5s to under a second, and
cache put and get produce spanswent from 11–19s to about 6s. The remaining 5 second tests wait for Sentry's own metrics and logs batches, which this setting doesn't affect.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Set the delay in the Boot 2 and Boot 3 agent suites too.
🤖 Generated with Claude Code