Skip to content

test(opentelemetry): [Sample Tests 36] Add an end-to-end test of the OTLP event linking - #6328

Draft
runningcode wants to merge 2 commits into
no/otel-agentless-integration-testfrom
no/otlp-integration-test
Draft

runningcode wants to merge 2 commits into
no/otel-agentless-integration-testfrom
no/otlp-integration-test

Conversation

@runningcode

@runningcode runningcode commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

Adds OtlpEndToEndTest to sentry-opentelemetry-otlp, and retires sentry-samples-console-otlp.

What the sample's test really checked. In the sample, OpenTelemetry exports spans over OTLP while everything else goes to Sentry. Its test asserted:

  • the console sample's events, breadcrumbs and metrics;
  • a message, a log and an invocations metric recorded inside an OpenTelemetry span.

It never checked the traces, which go over OTLP. It also never checked the one thing the module adds for events: OpenTelemetryOtlpEventProcessor linking an event to the current OpenTelemetry span.

What the new test checks. It installs OpenTelemetryOtlpEventProcessor, records the message, log and metric inside an OpenTelemetry span, and checks what reaches MockSentryServer:

  • the event carries the span's trace and span IDs, which is new;
  • the log and the invocations metric arrive.

The sample's other assertions are the console sample's, in the same order. #6324 ports those, and the event processor does nothing outside a span, so they aren't repeated here.

With no system test left, the sample comes off the runner and the backend workflow. The workflow's base row moves to sentry-samples-spring-boot-4-otlp. The sample also drops its Kotlin plugin, which only the test needed.

💡 Motivation and Context

OTLP users rely on events pointing to their OpenTelemetry trace. Nothing checked that end to end; now a test of under a second does.

💚 How did you test it?

  • The test passes, and so do the module's other 14 tests.
  • Without the event processor, the event isn't linked and the test fails.
  • :sentry-opentelemetry-otlp:check passes, and the sample's JAR still builds.

📝 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

sentry-samples-spring-boot-4-otlp, the last sample with system tests.

#skip-changelog

🤖 Generated with Claude Code

OtlpEndToEndTest captures a message, a log and a metric inside an
OpenTelemetry span with OpenTelemetryOtlpEventProcessor installed, and
checks what reaches MockSentryServer: the event carries the span's trace
and span IDs, and the log and the metric arrive. It ports the
OTLP-specific part of the console OTLP sample's system test, which never
checked the link. The sample's other assertions are the console
sample's, which SentryEndToEndTest covers.

The sample has no system test left, so it comes off the system-test
runner and the backend workflow, whose base row moves to the Spring
Boot 4 OTLP sample, and drops the Kotlin plugin it only needed for the
test.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sentry

sentry Bot commented Oct 20, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.61.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