提交 1fa30919 编写于 作者: G Gao Hongtao 提交者: wu-sheng

Istio/namespace (#1994)

* Update submodule skywalking-ui

* Fix #1925 Add namespace to service name
上级 dc393b1c
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
package org.apache.skywalking.oap.server.receiver.istio.telemetry.provider; package org.apache.skywalking.oap.server.receiver.istio.telemetry.provider;
import com.google.common.base.Joiner;
import com.google.protobuf.Timestamp; import com.google.protobuf.Timestamp;
import io.grpc.stub.StreamObserver; import io.grpc.stub.StreamObserver;
import io.istio.HandleMetricServiceGrpc; import io.istio.HandleMetricServiceGrpc;
...@@ -43,6 +44,8 @@ public class IstioTelemetryGRPCHandler extends HandleMetricServiceGrpc.HandleMet ...@@ -43,6 +44,8 @@ public class IstioTelemetryGRPCHandler extends HandleMetricServiceGrpc.HandleMet
private static final Logger logger = LoggerFactory.getLogger(IstioTelemetryGRPCHandler.class); private static final Logger logger = LoggerFactory.getLogger(IstioTelemetryGRPCHandler.class);
private static final Joiner JOINER = Joiner.on(".");
@Override public void handleMetric(IstioMetricProto.HandleMetricRequest request, @Override public void handleMetric(IstioMetricProto.HandleMetricRequest request,
StreamObserver<ReportProto.ReportResult> responseObserver) { StreamObserver<ReportProto.ReportResult> responseObserver) {
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
...@@ -79,8 +82,8 @@ public class IstioTelemetryGRPCHandler extends HandleMetricServiceGrpc.HandleMet ...@@ -79,8 +82,8 @@ public class IstioTelemetryGRPCHandler extends HandleMetricServiceGrpc.HandleMet
detectPoint = DetectPoint.server; detectPoint = DetectPoint.server;
} }
ServiceMeshMetric metric = ServiceMeshMetric.newBuilder().setStartTime(requestTime.toEpochMilli()) ServiceMeshMetric metric = ServiceMeshMetric.newBuilder().setStartTime(requestTime.toEpochMilli())
.setEndTime(responseTime.toEpochMilli()).setSourceServiceName(string(i, "sourceService")) .setEndTime(responseTime.toEpochMilli()).setSourceServiceName(JOINER.join(string(i, "sourceService"), string(i, "sourceNamespace")))
.setSourceServiceInstance(string(i, "sourceUID")).setDestServiceName(string(i, "destinationService")) .setSourceServiceInstance(string(i, "sourceUID")).setDestServiceName(JOINER.join(string(i, "destinationService"), string(i, "destinationNamespace")))
.setDestServiceInstance(string(i, "destinationUID")).setEndpoint(endpoint).setLatency(latency) .setDestServiceInstance(string(i, "destinationUID")).setEndpoint(endpoint).setLatency(latency)
.setResponseCode(Math.toIntExact(responseCode)).setStatus(status).setProtocol(netProtocol).setDetectPoint(detectPoint).build(); .setResponseCode(Math.toIntExact(responseCode)).setStatus(status).setProtocol(netProtocol).setDetectPoint(detectPoint).build();
logger.debug("Transformed metric {}", metric); logger.debug("Transformed metric {}", metric);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册