Skip to content

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

Open
morgan-wowk wants to merge 1 commit intosignal-specific-exportersfrom
setup-metric-provider
Open

feat: Setup metric provider for manual and auto-instrumented measurements#126
morgan-wowk wants to merge 1 commit intosignal-specific-exportersfrom
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

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@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
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.

2 participants