Skip to content

[Instrumentation.Process] Add schema URL#4088

Merged
martincostello merged 7 commits into
open-telemetry:mainfrom
martincostello:gh-4064-process
Apr 29, 2026
Merged

[Instrumentation.Process] Add schema URL#4088
martincostello merged 7 commits into
open-telemetry:mainfrom
martincostello:gh-4064-process

Conversation

@martincostello

@martincostello martincostello commented Apr 9, 2026

Copy link
Copy Markdown
Member

Contributes to #4064.

Changes

  • Add schema URL to metrics.
  • Removed the process.cpu.count metric.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

Comment thread src/OpenTelemetry.Instrumentation.Process/CHANGELOG.md Outdated
@github-actions github-actions Bot added the comp:instrumentation.process Things related to OpenTelemetry.Instrumentation.Process label Apr 9, 2026
@codecov

codecov Bot commented Apr 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.82%. Comparing base (a545405) to head (b819f87).
⚠️ Report is 59 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4088      +/-   ##
==========================================
- Coverage   73.85%   73.82%   -0.03%     
==========================================
  Files         459      459              
  Lines       18327    18307      -20     
==========================================
- Hits        13535    13516      -19     
+ Misses       4792     4791       -1     
Flag Coverage Δ
unittests-Instrumentation.Process 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...entation.Process/MeterProviderBuilderExtensions.cs 100.00% <100.00%> (ø)
...elemetry.Instrumentation.Process/ProcessMetrics.cs 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@martincostello
martincostello marked this pull request as ready for review April 9, 2026 17:11
@martincostello
martincostello requested a review from a team as a code owner April 9, 2026 17:11
Copilot AI review requested due to automatic review settings April 9, 2026 17:11

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

Adds OpenTelemetry schema URL (and scope version via MeterOptions.Version) to Process instrumentation metrics to align with the repo-wide effort in #4064.

Changes:

  • Create the Process instrumentation Meter via shared MeterFactory to populate TelemetrySchemaUrl and Version.
  • Update AddProcessInstrumentation to register the meter by MeterInstance.Name.
  • Extend unit tests to assert exported metrics include MeterVersion and a schema URL prefix; update changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/OpenTelemetry.Instrumentation.Process.Tests/ProcessMetricsTests.cs Adds assertions validating MeterVersion and MeterSchemaUrl are present on exported metrics.
src/OpenTelemetry.Instrumentation.Process/ProcessMetrics.cs Switches meter creation to shared factory with semantic conventions version to attach schema URL/version.
src/OpenTelemetry.Instrumentation.Process/OpenTelemetry.Instrumentation.Process.csproj Links in shared MeterFactory.cs for this instrumentation.
src/OpenTelemetry.Instrumentation.Process/MeterProviderBuilderExtensions.cs Registers the meter using ProcessMetrics.MeterInstance.Name.
src/OpenTelemetry.Instrumentation.Process/CHANGELOG.md Documents the added scope version and schema URL behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/OpenTelemetry.Instrumentation.Process/ProcessMetrics.cs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions Bot added the Stale label Apr 29, 2026
@martincostello martincostello added keep-open Prevents issues and pull requests being closed as stale and removed Stale labels Apr 29, 2026

@Kielek Kielek left a comment

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.

It is not fully true.

process.cpu.count is not defined in the otel spec.
I think that we should drop it first and then merge it.

Ultimate solution, include metrics:
https://github.com/dotnet/runtime/blob/a534a1c68e656b07d16015e2f46fa55b25bfd0b9/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Metrics/RuntimeMetrics.cs#L143-L147

for .NET Fx + .NET8 in Runtime Instrumentation package + link changelog to use other packages during migration.

@martincostello

This comment was marked as outdated.

Remove the `process.cpu.count` metric which is not part of the Semantic Conventions.
@martincostello

Copy link
Copy Markdown
Member Author

I think that we should drop it

Done.

@martincostello

Copy link
Copy Markdown
Member Author

open-telemetry/semantic-conventions#651 is tracking the ask to make this part of the actual Semantic Conventions.

@Kielek

Kielek commented Apr 29, 2026

Copy link
Copy Markdown
Member

On the other hand we have already https://github.com/open-telemetry/semantic-conventions/blob/main/docs/runtime/dotnet-metrics.md#metric-dotnetprocesscpucount

I would not declare this metric as part of 1.25.0, as it is not defined there.

@martincostello

Copy link
Copy Markdown
Member Author

I would not declare this metric as part of 1.25.0, as it is not defined there.

It isn't because it's been deleted? If we don't emit it it isn't associated with that schema URL.

@Kielek Kielek left a comment

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 missed that you have already committed fix here.

@martincostello
martincostello added this pull request to the merge queue Apr 29, 2026
@Kielek Kielek removed the keep-open Prevents issues and pull requests being closed as stale label Apr 29, 2026
Merged via the queue into open-telemetry:main with commit b60724e Apr 29, 2026
71 checks passed
@martincostello
martincostello deleted the gh-4064-process branch April 29, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:instrumentation.process Things related to OpenTelemetry.Instrumentation.Process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants