Skip to content

feat: Setup metric provider for manual and auto-instrumented measurements#126

Merged
morgan-wowk merged 1 commit intomasterfrom
setup-metric-provider
Mar 5, 2026
Merged

feat: Setup metric provider for manual and auto-instrumented measurements#126
morgan-wowk merged 1 commit intomasterfrom
setup-metric-provider

Conversation

@morgan-wowk
Copy link
Collaborator

@morgan-wowk morgan-wowk commented Feb 25, 2026

TL;DR

Added OpenTelemetry metrics support with configurable aggregation temporality alongside existing tracing functionality.

What changed?

  • Added metrics.py module to configure OpenTelemetry meter provider with OTLP exporters (gRPC and HTTP)
  • Extended configuration system to support metrics exporter endpoints via TANGLE_OTEL_METRIC_EXPORTER_ENDPOINT and TANGLE_OTEL_METRIC_EXPORTER_PROTOCOL environment variables
  • Implemented configurable aggregation temporality for different metric instrument types (counter, histogram, etc.) through environment variables like TANGLE_OTEL_METRICS_TEMPORALITY_COUNTER
  • Added temporality.py module to map string-based temporality configuration to OpenTelemetry SDK types
  • Updated providers.setup() to initialize both tracing and metrics providers when configured
  • Exported setup_metrics function in the package's public API

How to test?

Set the TANGLE_OTEL_METRIC_EXPORTER_ENDPOINT environment variable to your OTLP collector endpoint and call providers.setup(). Optionally configure temporality settings using the TANGLE_OTEL_METRICS_TEMPORALITY_* environment variables. The system will work with metrics-only, tracing-only, or both configurations.

Why make this change?

This enables comprehensive observability by adding metrics collection capabilities to complement the existing distributed tracing functionality, allowing applications to export both traces and metrics to OpenTelemetry collectors with fine-grained control over aggregation behavior.

Copy link
Collaborator Author

morgan-wowk commented Feb 25, 2026

@morgan-wowk morgan-wowk self-assigned this Feb 25, 2026
@morgan-wowk morgan-wowk force-pushed the setup-metric-provider branch from 8d9df4b to 66474d1 Compare February 25, 2026 13:01
@morgan-wowk morgan-wowk force-pushed the signal-specific-exporters branch from 10f32fa to cd03357 Compare February 25, 2026 13:01
@morgan-wowk morgan-wowk marked this pull request as ready for review February 25, 2026 19:54
@morgan-wowk morgan-wowk requested a review from Ark-kun as a code owner February 25, 2026 19:54
@morgan-wowk morgan-wowk force-pushed the signal-specific-exporters branch from cd03357 to a9c66b9 Compare February 26, 2026 00:56
@morgan-wowk morgan-wowk force-pushed the setup-metric-provider branch from 66474d1 to 06ecffc Compare February 26, 2026 00:56
@morgan-wowk morgan-wowk force-pushed the signal-specific-exporters branch from a9c66b9 to 4c46bd2 Compare March 5, 2026 00:24
@morgan-wowk morgan-wowk force-pushed the setup-metric-provider branch from 06ecffc to fdeed83 Compare March 5, 2026 00:24
@morgan-wowk morgan-wowk force-pushed the signal-specific-exporters branch from 4c46bd2 to 6921879 Compare March 5, 2026 00:40
@morgan-wowk morgan-wowk force-pushed the setup-metric-provider branch from fdeed83 to 57bd9cf Compare March 5, 2026 00:40
Copy link
Collaborator Author

morgan-wowk commented Mar 5, 2026

Merge activity

  • Mar 5, 9:25 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 5, 9:27 PM UTC: Graphite couldn't merge this pull request because a downstack PR feat: Set service version on OTel data #124 failed to merge.
  • Mar 5, 9:43 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 5, 9:46 PM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 5, 9:47 PM UTC: @morgan-wowk merged this pull request with Graphite.

@morgan-wowk morgan-wowk changed the base branch from signal-specific-exporters to graphite-base/126 March 5, 2026 21:44
@morgan-wowk morgan-wowk changed the base branch from graphite-base/126 to master March 5, 2026 21:45
@morgan-wowk morgan-wowk force-pushed the setup-metric-provider branch from 57bd9cf to 440ef51 Compare March 5, 2026 21:46
@morgan-wowk morgan-wowk merged commit c118f86 into master Mar 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants