kezhenxu94 commented on a change in pull request #7032:
URL: https://github.com/apache/skywalking/pull/7032#discussion_r643569952



##########
File path: 
oap-server/server-fetcher-plugin/kafka-fetcher-plugin/src/main/java/org/apache/skywalking/oap/server/analyzer/agent/kafka/provider/handler/JVMMetricsHandler.java
##########
@@ -37,12 +42,30 @@
     private final NamingControl namingLengthControl;
     private final JVMSourceDispatcher jvmSourceDispatcher;
 
-    public JVMMetricsHandler(ModuleManager moduleManager, KafkaFetcherConfig 
config) {
-        super(moduleManager, config);
-        this.jvmSourceDispatcher = new JVMSourceDispatcher(moduleManager);
-        this.namingLengthControl = moduleManager.find(CoreModule.NAME)
+    private final HistogramMetrics histogram;
+    private final CounterMetrics errorCounter;
+
+    public JVMMetricsHandler(ModuleManager manager, KafkaFetcherConfig config) 
{
+        super(manager, config);
+        this.jvmSourceDispatcher = new JVMSourceDispatcher(manager);
+        this.namingLengthControl = manager.find(CoreModule.NAME)
                                                 .provider()
                                                 
.getService(NamingControl.class);
+        MetricsCreator metricsCreator = manager.find(TelemetryModule.NAME)
+                                               .provider()
+                                               
.getService(MetricsCreator.class);
+        histogram = metricsCreator.createHistogramMetric(
+            "meter_in_latency",
+            "The process latency of meter",
+            new MetricsTag.Keys("protocol"),
+            new MetricsTag.Values("kafka-fetcher")
+        );
+        errorCounter = metricsCreator.createCounter(
+            "meter_analysis_error_count",
+            "The error number of meter analysis",
+            new MetricsTag.Keys("protocol"),
+            new MetricsTag.Values("kafka-fetcher")

Review comment:
       Suggest using `kafka` as `protocol` tag value, instead of `kafka-fetcher`




-- 
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.

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


Reply via email to