jsonnet: add Prometheus-trigger autoscaling option for metrics-generator - #7362
Merged
mapno merged 7 commits intoJun 4, 2026
Merged
Conversation
mapno
force-pushed
the
generator-autoscaling-prometheus-trigger
branch
2 times, most recently
from
June 3, 2026 10:34
c257933 to
8a85e25
Compare
mapno
marked this pull request as ready for review
June 3, 2026 10:54
mapno
requested review from
carles-grafana,
electron0zero,
ie-pham,
javiermolinar,
mattdurham,
mdisibio,
oleg-kozlyuk-grafana,
ruslan-mikhailov,
stoewer,
yvrhdn,
zalegrala and
zhxiaogg
as code owners
June 3, 2026 10:54
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an optional Prometheus-based KEDA autoscaling mode for the Tempo metrics-generator Jsonnet manifests, allowing replica count to be driven by a PromQL query (instead of the existing CPU trigger) when configured.
Changes:
- Extend
metrics_generator.kedaconfig with aqueryfield; when set, generate a KEDA Prometheus trigger (metricTypeValue, threshold1) instead of the CPU trigger. - Update the
make chlog-newtarget to default the changelog entry filename to the current git branch. - Refresh the compiled Jsonnet lockfile and add a
.chloggen/entry documenting the enhancement.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| operations/jsonnet/microservices/autoscaling.libsonnet | Adds the Prometheus-trigger option for metrics-generator KEDA autoscaling and documents the new config field. |
| operations/jsonnet-compiled/jsonnetfile.lock.json | Updates Jsonnet dependency lock versions as part of regeneration. |
| Makefile | Adjusts chlog-new to generate branch-named changelog entries by default. |
| .chloggen/generator-autoscaling-prometheus-trigger.yaml | Adds a changelog entry for the new autoscaling option. |
mattdurham
previously approved these changes
Jun 4, 2026
Adds metrics_generator.keda.query so the metrics-generator can scale on a Prometheus query instead of CPU. When set, a KEDA Prometheus trigger is used with metricType Value and threshold 1 (the query must return the exact desired pod count); when empty it falls back to the existing CPU trigger. The motivating use case is clamping CPU-derived demand to the live-store partition count so generators never exceed the number of partitions.
mapno
force-pushed
the
generator-autoscaling-prometheus-trigger
branch
from
June 4, 2026 13:23
ae3108b to
1462d66
Compare
mapno
enabled auto-merge (squash)
June 4, 2026 13:24
mattdurham
approved these changes
Jun 4, 2026
This was referenced Jun 8, 2026
Closed
1 task
18 tasks
knylander-grafana
added a commit
that referenced
this pull request
Jun 30, 2026
…autoscaling (#7485) * docs: document compare() topN limit and metrics-generator Prometheus autoscaling - functions.md: note the compare() second parameter must be an integer between 1 and 1000 (#7467) - tanka.md: document the optional metrics-generator KEDA Prometheus query trigger alongside the existing CPU trigger (#7362) * Correct passive voice to active in KEDA section
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.
What this PR does:
Adds an optional Prometheus-based KEDA trigger for the metrics-generator autoscaler, alongside the existing CPU trigger.
metrics_generator.keda.query == '': existing CPU trigger (target_cpu, unchanged behavior).metrics_generator.keda.query != '': KEDA Prometheus trigger via the sharedprometheusTriggerhelper, usingmetricType: Valuewiththreshold: 1— the query must return the exact desired pod count.Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]