wu-sheng commented on code in PR #13772:
URL: https://github.com/apache/skywalking/pull/13772#discussion_r3014153012
##########
oap-server/server-receiver-plugin/otel-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/otel/otlp/OpenTelemetryLogHandler.java:
##########
@@ -104,7 +104,13 @@ public void export(ExportLogsServiceRequest request,
StreamObserver<ExportLogsSe
return;
}
final var layer = attributes.getOrDefault("service.layer", "");
- final var serviceInstance =
attributes.getOrDefault("service.instance", "");
+ // service.instance.id is the OTel standard resource attribute for
instance identity
+ // https://opentelemetry.io/docs/specs/semconv/resource/#service
+ // Fall back to service.instance for backward compatibility
+ final var instanceId =
attributes.getOrDefault("service.instance.id", "");
+ final var serviceInstance = instanceId.isEmpty()
+ ? attributes.getOrDefault("service.instance", "")
+ : instanceId;
Review Comment:
@kezhenxu94 I searched for otlp standard, `.id` seems the official one. I am
not sure why this was `.instance` only.
--
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]