feat(o11y): per-instance metrics via injectable MeterProvider, drop package globals (PIPE-1066) - #285
Open
Dylan-M wants to merge 1 commit into
Conversation
Contributor
Author
This was referenced Aug 6, 2026
Open
…ackage globals (PIPE-1066) Assisted-by: Claude Opus 4.8
Dylan-M
force-pushed
the
dylanmyers/pipe-1066-per-instance-metrics
branch
from
August 14, 2026 19:22
9aee681 to
bad99f9
Compare
Dylan-M
force-pushed
the
dylanmyers/pipe-1066-spine-foundation
branch
from
August 14, 2026 19:22
d27466e to
36f0408
Compare
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.

Proposed Change
Reworks the weaver-generated metrics: each generator and output now builds its own
instruments from an injected
MeterProviderinstead of package-global singletons. Everygenerator and output constructor takes a
TelemetrySettingsand callsNewMetricsonthe bundle's provider. A nil provider falls back to the process global, preserving
standalone behavior.
Dropping the globals lets multiple blitz instances (embedded in one host) record to
separate providers without cross-talk.
How to validate
go run ./cmd/blitz --generator-type apache-common --generator-apache-common-rate 1s --output-type stdout --metrics-port 9100curl -s localhost:9100/metrics | grep -E 'blitz_generator_|blitz_output_'.go test ./generator/... ./output/...covers per-instance metric construction and thefailing-provider path.
Checklist