Skip to content

feat(opentelemetry): Honor OTEL_BSP_SCHEDULE_DELAY in the agent - #6388

Draft
runningcode wants to merge 2 commits into
mainfrom
no/otel-agent-bsp-schedule-delay
Draft

runningcode wants to merge 2 commits into
mainfrom
no/otel-agent-bsp-schedule-delay

Conversation

@runningcode

@runningcode runningcode commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

The OpenTelemetry agent now honors otel.bsp.schedule.delay (OTEL_BSP_SCHEDULE_DELAY) for the BatchSpanProcessor that sends spans to Sentry. If it isn't set, the OpenTelemetry default of 5 seconds stays.

The Boot 4 agent suites (integrationTestOtelAgent and integrationTestOtelAgentWithoutAutoInit) set it to 100ms. Their one negative check (unsampled trace sends no transactions) now waits 1 second instead of 6.

💡 Motivation and Context

SentryAutoConfigurationCustomizerProvider built the processor with BatchSpanProcessor.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 spans took 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_tests rule 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 spans went 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

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Set the delay in the Boot 2 and Boot 3 agent suites too.

🤖 Generated with Claude Code

runningcode and others added 2 commits October 27, 2026 11:42
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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against cc1295a

@sentry

sentry Bot commented Oct 27, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.62.0 (1) release

⚙️ sentry-android Build Distribution Settings

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant