Skip to content

Prometheus exporter: Add default aggregation config option#5249

Closed
ArthurSens wants to merge 2 commits into
open-telemetry:mainfrom
ArthurSens:prom-defaultaggregation
Closed

Prometheus exporter: Add default aggregation config option#5249
ArthurSens wants to merge 2 commits into
open-telemetry:mainfrom
ArthurSens:prom-defaultaggregation

Conversation

@ArthurSens
Copy link
Copy Markdown
Member

Description

Add default_aggregation to PrometheusMetricReader, allowing the Prometheus exporter to configure the MetricReader default aggregation as a function of instrument kind.
This follows the Prometheus exporter spec section being stabilized in open-telemetry/opentelemetry-specification#5113.

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?

  • uv run tox -e py312-test-opentelemetry-exporter-prometheus -- exporter/opentelemetry-exporter-prometheus/tests/test_prometheus_exporter.py::TestPrometheusMetricReader::test_constructor_default_aggregation
  • uv run ruff check exporter/opentelemetry-exporter-prometheus/src/opentelemetry/exporter/prometheus/__init__.py exporter/opentelemetry-exporter-prometheus/tests/test_prometheus_exporter.py

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

Disclaimer: This PR was assisted by LLMs

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
@ArthurSens ArthurSens requested a review from a team as a code owner May 25, 2026 21:20
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
@herin049
Copy link
Copy Markdown
Contributor

Thanks for opening this PR! Unfortunately, we already have an open PR that addresses this: #5117.

@ArthurSens
Copy link
Copy Markdown
Member Author

Oh, nice!

@herin049
Copy link
Copy Markdown
Contributor

Going to close this for now, let me know if it needs re-opening.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants