You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ho...@apache.org on 2022/04/18 08:24:49 UTC
[skywalking-java] branch main updated: Add layer field to event when reporting (#159)
This is an automated email from the ASF dual-hosted git repository.
hoshea pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-java.git
The following commit(s) were added to refs/heads/main by this push:
new 65032a9b4 Add layer field to event when reporting (#159)
65032a9b4 is described below
commit 65032a9b485411363b5297fadc970115d22b13b8
Author: Hoshea Jiang <fg...@gmail.com>
AuthorDate: Mon Apr 18 16:24:43 2022 +0800
Add layer field to event when reporting (#159)
---
CHANGES.md | 1 +
apm-protocol/apm-network/src/main/proto | 2 +-
.../java/org/apache/skywalking/apm/agent/core/conf/Constants.java | 4 ++++
.../skywalking/apm/agent/core/remote/EventReportServiceClient.java | 7 +++++--
4 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/CHANGES.md b/CHANGES.md
index 33c29df91..db5ca8732 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -6,6 +6,7 @@ Release Notes.
------------------
* Fix `cluster` and `namespace` value duplicated(`namespace` value) in properties report.
+* Add layer field to event when reporting.
#### Documentation
diff --git a/apm-protocol/apm-network/src/main/proto b/apm-protocol/apm-network/src/main/proto
index 667134d08..f9066463d 160000
--- a/apm-protocol/apm-network/src/main/proto
+++ b/apm-protocol/apm-network/src/main/proto
@@ -1 +1 @@
-Subproject commit 667134d08ffd63122062971d320c34e7e10a7c9e
+Subproject commit f9066463deb7f9d1fbe8110eab3524694b0db298
diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Constants.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Constants.java
index 3c0d1f35a..df715e965 100644
--- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Constants.java
+++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Constants.java
@@ -26,4 +26,8 @@ public class Constants {
public static String EMPTY_STRING = "";
public static char SERVICE_NAME_PART_CONNECTOR = '|';
+
+ // The name of the layer that represents agent-installed services,
+ // which is defined at https://github.com/apache/skywalking/blob/85ce1645be53e46286f36c0ea206c60db2d1a716/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java#L30
+ public static String EVENT_LAYER_NAME = "GENERAL";
}
diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/EventReportServiceClient.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/EventReportServiceClient.java
index 208cff8c4..73860707f 100644
--- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/EventReportServiceClient.java
+++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/remote/EventReportServiceClient.java
@@ -41,6 +41,7 @@ import org.apache.skywalking.apm.network.event.v3.Source;
import org.apache.skywalking.apm.network.event.v3.Type;
import static org.apache.skywalking.apm.agent.core.conf.Config.Collector.GRPC_UPSTREAM_TIMEOUT;
+import static org.apache.skywalking.apm.agent.core.conf.Constants.EVENT_LAYER_NAME;
import static org.apache.skywalking.apm.agent.core.remote.GRPCChannelStatus.CONNECTED;
@DefaultImplementor
@@ -78,7 +79,8 @@ public class EventReportServiceClient implements BootService, GRPCChannelListene
.stream()
.sorted()
.collect(Collectors.joining(" "))
- );
+ )
+ .setLayer(EVENT_LAYER_NAME);
}
@Override
@@ -112,7 +114,8 @@ public class EventReportServiceClient implements BootService, GRPCChannelListene
.setService(Config.Agent.SERVICE_NAME)
.setServiceInstance(Config.Agent.INSTANCE_NAME)
.build()
- );
+ )
+ .setLayer(EVENT_LAYER_NAME);
final StreamObserver<Event> collector = eventServiceStub.collect(new StreamObserver<Commands>() {
@Override