peachisai commented on code in PR #13119:
URL: https://github.com/apache/skywalking/pull/13119#discussion_r2005486613


##########
oap-server/server-receiver-plugin/otel-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/otel/otlp/OpenTelemetryMetricRequestProcessor.java:
##########
@@ -121,11 +121,24 @@ public void processMetricsRequest(final 
ExportMetricsServiceRequest requests) {
                                .flatMap(tryIt -> MetricConvert.log(tryIt, 
"Convert OTEL metric to prometheus metric"))
                            )
                 );
-                converters.forEach(convert -> convert.toMeter(sampleFamilies));
+
+                convertSampleFamiliesToMeter(sampleFamilies);
             });
         }
     }
 
+    private void convertSampleFamiliesToMeter(ImmutableMap<String, 
SampleFamily> sampleFamilies) {
+        if (sampleFamilies.isEmpty()) {
+            return;
+        }
+        SampleFamily firstValue = sampleFamilies.values().iterator().next();
+        for (MetricConvert converter : converters) {
+            if (converter.shouldConvert(firstValue)) {

Review Comment:
   > You mean only the first expression will be processed by filter with all 
metrics? If not matched, all following expressions are not executed.
   
   Yes, for all analyzers in one convert ,they are the same filter expression, 
like ```{ tags -> tags.job_name == 'rocketmq-monitoring' }```



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

Reply via email to