You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/12/28 07:42:56 UTC

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #6091: Enhance Envoy metrics service analyzer by MAL

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



##########
File path: docs/en/setup/envoy/examples/metrics/docker-compose.yaml
##########
@@ -17,7 +17,7 @@
 version: "3"
 services:
   envoy:
-    image: envoyproxy/envoy-alpine:latest
+    image: envoyproxy/envoy-alpine:v1.16.2

Review comment:
       Envoy now doesn't have a latest tag, and pinning the image version is a good practice IMO.

##########
File path: oap-server/server-bootstrap/src/main/resources/otel-oc-rules/istio-controlplane.yaml
##########
@@ -28,7 +28,7 @@
 #    "-P6H3M"    -- parses as "-6 hours and -3 minutes"
 #    "-P-6H+3M"  -- parses as "+6 hours and -3 minutes"
 # </pre>
-expSuffix: tag({tags -> tags.cluster = 'istio-ctrl::' + tags.cluster}).service(['cluster', 'app'])

Review comment:
       Does this make sense @hanahmily ? Seems both control plane and data plane all share the same "serviceGroup" in "oap-server/server-bootstrap/src/main/resources/ui-initialized-templates/istio.yml"

##########
File path: oap-server/analyzer/meter-analyzer/src/main/java/org/apache/skywalking/oap/meter/analyzer/prometheus/PrometheusMetricConverter.java
##########
@@ -141,6 +141,11 @@ public void toMeter(Stream<Metric> metricStream) {
         if (ss.length < 1) {
             return Optional.empty();
         }
-        return Optional.of(Tuple.of(metric.getName(), SampleFamilyBuilder.newBuilder(ss).build()));
+        return Optional.of(Tuple.of(escapedName(metric.getName()), SampleFamilyBuilder.newBuilder(ss).build()));
+    }
+
+    // Returns the escaped name of the given one, with "." replaced by "_"
+    protected String escapedName(final String name) {
+        return name.replaceAll("\\.", "_");
     }

Review comment:
       Metrics names in Envoy contain `.`, hence this is necessary




----------------------------------------------------------------
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:
users@infra.apache.org