You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "yunfengzhou-hub (via GitHub)" <gi...@apache.org> on 2026/06/04 09:25:38 UTC
[PR] [metric] Add key-value metric group for model and action dimensions [flink-agents]
yunfengzhou-hub opened a new pull request, #760:
URL: https://github.com/apache/flink-agents/pull/760
<!-- Please link the PR to the relevant issue(s). Hotfix doesn't need this. -->
Linked issue: #744
### Purpose of change
Use key-value metric groups for `action` and `model` dimensions instead of plain named sub-groups. This makes these dimensions available as labels in reporters that support them (e.g., Prometheus), and produces more structured metric identifiers:
- Action metrics: `<action_name>.numOfActionsExecuted` → `action.<action_name>.numOfActionsExecuted`
- Token metrics: `<action_name>.<model_name>.promptTokens` → `action.<action_name>.model.<model_name>.promptTokens`
### Tests
- Unit tests (value-based and mock-based) verify the key-value group hierarchy and counter accumulation.
- An end-to-end integration test using `InMemoryReporter` + `MiniClusterExtension` validates the complete metric identifier through the real Flink metric system.
### API
- **Breaking**: The metric identifiers for `promptTokens`, `completionTokens`, and per-action execution counters now include the key prefix (`action.`, `model.`). Metric reporter queries or dashboards referencing the old names need updating.
- A new `getSubGroup(String key, String value)` method is added to the `FlinkAgentsMetricGroup` interface (Java) and `get_sub_group(name, value)` (Python).
- `getSubGroup(String name)` now rejects names containing `=` to prevent cache-key collisions with the key-value variant.
### Documentation
<!-- Do not remove this section. Check the proper box only. -->
- [ ] `doc-needed` <!-- Your PR changes impact docs -->
- [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [x] `doc-included` <!-- Your PR already contains the necessary documentation updates -->
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [metric] Add key-value metric group for model and action dimensions [flink-agents]
Posted by "joeyutong (via GitHub)" <gi...@apache.org>.
joeyutong commented on PR #760:
URL: https://github.com/apache/flink-agents/pull/760#issuecomment-4622668578
LGTM once style check is fixed.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [metric] Add key-value metric group for model and action dimensions [flink-agents]
Posted by "yunfengzhou-hub (via GitHub)" <gi...@apache.org>.
yunfengzhou-hub merged PR #760:
URL: https://github.com/apache/flink-agents/pull/760
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org