Skip to content

Introduce OTel SPI Metrics#11297

Open
mhlidd wants to merge 2 commits intomasterfrom
mhlidd/add_extensions_metric
Open

Introduce OTel SPI Metrics#11297
mhlidd wants to merge 2 commits intomasterfrom
mhlidd/add_extensions_metric

Conversation

@mhlidd
Copy link
Copy Markdown
Contributor

@mhlidd mhlidd commented May 6, 2026

What Does This Do

With the end goal to track which SPIs are used frequently with dd-trace-java, this PR introduces the skeleton needed to report this metrics. Notable tags are spi_class and source.

Motivation

Additional Notes

Contributor Checklist

Jira ticket: [PROJ-IDENT]

Note: Once your PR is ready to merge, add it to the merge queue by commenting /merge. /merge -c cancels the queue request. /merge -f --reason "reason" skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see this doc.

@mhlidd mhlidd changed the title init Introduce OTel SPI Metrics May 6, 2026
@mhlidd mhlidd added type: enhancement Enhancements and improvements comp: telemetry Telemetry tag: ai generated Largely based on code generated by an AI or LLM labels May 6, 2026
@mhlidd mhlidd marked this pull request as ready for review May 6, 2026 23:28
@mhlidd mhlidd requested review from a team as code owners May 6, 2026 23:28
@mhlidd mhlidd requested review from mcculls, sarahchen6 and ygree and removed request for a team May 6, 2026 23:28
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cd83b4a913

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

return INSTANCE;
}

public void recordSpiDetected(String spiFqn, String source) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Enqueue SPI detections before draining

In any runtime where OTel SPI providers are present, this metric will still never be emitted: I checked repo-wide (rg recordSpiDetected) and the only callers are the new tests, so the telemetry action drains an always-empty queue. Please wire the SPI discovery/loading path to call this method before enabling the periodic action.

Useful? React with 👍 / 👎.

if (telemetryMetricsEnabled) {
actions.add(new CoreMetricsPeriodicAction());
actions.add(new OtelEnvMetricPeriodicAction());
actions.add(new OtelSpiMetricPeriodicAction());
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.

Maybe gate this on InstrumenterConfig.get().getTraceExtensionsPath() being non-null

If the extensions path is not set then we know we'll never be receiving any SPI metrics to export.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: telemetry Telemetry tag: ai generated Largely based on code generated by an AI or LLM type: enhancement Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants