You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2021/01/27 03:36:02 UTC
[skywalking] branch chore/cleanup-duplicate updated (ddcc3f5 ->
6e7150e)
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a change to branch chore/cleanup-duplicate
in repository https://gitbox.apache.org/repos/asf/skywalking.git.
discard ddcc3f5 Remove optional log plugin (#6259)
add 7b1c63d Remove optional log plugin (#6259)
new 6e7150e Remove duplicate codes in Envoy ALS handler
This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version. This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:
* -- * -- B -- O -- O -- O (ddcc3f5)
\
N -- N -- N refs/heads/chore/cleanup-duplicate (6e7150e)
You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.
Any revisions marked "omit" are not gone; other references still
refer to them. Any revisions marked "discard" are gone forever.
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
CHANGES.md | 4 ++--
.../receiver/envoy/MetricServiceGRPCHandler.java | 22 ----------------------
2 files changed, 2 insertions(+), 24 deletions(-)
[skywalking] 01/01: Remove duplicate codes in Envoy ALS handler
Posted by ke...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch chore/cleanup-duplicate
in repository https://gitbox.apache.org/repos/asf/skywalking.git
commit 6e7150eb6e5c2ca717e3222a601bbc7f30d18306
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Wed Jan 27 11:35:10 2021 +0800
Remove duplicate codes in Envoy ALS handler
---
CHANGES.md | 1 +
.../receiver/envoy/MetricServiceGRPCHandler.java | 22 ----------------------
2 files changed, 1 insertion(+), 22 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index c8500ec..b1e4077 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -11,6 +11,7 @@ Release Notes.
* Add ElasticSearch 7.10 to test matrix and verify it works.
* Replace Apache RAT with skywalking-eyes to check license headers.
* Set up test of Envoy ALS / MetricsService under Istio 1.8.2 to verify Envoy V3 protocol
+* Chore: Remove duplicate codes in Envoy ALS handler
#### Java Agent
* The operation name of quartz-scheduler plugin, has been changed as the `quartz-scheduler/${className}` format.
diff --git a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/MetricServiceGRPCHandler.java b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/MetricServiceGRPCHandler.java
index 2538a34..38e4370 100644
--- a/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/MetricServiceGRPCHandler.java
+++ b/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/MetricServiceGRPCHandler.java
@@ -31,12 +31,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.skywalking.apm.util.StringUtil;
import org.apache.skywalking.oap.meter.analyzer.prometheus.PrometheusMetricConverter;
import org.apache.skywalking.oap.server.core.CoreModule;
-import org.apache.skywalking.oap.server.core.analysis.IDManager;
-import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
import org.apache.skywalking.oap.server.core.analysis.meter.MeterSystem;
-import org.apache.skywalking.oap.server.core.analysis.NodeType;
-import org.apache.skywalking.oap.server.core.source.ServiceInstanceUpdate;
-import org.apache.skywalking.oap.server.core.source.SourceReceiver;
import org.apache.skywalking.oap.server.library.module.ModuleManager;
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
import org.apache.skywalking.oap.server.library.util.prometheus.metrics.Metric;
@@ -51,13 +46,11 @@ import org.apache.skywalking.oap.server.telemetry.api.MetricsTag;
@Slf4j
public class MetricServiceGRPCHandler extends MetricsServiceGrpc.MetricsServiceImplBase {
- private final SourceReceiver sourceReceiver;
private final CounterMetrics counter;
private final HistogramMetrics histogram;
private final List<PrometheusMetricConverter> converters;
public MetricServiceGRPCHandler(final ModuleManager moduleManager, final EnvoyMetricReceiverConfig config) throws ModuleStartException {
- sourceReceiver = moduleManager.find(CoreModule.NAME).provider().getService(SourceReceiver.class);
MetricsCreator metricsCreator = moduleManager.find(TelemetryModule.NAME)
.provider()
.getService(MetricsCreator.class);
@@ -102,13 +95,10 @@ public class MetricServiceGRPCHandler extends MetricsServiceGrpc.MetricsServiceI
if (service != null && StringUtil.isNotEmpty(service.getServiceName()) && StringUtil.isNotEmpty(service.getServiceInstanceName())) {
List<Metrics.MetricFamily> list = message.getEnvoyMetricsList();
- boolean needHeartbeatUpdate = true;
for (final Metrics.MetricFamily metricFamily : list) {
counter.inc();
- final String serviceId = IDManager.ServiceID.buildId(service.getServiceName(), NodeType.Normal);
-
try (final HistogramMetrics.Timer ignored = histogram.createTimer()) {
final ProtoMetricFamily2MetricsAdapter adapter = new ProtoMetricFamily2MetricsAdapter(metricFamily);
final Stream<Metric> metrics = adapter.adapt().peek(it -> {
@@ -116,18 +106,6 @@ public class MetricServiceGRPCHandler extends MetricsServiceGrpc.MetricsServiceI
it.getLabels().putIfAbsent("instance", service.getServiceInstanceName());
});
converters.forEach(converter -> converter.toMeter(metrics));
-
- if (needHeartbeatUpdate && list.get(0).getMetricCount() > 0) {
- final long timestamp = adapter.adaptTimestamp(list.get(0).getMetric(0));
-
- // Send heartbeat
- ServiceInstanceUpdate serviceInstanceUpdate = new ServiceInstanceUpdate();
- serviceInstanceUpdate.setName(service.getServiceInstanceName());
- serviceInstanceUpdate.setServiceId(serviceId);
- serviceInstanceUpdate.setTimeBucket(TimeBucket.getMinuteTimeBucket(timestamp));
- sourceReceiver.receive(serviceInstanceUpdate);
- needHeartbeatUpdate = false;
- }
}
}
}