Repository navigation
Observability phase 3a: Meter streaming hook - #4
Merged
Merged
Conversation
Add the Meter extension point (instrument-based, OpenTelemetry-shaped: Counter and Histogram) plus the WithMeter option. The engine records the produced / processed / emitted / consumed counters and a process_latency histogram to the meter's instruments on the hot path — opt-in, and alongside Observe. Kept tiny and stdlib-only so the core stays zero-dependency; concrete exporters (Prometheus, OpenTelemetry) will live in separate submodules under x/. Verified with an in-memory fake meter under -race.
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.
Observability phase 3a — the core streaming-metrics hook (candidate for v0.5.0). Additive, backward-compatible, and still zero-dependency.
Adds
Meterextension point (instrument-based, à la OpenTelemetry):WithMeter(m Meter)— the engine recordsproduced/processed/emitted/consumedcounters and aprocess_latencyhistogram on the hot path.Design
Observe's end-of-run snapshot), so it fits long-lived / infinite pipelines. Both can be set in the same run.Meter, the hot path pays nothing. Instrument methods must be concurrency-safe (documented) — validated by an in-memory fake meter under-race.Boundary
Meteris stdlib-only, so the core stays zero-dep. Concrete exporters (Prometheus first, then OpenTelemetry) will land as separate submodules underflow/x/…with their owngo.mod— phase 3b.The observability API stays marked experimental while v0.x.