Skip to content

feat(ingester): Add active series tracker for pattern-based monitoring#7476

Open
yeya24 wants to merge 1 commit intocortexproject:masterfrom
yeya24:feat/active-series-tracker
Open

feat(ingester): Add active series tracker for pattern-based monitoring#7476
yeya24 wants to merge 1 commit intocortexproject:masterfrom
yeya24:feat/active-series-tracker

Conversation

@yeya24
Copy link
Copy Markdown
Contributor

@yeya24 yeya24 commented May 4, 2026

Add a new active series tracker feature that counts active series by configurable label matchers (including regex) and exposes the counts as Prometheus metrics. This is designed for internal monitoring without enforcing any limits.

Key changes:

  • Add ActiveSeriesTrackersConfig type in validation package with PromQL matcher syntax support
  • Add ActiveSeriesTrackers field to Limits struct for per-tenant config with default fallback
  • Add ActiveForMatchers() method to ActiveSeries for counting matching series across all stripes
  • Add cortex_ingester_active_series_per_tracker gauge metric
  • Integrate into updateActiveSeries() periodic tick
  • Matchers are validated and compiled during config unmarshalling
  • Runtime hot-reloadable via existing runtime config overrides

Configuration example:

  overrides: 
    tenant-123:
      active_series_trackers:
      - name: api_metrics
        matchers: '{__name__=~"api_.*"}'

Metric emitted:

  cortex_ingester_active_series_per_tracker{user="tenant", name="api_metrics"} 42

What this PR does:

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

@dosubot dosubot Bot added component/ingester type/feature type/observability To help know what is going on inside Cortex labels May 4, 2026
@yeya24 yeya24 force-pushed the feat/active-series-tracker branch 2 times, most recently from 89afdcf to 59d445f Compare May 5, 2026 05:10
Add a new active series tracker feature that counts active series by
configurable label matchers (including regex) and exposes the counts as
Prometheus metrics. This is designed for internal monitoring without
enforcing any limits.

Key changes:
- Add ActiveSeriesTrackersConfig type in validation package with PromQL
  matcher syntax support
- Add ActiveSeriesTrackers field to Limits struct for per-tenant config
  with default fallback
- Add ActiveForMatchers() method to ActiveSeries for counting matching
  series across all stripes
- Add cortex_ingester_active_series_per_tracker gauge metric
- Integrate into updateActiveSeries() periodic tick
- Matchers are validated and compiled during config unmarshalling
- Runtime hot-reloadable via existing runtime config overrides

Configuration example:
  overrides:
    tenant-123:
      active_series_trackers:
        - name: api_metrics
          matchers: '{__name__=~"api_.*"}'

Metric emitted:
  cortex_ingester_active_series_per_tracker{user="tenant", name="api_metrics"} 42

Signed-off-by: Ben Ye <benye@amazon.com>
@yeya24 yeya24 force-pushed the feat/active-series-tracker branch from 59d445f to c3dae35 Compare May 5, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant