Skip to content

fix(metrics): aggregate partition gauges - #377

Merged
thomhurst merged 2 commits into
mainfrom
issue-348-partition-gauges
Aug 27, 2026
Merged

fix(metrics): aggregate partition gauges#377
thomhurst merged 2 commits into
mainfrom
issue-348-partition-gauges

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Summary

  • aggregate concurrency and rate-limit gauge values that share a shield name and strategy index
  • add kevlar.circuit_breaker.instances, grouped by bounded circuit state, for partition-safe breaker totals
  • retain the per-instance numeric circuit-state compatibility gauge and document when to use each instrument

Motivation

Partitions intentionally omit their keys from metric tags, so stateful strategies in a PartitionedShield previously emitted colliding series. Exporters could keep an arbitrary last value. Aggregation now produces one low-cardinality series per identity, with breaker counts split by state.

Fixes #348

Validation

  • dotnet build Kevlar.slnx -c Release (0 warnings, 0 errors)
  • dotnet run --project tests/Kevlar.Tests -c Release -f net8.0 --no-build -- --timeout 5m (1227 passed)
  • dotnet run --project tests/Kevlar.Tests -c Release -f net10.0 --no-build -- --timeout 5m (1260 passed)
  • net10 coverage-mode unit suite (1260 passed; new aggregation iterators fully covered)
  • pwsh scripts/Verify-ApiDocs.ps1
  • pwsh scripts/Verify-Docs.ps1
  • pwsh scripts/Build-ApiDocs.ps1 -SkipBuild (0 warnings, 0 errors)
  • npm run build from docs/

Docs changes are text/table-only. In-app browser backend was unavailable for a screenshot; the Docusaurus production build passed.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d805080-3ad7-40f6-ab21-42264ec8044b


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thomhurst
thomhurst force-pushed the issue-348-partition-gauges branch from af59c7d to c3f0dac Compare August 27, 2026 03:24
@thomhurst
thomhurst force-pushed the issue-348-partition-gauges branch from c3f0dac to becceb8 Compare August 27, 2026 03:51
@thomhurst
thomhurst merged commit 21e689f into main Aug 27, 2026
10 checks passed
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.

metrics: state gauges collide across partitions of a PartitionedShield

1 participant