Oneal65 commented on code in PR #6195:
URL: https://github.com/apache/inlong/pull/6195#discussion_r997822106
##########
inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/metrics/AgentPrometheusMetricListener.java:
##########
@@ -142,12 +143,18 @@ public List<MetricFamilySamples> collect() {
mfs.add(totalCounter);
// id dimension
- List<String> dimensionIdKeys = new ArrayList<>();
- dimensionIdKeys.add(DEFAULT_DIMENSION_LABEL);
- dimensionIdKeys.addAll(this.dimensionKeys);
- CounterMetricFamily idCounter = new CounterMetricFamily("id",
"metrics_of_agent_dimensions", dimensionIdKeys);
for (Entry<String, MetricItemValue> entry :
this.dimensionMetricValueMap.entrySet()) {
MetricItemValue itemValue = entry.getValue();
+ Map<String, String> dimensionMap = itemValue.getDimensions();
+ String pluginId = dimensionMap.getOrDefault(KEY_PLUGIN_ID, "-");
+ String componentName =
dimensionMap.getOrDefault(KEY_COMPONENT_NAME, "-");
Review Comment:
can be abstracted into a constant
--
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]