metrics: add experimental view_matching_mode (composable metric views) support
Mantenedores costumam responder em até 2 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 30/100
- Tipo de issue
- Funcionalidade
- Clareza
- Claramente especificada
- Status de atividade
- Ativa
- Stack de tecnologia
- python
- Domínio
- observability
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- Python
- Estrelas
- 2.7k
- Forks
- 1.1k
- Merge médio
- 3d 12h
- PRs com merge (30d)
- 16
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de open-telemetry/opentelemetry-python
-
References to Archived open-telemetry/otepsTalvez já em andamento @RjyavardhanSingh assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
open-telemetry/opentelemetry-python#5984 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Autoconfiguration rejects OTEL_EXPORTER_OTLP_PROTOCOL=http/jsonTalvez já em andamento @WendeelMarinho assumiu há 2 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
open-telemetry/opentelemetry-python#5981 ·
Mantenedores costumam responder em até 2 dias
-
MeterProvider raises ValueError on empty or uppercase OTEL_METRICS_EXEMPLAR_FILTERTalvez já em andamento @bishalde assumiu há 8 dias. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
open-telemetry/opentelemetry-python#5948 · 3 comentários ·
Mantenedores costumam responder em até 2 dias
-
W3CBaggagePropagator drops a list-member over 4096 bytes that W3C Baggage requires it to propagateTalvez já em andamento @codedbyadiiii assumiu há 20 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
open-telemetry/opentelemetry-python#5913 ·
Mantenedores costumam responder em até 2 dias
-
otel.sdk.processor.{span,log}.queue.capacity uses synchronous UpDownCounter recorded once in __init__Talvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
open-telemetry/opentelemetry-python#5891 ·
Mantenedores costumam responder em até 2 dias
Todas as issues de open-telemetry/opentelemetry-python
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
raman325/lock_code_manager#1864 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
521xueweihan/HelloGitHub#4636 ·
-
bug improve content
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
opensafely/documentation#2102 ·
Mantenedores costumam responder em até 1 dia