yswdqz commented on code in PR #12152:
URL: https://github.com/apache/skywalking/pull/12152#discussion_r1576042474


##########
oap-server/server-receiver-plugin/otel-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/otel/otlp/OpenTelemetryMetricRequestProcessor.java:
##########
@@ -334,4 +339,59 @@ private Stream<? extends Metric> adaptMetrics(
         }
         throw new UnsupportedOperationException("Unsupported type");
     }
+
+    public static String anyValueToString(AnyValue value) {
+        if (value.hasStringValue()) {
+            return value.getStringValue();
+        } else if (value.hasBoolValue()) {
+            return Boolean.toString(value.getBoolValue());
+        } else if (value.hasIntValue()) {
+            return Long.toString(value.getIntValue());
+        } else if (value.hasDoubleValue()) {
+            return Double.toString(value.getDoubleValue());
+        } else if (value.hasArrayValue()) {
+            return arrayValueToString(value.getArrayValue());
+        } else if (value.hasKvlistValue()) {
+            return keyValueListToString(value.getKvlistValue());
+        } else if (value.hasBytesValue()) {
+            return 
Base64.getEncoder().encodeToString(value.getBytesValue().toByteArray());

Review Comment:
   It doesn't feel like a particularly appropriate way to handle this, but I'm 
not sure what to do about it (bytes value).



-- 
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: notifications-unsubscr...@skywalking.apache.org

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

Reply via email to