opentelemetry-python
opentelemetry-python copied to clipboard
feat(metrics): add MetricProducer support (fixes #4768)
Description
Introduces a MetricProducer interface and integrates the producer collection into MetricReader.collect, enabling the Python SDK to ingest metrics from third-party sources. Adds supporting tests, documentation, and examples.
Fixes #4768
Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] 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?
tox -e py310-test-opentelemetry-sdk -- -k "MetricProducer" -vv (uses uv to provision; passes MetricProducer suite, with the known benign Windows teardown AttributeError in TestLoggingInit.test_dictConfig_preserves_otel_handler)
Does This PR Require a Contrib Repo Change?
- [ ] Yes. - Link to PR:
- [X] No.
Checklist:
- [X] Followed the style guidelines of this project
- [ ] Changelogs have been updated
- [X] Unit tests have been added
- [X] Documentation has been updated