Skip to content

feat(o11y): per-instance metrics via injectable MeterProvider, drop package globals (PIPE-1066) - #285

Open
Dylan-M wants to merge 1 commit into
dylanmyers/pipe-1066-spine-foundationfrom
dylanmyers/pipe-1066-per-instance-metrics
Open

feat(o11y): per-instance metrics via injectable MeterProvider, drop package globals (PIPE-1066)#285
Dylan-M wants to merge 1 commit into
dylanmyers/pipe-1066-spine-foundationfrom
dylanmyers/pipe-1066-per-instance-metrics

Conversation

@Dylan-M

@Dylan-M Dylan-M commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Proposed Change

Reworks the weaver-generated metrics: each generator and output now builds its own
instruments from an injected MeterProvider instead of package-global singletons. Every
generator and output constructor takes a TelemetrySettings and calls NewMetrics on
the 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

  • Run a generator into an output:
    go run ./cmd/blitz --generator-type apache-common --generator-apache-common-rate 1s --output-type stdout --metrics-port 9100
  • In another shell, confirm the generator and output series are present and climbing:
    curl -s localhost:9100/metrics | grep -E 'blitz_generator_|blitz_output_'.
  • go test ./generator/... ./output/... covers per-instance metric construction and the
    failing-provider path.
Checklist
  • Changes are tested
  • CI has passed

@Dylan-M
Dylan-M requested review from a team as code owners August 6, 2026 15:50
…ackage globals (PIPE-1066)

Assisted-by: Claude Opus 4.8
@Dylan-M
Dylan-M force-pushed the dylanmyers/pipe-1066-per-instance-metrics branch from 9aee681 to bad99f9 Compare August 14, 2026 19:22
@Dylan-M
Dylan-M force-pushed the dylanmyers/pipe-1066-spine-foundation branch from d27466e to 36f0408 Compare August 14, 2026 19:22
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