1996fanrui commented on code in PR #27604:
URL: https://github.com/apache/flink/pull/27604#discussion_r2816853597


##########
flink-metrics/flink-metrics-otel/src/main/java/org/apache/flink/metrics/otel/OpenTelemetryReporterOptions.java:
##########
@@ -107,4 +117,18 @@ public static void tryConfigureEndpoint(MetricConfig 
metricConfig, Consumer<Stri
                 metricConfig.containsKey(endpointConfKey), "Must set " + 
EXPORTER_ENDPOINT.key());
         builder.accept(metricConfig.getProperty(endpointConfKey));
     }
+
+    @Internal
+    public static void tryConfigureCompression(
+            MetricConfig metricConfig, Consumer<String> builder) {
+        final String compressionConfKey = EXPORTER_COMPRESSION.key();
+        if (metricConfig.containsKey(compressionConfKey)) {
+            String compression = metricConfig.getProperty(compressionConfKey);
+            checkArgument(
+                    "none".equals(compression) || "gzip".equals(compression),

Review Comment:
   There are some magic numbers, "none" and "gzip".
   
   Does it make sense to extract fields?



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