Skip to content

Migrate annotation instrumentation to declarative config API#15732

Merged
trask merged 1 commit intoopen-telemetry:mainfrom
trask:migrate-external-annotation-config
Dec 28, 2025
Merged

Migrate annotation instrumentation to declarative config API#15732
trask merged 1 commit intoopen-telemetry:mainfrom
trask:migrate-external-annotation-config

Conversation

@trask
Copy link
Copy Markdown
Member

@trask trask commented Dec 26, 2025

No description provided.

@trask trask force-pushed the migrate-external-annotation-config branch 2 times, most recently from 002f156 to ac8cbef Compare December 26, 2025 16:58
@trask trask force-pushed the migrate-external-annotation-config branch 2 times, most recently from b901967 to 6aa55ae Compare December 27, 2025 16:58
@trask trask force-pushed the migrate-external-annotation-config branch from 6aa55ae to 3116823 Compare December 27, 2025 17:34
DeclarativeConfigUtil.getInstrumentationConfig(
GlobalOpenTelemetry.get(), "opentelemetry_extension_annotations")
.getString("exclude_methods"));
GlobalOpenTelemetry.get(), "opentelemetry_extension_annotations"));
Copy link
Copy Markdown
Member Author

@trask trask Dec 27, 2025

Choose a reason for hiding this comment

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

changed this to support structured list for exclude_methods instead of simply carrying over the encoded string (and added test for it)

DeclarativeConfigUtil.getInstrumentationConfig(
GlobalOpenTelemetry.get(), "opentelemetry_instrumentation_annotations")
.getString("exclude_methods"));
GlobalOpenTelemetry.get(), "opentelemetry_instrumentation_annotations"));
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

same here

Comment on lines +5 to +8
exclude_methods:
- class: io.opentelemetry.test.annotation.TracedWithSpan
methods:
- ignored
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is the newly supported declarative config format (still falling back to the encoded version for backcompat)

@trask trask marked this pull request as ready for review December 27, 2025 18:11
@trask trask requested a review from a team as a code owner December 27, 2025 18:11
}

val testDeclarativeConfig by registering(Test::class) {
testClassesDirs = sourceSets.test.get().output.classesDirs
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice trick

@trask trask merged commit 02cadcd into open-telemetry:main Dec 28, 2025
85 checks passed
@trask trask deleted the migrate-external-annotation-config branch December 28, 2025 02:46
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.

2 participants