metrics: add experimental view_matching_mode (composable metric views) support
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- observability
Línea de trabajo
Start with opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/metric_reader_storage.py and metrics/_internal/__init__.py, then read the matching logic in _handle_view_instrument_match and the MeterProvider configuration path. Review the linked specification sections and the related View implementation before deciding how to cover matching, precedence, attribute filters, and advisory parameters. Done means opt-in composable matching is implemented with the specified fallback and error behavior, while independent mode remains the default.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
The OpenTelemetry Metrics SDK specification defines an experimental (Development) view_matching_mode configuration parameter (independent vs. composable) on MeterProvider to compose multiple matching Views (for example, combining a wildcard View that filters attribute_keys with an instrument-specific View that customizes aggregation) into merged metric streams rather than emitting duplicate/conflicting streams (specification/metrics/sdk.md#L519-L543, introduced in https://github.com/open-telemetry/opentelemetry-specification/pull/5173).
Currently in opentelemetry-sdk, MetricReaderStorage._handle_view_instrument_match(...) always evaluates matching Views independently, creating a separate _ViewInstrumentMatch stream for each matching View:
- https://github.com/open-telemetry/opentelemetry-python/blob/66ec88357e964dfda9b225975afc0d87ae4e95bb/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/metric_reader_storage.py#L233-L258
- https://github.com/open-telemetry/opentelemetry-python/blob/66ec88357e964dfda9b225975afc0d87ae4e95bb/opentelemetry-sdk/src/opentelemetry/sdk/metrics/_internal/__init__.py#L433-L455
Proposal
Implement experimental support for view_matching_mode ("independent" default, "composable" opt-in) in opentelemetry-sdk:
- Accept an experimental keyword-only
_view_matching_modeparameter onMeterProvider.__init__(...)(following_meter_configuratorinmetrics/_internal/__init__.py#L440-L441) and thread it intoSdkConfiguration/MetricReaderStorage, handling unsupported values persdk.md#L179-L182(either raisingValueErrorduring initialization or warning and falling back to"independent"). - When
composablemode is configured:- Form a stream group for each distinct configured
Viewnamecontaining matchingViews with thatnameplus all matchingViews withname=None(or a single default-named group if no matchingViewsetsname). - Apply atomic last-wins precedence in registration order across explicitly specified non-
attribute_keysViewsettings (name,description,aggregation,exemplar_reservoir_factory,aggregation_cardinality_limit, andenabledfrom https://github.com/open-telemetry/opentelemetry-python/pull/5847 — distinguishing omittedNonearguments foraggregationandexemplar_reservoir_factoryinview.py#L165-L166from explicit defaults such asDefaultAggregation()), falling back per-aspect to the preceding validViewin the group (or default) with a warning on semantic errors rather than discarding the entireView. - Combine specified
attribute_keysfilters via logical AND (set intersection across non-Noneallow-lists onmain; exclude-lists tracked in https://github.com/open-telemetry/opentelemetry-python/issues/5446), and override instrument advisory parameters only for aspects configured by matchingViews in the group (falling back to instrument advisory parameters otherwise).
- Form a stream group for each distinct configured
Additional Context
- Specification PR: https://github.com/open-telemetry/opentelemetry-specification/pull/5173 (open clarification PR: https://github.com/open-telemetry/opentelemetry-specification/pull/5414)
- Specification stabilization tracking issue: https://github.com/open-telemetry/opentelemetry-specification/issues/5385
- Declarative configuration schema PR: https://github.com/open-telemetry/opentelemetry-configuration/pull/666 (can be wired in
opentelemetry-configuration_meter_provider.py#L622-L667once schema models are regenerated for v1.2.0) - Reference Go prototype: https://github.com/open-telemetry/opentelemetry-go/pull/8510
- Related Python PR (
_opt_in_advisoryandViewenabledparameter): https://github.com/open-telemetry/opentelemetry-python/pull/5847
- Lenguaje dominante
- Python
- Estrellas
- 2.7k
- Forks
- 1.1k
- Merge medio
- 3 d 12 h
- PR fusionados (30 d)
- 16
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de open-telemetry/opentelemetry-python
-
References to Archived open-telemetry/otepsPosiblemente ocupada @RjyavardhanSingh la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
open-telemetry/opentelemetry-python#5984 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Autoconfiguration rejects OTEL_EXPORTER_OTLP_PROTOCOL=http/jsonPosiblemente ocupada @WendeelMarinho la tomó hace 2 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
open-telemetry/opentelemetry-python#5981 ·
Los mantenedores suelen responder en 2 días
-
MeterProvider raises ValueError on empty or uppercase OTEL_METRICS_EXEMPLAR_FILTERPosiblemente ocupada @bishalde la tomó hace 8 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
open-telemetry/opentelemetry-python#5948 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
-
W3CBaggagePropagator drops a list-member over 4096 bytes that W3C Baggage requires it to propagatePosiblemente ocupada @codedbyadiiii la tomó hace 20 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
open-telemetry/opentelemetry-python#5913 ·
Los mantenedores suelen responder en 2 días
-
otel.sdk.processor.{span,log}.queue.capacity uses synchronous UpDownCounter recorded once in __init__Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
open-telemetry/opentelemetry-python#5891 ·
Los mantenedores suelen responder en 2 días
Todos los issues de open-telemetry/opentelemetry-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug improve content
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
opensafely/documentation#2102 ·
Los mantenedores suelen responder en 1 día
-
difficulty:1 documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
MakazhanAlpamys/Soup#3533 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
onyx-dot-app/onyx#18730 ·
Los mantenedores suelen responder en 1 día