Repository navigation
Add OpenTelemetry exporter as a separate module (x/otel) - #7
Merged
Merged
Conversation
Mirrors x/prometheus: a flow.Meter backed by an OTel metric.Meter, in its own module so the core stays zero-dependency. Counters map to flow.<name> (Int64), process_latency to a Float64 histogram in seconds with buckets cloned from Prometheus DefBuckets for comparable output. Instruments are memoized so a Meter can be reused across runs. README gains the OTel exporter example; roadmap marks both exporters done.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replicates the
x/prometheuspattern for OpenTelemetry: aflow.Meterbacked by an OTelmetric.Meter, in its own module so the flow core stays zero-dependency — only importers ofx/otelpull in OpenTelemetry.What's here
x/otel/otel.go—NewMeter(metric.Meter) flow.Meter. Counters →flow.<name>(Int64), theprocess_latencyhistogram →flow.process_latency(Float64, seconds). Instruments are memoized so a Meter can be reused across runs. Histogram buckets are cloned from PrometheusDefBucketsso both exporters report comparable distributions. A failed instrument panics (misconfiguration, not a runtime condition — same stance as promauto).x/otel/otel_test.go— two tests against the SDKManualReader: per-metric counts (5/5/10/10 + 5 latency samples, matching the Prometheus test) and Meter reuse across 3 runs. Green under-race.x/otel/go.mod/go.sum— pinned to OTelv1.32.0; depends only onotel/metric(API) +otel/sdk/metric(tests).README.md— OTel exporter example alongside Prometheus; roadmap marks both exporters done.Verification
go vet+go build+go test -raceon core and over thex/*/submodule loop — allok. CI already iteratesx/*/, so it picks upx/otelautomatically.🤖 Generated with Claude Code
https://claude.ai/code/session_01LGsdwoFd3a7bejBXLr6saG