Disable coroutine WithSpan by default in v3 preview#18919
Merged
laurit merged 1 commit intoJun 8, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Disables Kotlin coroutine suspend-function @WithSpan instrumentation by default when otel.instrumentation.common.v3-preview is enabled, aligning kotlinx-coroutines javaagent behavior with the v3 preview rollout while preserving the ability to run the rest of coroutine context-propagation instrumentation.
Changes:
- Gate the kotlinx-coroutines
@WithSpanannotation instrumentation module behind!AgentCommonConfig.get().isV3Preview()for its default enablement. - Update coroutine javaagent tests to assert no
@WithSpan-generated spans under v3 preview, and add atestV3PreviewGradle task wired intocheck. - Update instrumentation metadata text to reflect the v3-preview default behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| instrumentation/kotlinx-coroutines/kotlinx-coroutines-1.0/metadata.yaml | Updates the description to note v3-preview default behavior for suspend-function @WithSpan support. |
| instrumentation/kotlinx-coroutines/kotlinx-coroutines-1.0/javaagent/src/test/kotlin/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/v1_0/KotlinCoroutinesInstrumentationTest.kt | Adds v3-preview conditional assertions ensuring no spans are produced by @WithSpan under v3 preview. |
| instrumentation/kotlinx-coroutines/kotlinx-coroutines-1.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/v1_0/instrumentationannotations/AnnotationInstrumentationModule.java | Disables the annotation instrumentation module by default when v3 preview is enabled. |
| instrumentation/kotlinx-coroutines/kotlinx-coroutines-1.0/javaagent/build.gradle.kts | Adds a v3-preview test task and makes check depend on it to run the suite under v3 preview. |
trask
marked this pull request as ready for review
June 6, 2026 20:04
laurit
approved these changes
Jun 8, 2026
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.
Closes #18899
Disable Kotlin coroutine suspend-function
@WithSpaninstrumentation by default when v3 preview is enabled.