wu-sheng commented on a change in pull request #6091:
URL: https://github.com/apache/skywalking/pull/6091#discussion_r550780771
##########
File path:
oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/MetricServiceGRPCHandler.java
##########
@@ -60,111 +69,65 @@ public MetricServiceGRPCHandler(ModuleManager
moduleManager) {
"envoy_metric_in_latency", "The process latency of service metrics
receiver", MetricsTag.EMPTY_KEY,
MetricsTag.EMPTY_VALUE
);
+
+ final MeterSystem meterSystem =
moduleManager.find(CoreModule.NAME).provider().getService(MeterSystem.class);
+
+ converters = config.rules()
+ .stream()
+ .map(rule -> new PrometheusMetricConverter(rule,
meterSystem))
+ .collect(Collectors.toList());
}
@Override
public StreamObserver<StreamMetricsMessage>
streamMetrics(StreamObserver<StreamMetricsResponse> responseObserver) {
return new StreamObserver<StreamMetricsMessage>() {
private volatile boolean isFirst = true;
- private String serviceName = null;
- private String serviceInstanceName = null;
+ private ServiceMetaInfo service;
@Override
+ @SneakyThrows
public void onNext(StreamMetricsMessage message) {
if (log.isDebugEnabled()) {
log.debug("Received msg {}", message);
}
if (isFirst) {
isFirst = false;
- StreamMetricsMessage.Identifier identifier =
message.getIdentifier();
- Node node = identifier.getNode();
- if (node != null) {
- String nodeId = node.getId();
- if (!StringUtil.isEmpty(nodeId)) {
- serviceInstanceName = nodeId;
- }
- String cluster = node.getCluster();
- if (!StringUtil.isEmpty(cluster)) {
- serviceName = cluster;
- if (serviceInstanceName == null) {
- serviceInstanceName = serviceName;
- }
- }
- }
-
- if (serviceName == null) {
- serviceName = serviceInstanceName;
- }
+ service = new
ServiceMetaInfoAdapter(message.getIdentifier().getNode().getMetadata());
Review comment:
`ServiceMetaInfoAdapter` is for meta exchange only, right? Where is the
ip-mapping mechanism?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]