Skip to content

Commit eca67d4

Browse files
authored
Fix otlp log handler reponse error and otlp span convert error (#13468)
1 parent 443157b commit eca67d4

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

docs/en/changes/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
* BanyanDB: fix the `BanyanDBMetricsDAO.multiGet` not work properly in `IndexMode`.
9292
* BanyanDB: remove `@StoreIDAsTag`, and automatically create a virtual String tag `id` for the SeriesID in `IndexMode`.
9393
* Remove method `appendMutant` from StorageID.
94+
* Fix otlp log handler reponse error and otlp span convert error.
9495

9596
#### UI
9697

oap-server/server-receiver-plugin/otel-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/otel/otlp/OpenTelemetryLogHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ public void export(ExportLogsServiceRequest request, StreamObserver<ExportLogsSe
114114
doAnalysisQuietly(service, layer, serviceInstance, logRecord);
115115
}
116116
});
117-
responseObserver.onNext(ExportLogsServiceResponse.getDefaultInstance());
118-
responseObserver.onCompleted();
119117
});
118+
responseObserver.onNext(ExportLogsServiceResponse.getDefaultInstance());
119+
responseObserver.onCompleted();
120120
}
121121

122122
private void doAnalysisQuietly(String service, String layer, String serviceInstance, LogRecord logRecord) {

oap-server/server-receiver-plugin/otel-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/otel/otlp/OpenTelemetryTraceHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ private String convertToString(AnyValue value) {
375375
return String.valueOf(value.getIntValue());
376376
} else if (value.hasKvlistValue()) {
377377
final JsonObject kvObj = convertToString(value.getKvlistValue().getValuesList());
378-
return kvObj.getAsString();
378+
return kvObj.toString();
379379
} else if (value.hasBytesValue()) {
380380
return new String(Base64.getEncoder().encode(value.getBytesValue().toByteArray()), StandardCharsets.UTF_8);
381381
}

oap-server/server-receiver-plugin/zipkin-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/zipkin/trace/SpanForward.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void send(List<Span> spanList) {
7979
zipkinSpan.setSpanId(span.id());
8080
zipkinSpan.setParentId(span.parentId());
8181
zipkinSpan.setName(getNamingControl().formatEndpointName(serviceName, span.name()));
82-
zipkinSpan.setDuration(span.duration());
82+
zipkinSpan.setDuration(span.duration() == null ? 0 : span.duration());
8383
if (span.kind() != null) {
8484
zipkinSpan.setKind(span.kind().name());
8585
}

0 commit comments

Comments
 (0)