Skip to content

Migrate runtime-telemetry to use declarative configuration API#15734

Merged
trask merged 2 commits intoopen-telemetry:mainfrom
trask:runtime-telemetry
Dec 30, 2025
Merged

Migrate runtime-telemetry to use declarative configuration API#15734
trask merged 2 commits intoopen-telemetry:mainfrom
trask:runtime-telemetry

Conversation

@trask
Copy link
Copy Markdown
Member

@trask trask commented Dec 26, 2025

No description provided.

@github-actions github-actions Bot added the test native This label can be applied to PRs to trigger them to run native tests label Dec 26, 2025
@trask trask force-pushed the runtime-telemetry branch 3 times, most recently from 621f255 to 47c4970 Compare December 27, 2025 17:39
@trask trask marked this pull request as ready for review December 27, 2025 18:30
@trask trask requested a review from a team as a code owner December 27, 2025 18:30
if (config.getBoolean("otel.instrumentation.runtime-telemetry-java17.enable-all", false)) {
boolean defaultEnabled =
DeclarativeConfigUtil.getInstrumentationConfig(openTelemetry, "common")
.getBoolean("default_enabled", true);
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.

This is mapped to agent.instrumentaion_mode (or similar) - see declarative config bridge

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.

Also spring.Instrumentation_mode

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.

thanks, forgot about this

I gave it some more thought: #15746

but will fix to use instrumentation_mode in this PR and we can discuss further in #15746

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.

RuntimeMetrics runtimeMetrics =
RuntimeMetricsConfigUtil.configure(
RuntimeMetrics.builder(GlobalOpenTelemetry.get()), AgentInstrumentationConfig.get());
RuntimeMetrics.builder(GlobalOpenTelemetry.get()), GlobalOpenTelemetry.get());
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.

Kind of redundant to pass otel twice, but I guess it's OK

@trask trask force-pushed the runtime-telemetry branch 2 times, most recently from 79388ba to a7dc153 Compare December 29, 2025 17:54
@trask trask force-pushed the runtime-telemetry branch from a7dc153 to b8b482b Compare December 29, 2025 18:27
@trask trask force-pushed the runtime-telemetry branch from d71d4f3 to 4f36c8d Compare December 29, 2025 22:38
@trask trask force-pushed the runtime-telemetry branch from 4f36c8d to c2522b0 Compare December 29, 2025 22:54
@Nullable
public static RuntimeMetrics configure(
RuntimeMetricsBuilder builder, InstrumentationConfig config) {
RuntimeMetricsBuilder builder, OpenTelemetry openTelemetry, String instrumentationMode) {
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.

I wonder if a proper enum is warranted here

@trask trask merged commit 647ba79 into open-telemetry:main Dec 30, 2025
87 checks passed
@trask trask deleted the runtime-telemetry branch December 30, 2025 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test native This label can be applied to PRs to trigger them to run native tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants