Skip to content

Disable coroutine WithSpan by default in v3 preview#18919

Merged
laurit merged 1 commit into
open-telemetry:mainfrom
trask:disable-coroutine-withspan-v3-preview
Jun 8, 2026
Merged

Disable coroutine WithSpan by default in v3 preview#18919
laurit merged 1 commit into
open-telemetry:mainfrom
trask:disable-coroutine-withspan-v3-preview

Conversation

@trask

@trask trask commented Jun 6, 2026

Copy link
Copy Markdown
Member

Closes #18899

Disable Kotlin coroutine suspend-function @WithSpan instrumentation by default when v3 preview is enabled.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 @WithSpan annotation 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 a testV3Preview Gradle task wired into check.
  • 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
trask marked this pull request as ready for review June 6, 2026 20:04
@trask
trask requested a review from a team as a code owner June 6, 2026 20:04
@laurit
laurit merged commit fecf3fa into open-telemetry:main Jun 8, 2026
95 checks passed
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.

Disable @WithSpan coroutine support in 3.0

3 participants