Skip to content

Conversation

@anuraaga
Copy link
Contributor

@anuraaga anuraaga commented Jan 16, 2026

Description

I am helping to implement SDK internal metrics

https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/

I have started with the most basic of them, started and ended spans. This sets up some test infrastructure as well and will be good to confirm before implementing more.

For reference, similar change in
Java: open-telemetry/opentelemetry-java#7895
JS: open-telemetry/opentelemetry-js#6213

/cc @xrmx to help with review

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit tests

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@anuraaga anuraaga requested a review from a team as a code owner January 16, 2026 09:35
@anuraaga
Copy link
Contributor Author

Hmm - this change may be hard since many contrib tests seem to verify metric count itself, not just the metrics from the instrumentation. Any ideas how to proceed?

@xrmx xrmx self-assigned this Jan 19, 2026
@xrmx
Copy link
Contributor

xrmx commented Jan 19, 2026

Hmm - this change may be hard since many contrib tests seem to verify metric count itself, not just the metrics from the instrumentation. Any ideas how to proceed?

Assuming most of the instrumentations are using TestBase from tests/opentelemetry-test-utils/src/opentelemetry/test/test_base.py maybe adding filtering to get_sorted_metrics will make updating the instrumentation easy. I think we also have some pytest based helpers but these should be local to the instrumentations.

UPDATE: I see also some are reading directly from a MetricReader so that should also require local filtering or move to TestBase

@xrmx xrmx moved this to Ready for review in @xrmx's Python PR digest Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

2 participants