Skip to content

Add OpenTelemetry backend, exemplars, and integration tests#5

Merged
gmbyapa merged 4 commits intomasterfrom
otel-metrics-support
Mar 8, 2026
Merged

Add OpenTelemetry backend, exemplars, and integration tests#5
gmbyapa merged 4 commits intomasterfrom
otel-metrics-support

Conversation

@gmbyapa
Copy link
Contributor

@gmbyapa gmbyapa commented Mar 8, 2026

Breaking Changes

  • Counter.Count, Gauge.Count, Gauge.Set, and Observer.Observe now accept variadic ...RecordOption parameter. Existing callers are unaffected, but custom interface implementations must update their signatures.

What's Changed

  • Add OTELReporter backend with support for counters, gauges, gauge functions, and histograms backed by OpenTelemetry SDK
  • Add WithContext(ctx) RecordOption to propagate trace context as exemplars on metric recordings
  • Add functional options pattern for OTELReporter (WithMeterProvider)
  • Add exponential histogram support via AggregationBase2ExponentialHistogram
  • Add integration tests with Testcontainers verifying three ingestion paths: OTLP direct push, OpenMetrics scrape, and PrometheusProto scrape
  • Verify native histograms + exemplars work end-to-end through PrometheusProto scrape protocol
  • Add doc comments to all interfaces, structs, and fields in reporter.go
  • Add GitHub Actions CI workflow (build, vet, integration tests)
  • Update README with usage docs, exemplar guide, and native histogram
    • exemplar setup instructions

gayanyapa added 4 commits March 8, 2026 22:31
### Breaking Changes
 - Counter.Count, Gauge.Count, Gauge.Set, and Observer.Observe now accept variadic ...RecordOption parameter. Existing callers are unaffected, but custom interface implementations must update their signatures.

## What's Changed
  * Add OTELReporter backend with support for counters, gauges, gauge
    functions, and histograms backed by OpenTelemetry SDK
  * Add WithContext(ctx) RecordOption to propagate trace context as
    exemplars on metric recordings
  * Add functional options pattern for OTELReporter (WithMeterProvider)
  * Add exponential histogram support via AggregationBase2ExponentialHistogram
  * Add integration tests with Testcontainers verifying three ingestion
    paths: OTLP direct push, OpenMetrics scrape, and PrometheusProto scrape
  * Verify native histograms + exemplars work end-to-end through
    PrometheusProto scrape protocol
  * Add doc comments to all interfaces, structs, and fields in reporter.go
  * Add GitHub Actions CI workflow (build, vet, integration tests)
  * Update README with usage docs, exemplar guide, and native histogram
    + exemplar setup instructions
@gmbyapa gmbyapa merged commit cd15697 into master Mar 8, 2026
2 checks passed
@gmbyapa gmbyapa deleted the otel-metrics-support branch March 8, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant