You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/10/18 07:45:52 UTC

[GitHub] [inlong] Keylchen commented on a diff in pull request #6195: [INLONG-6194][Agent] Support different components to parse their related metric.

Keylchen commented on code in PR #6195:
URL: https://github.com/apache/inlong/pull/6195#discussion_r997839181


##########
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:
   done.



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org