PoC: OpenTelemetry traces for RSpec test executions (TE-6490) - #261
Draft
nprizal wants to merge 24 commits into
Draft
PoC: OpenTelemetry traces for RSpec test executions (TE-6490)#261nprizal wants to merge 24 commits into
nprizal wants to merge 24 commits into
Conversation
TE-6490 PoC. Open one OTel span per test execution in the RSpec around(:each) hook and export spans over OTLP, correlated to the execution via a span_trace_key tag stamped on every span. The opentelemetry-* gems are soft dependencies (lazy require): when they are absent span export disables itself and the collector behaves exactly as before, so the gem's Ruby >= 2.3 floor is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nprizal
commented
Jul 23, 2026
nprizal
commented
Jul 23, 2026
nprizal
commented
Jul 23, 2026
mattensor
reviewed
Jul 28, 2026
mattensor
reviewed
Jul 28, 2026
| OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(exporter) | ||
| ) | ||
| # PoC shortcut: capture every available instrumentation. | ||
| c.use_all |
There was a problem hiding this comment.
We'd have intelligence around which instrumentation to include in our first release
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.
Summary
This developer-facing PoC adds opt-in OpenTelemetry export for RSpec test executions so we can dogfood test-scoped traces with Buildkite Test Engine.
Each sampled example creates an independently rooted
test.executionspan. Synchronous HTTP, SQL, Redis, and other instrumented work becomes its descendants. The normal Test Engine execution upload remains authoritative and independent: OpenTelemetry configuration and delivery failures warn or drop telemetry without failing tests or blocking the upload.This is intentionally a v3 experiment. It requires Ruby 3.3+ and packages the tested OpenTelemetry SDK, OTLP exporter, and instrumentation set as core dependencies.
Implemented contracts
Buildkite-Test-Run-Keyandbuildkite.test.run.key. The authenticated receiver—not the collector—derives the canonical suite-scoped run UUID.BUILDKITE_JOB_IDfrom the Buildkite process environment is sent consistently in the job header and resource attributes. Legacy or configured overrides cannot manufacture typed job identity.TRACEPARENT/TRACESTATEbecomes one SpanLink created with the root; it never becomes the parent.tracing_enabledoption.Dogfooding scope
This PR is evidence gathering, not a production support commitment. It deliberately uses broad
use_all/install_allinstrumentation and SDK-default batching. Static skips, production sampling and limits, an instrumentation allowlist, other test frameworks, sensitive-data policy, operating cost, and delivery guarantees remain decisions for the dogfooding exercise.The two review documents are:
Verification