Admaing opened a new pull request, #1226:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1226
## What is the purpose of the change
The autoscaler exposes a `Current` / `Average` gauge per job vertex for
every scaling metric, keyed by the hex `jobVertexID`. The id is not human
readable, and metric backends that refuse high cardinality identifiers drop it,
which makes the autoscaler metrics hard to read and to filter.
This change carries the job vertex name reported by the JobManager through
`VertexInfo` and adds it as a `jobVertexName` scope to the registered scaling
metrics:
```
AutoScaler.jobVertexID.<jobVertexID>.jobVertexName.<vertexName>.<ScalingMetric>.Current
```
The names are taken from the `JobDetailsInfo` that `ScalingMetricCollector`
already fetches on every cycle, so no additional REST call is introduced.
Vertices for which no name is reported keep exactly the previous metric
identifiers.
## Brief change log
- `VertexInfo` gained an optional `name`, next to the existing vertex
information
- `JobTopology.fromJsonPlan` takes the vertex names and populates them on
the parsed vertices
- `ScalingMetricCollector#getJobTopology` builds the name map from the
already fetched `JobDetailsInfo`
- `AutoscalerFlinkMetrics#registerScalingMetrics` takes the `JobTopology`
instead of the vertex id list and adds the `jobVertexName` scope when a name is
available
- `docs/content/docs/operations/metrics.md` documents the additional scope
(the `content.zh` mirror is kept in sync, as it is identical to the English
page)
## Verifying this change
This change added tests and can be verified as follows:
- `AutoScalerFlinkMetricsTest#testVertexNameAddedToMetricScope` asserts the
registered metric identifiers carry the vertex name; it fails without the
`jobVertexName` group
- `JobTopologyTest#testTopologyFromJson` asserts the names parsed from a
real JSON plan
- `ScalingMetricCollectorTest#testJobTopologyParsingFromJobDetails` asserts
the names flow from `JobDetailsInfo` into the topology
- `mvn clean test -pl
flink-autoscaler,flink-autoscaler-standalone,flink-autoscaler-plugin-jdbc,flink-kubernetes-operator
-am` passes
- `mvn spotless:check checkstyle:check` passes
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changes to the `CustomResourceDescriptors`:
no
- Core observer or reconciler logic that is regularly executed: no (only
the metric registration path is touched, no scaling decision changes)
## Documentation
- Does this pull request introduce a new feature? yes
- If yes, how is the feature documented? docs and JavaDocs
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes (please specify the tool below)
Generated-by: DeepSeek Harness (deepseek-v4.1-flash-1017)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]