wu-sheng commented on a change in pull request #4769:
URL: https://github.com/apache/skywalking/pull/4769#discussion_r422617563



##########
File path: docs/en/setup/backend/backend-alarm.md
##########
@@ -77,16 +85,16 @@ We provided a default `alarm-setting.yml` in our 
distribution only for convenien
 
 ### List of all potential metrics name
 The metrics names are defined in official [OAL 
scripts](../../guides/backend-oal-scripts.md), right now 
-metrics from **Service**, **Service Instance**, **Endpoint** scopes could be 
used in Alarm, we will extend in further versions. 
+metrics from **Service**, **Service Instance**, **Endpoint**, **Service 
Relation**, **Service Instance Relation**, **Endpoint Relation** scopes could 
be used in Alarm, and the **Database access** same with **Service** scope.
 
 Submit issue or pull request if you want to support any other scope in alarm.
 
 ## Webhook
-Webhook requires the peer is a web container. The alarm message will send 
through HTTP post by `application/json` content type. The JSON format is based 
on `List<org.apache.skywalking.oap.server.core.alarm.AlarmMessage` with 
following key information.
+Webhook requires the peer is a web container. The alarm message will send 
through HTTP post by `application/json` content type. The JSON format is based 
on `List<org.apache.skywalking.oap.server.core.alarm.AlarmMessage>` with 
following key information.
 - **scopeId**, **scope**. All scopes are defined in 
org.apache.skywalking.oap.server.core.source.DefaultScopeDefine.
-- **name**. Target scope entity name.
-- **id0**. The ID of scope entity, matched the name.
-- **id1**. Not used today.
+- **name**. Target scope entity name. Please follow [Entity name 
define](#entity-name).
+- **id0**. The ID of scope entity, matched the name. When using relation 
scope, it will be the source entity ID.
+- **id1**. When using relation scope, it will be the dest entity ID. Otherwise 
it will be empty.

Review comment:
       ```suggestion
   - **id1**. When using relation scope, it will be the dest entity ID. 
Otherwise, it is empty.
   ```

##########
File path: docs/en/setup/backend/backend-alarm.md
##########
@@ -77,16 +85,16 @@ We provided a default `alarm-setting.yml` in our 
distribution only for convenien
 
 ### List of all potential metrics name
 The metrics names are defined in official [OAL 
scripts](../../guides/backend-oal-scripts.md), right now 
-metrics from **Service**, **Service Instance**, **Endpoint** scopes could be 
used in Alarm, we will extend in further versions. 
+metrics from **Service**, **Service Instance**, **Endpoint**, **Service 
Relation**, **Service Instance Relation**, **Endpoint Relation** scopes could 
be used in Alarm, and the **Database access** same with **Service** scope.
 
 Submit issue or pull request if you want to support any other scope in alarm.
 
 ## Webhook
-Webhook requires the peer is a web container. The alarm message will send 
through HTTP post by `application/json` content type. The JSON format is based 
on `List<org.apache.skywalking.oap.server.core.alarm.AlarmMessage` with 
following key information.
+Webhook requires the peer is a web container. The alarm message will send 
through HTTP post by `application/json` content type. The JSON format is based 
on `List<org.apache.skywalking.oap.server.core.alarm.AlarmMessage>` with 
following key information.
 - **scopeId**, **scope**. All scopes are defined in 
org.apache.skywalking.oap.server.core.source.DefaultScopeDefine.
-- **name**. Target scope entity name.
-- **id0**. The ID of scope entity, matched the name.
-- **id1**. Not used today.
+- **name**. Target scope entity name. Please follow [Entity name 
define](#entity-name).
+- **id0**. The ID of scope entity, matched the name. When using relation 
scope, it will be the source entity ID.

Review comment:
       ```suggestion
   - **id0**. The ID of the scope entity matched the name. When using relation 
scope, it is the source entity ID.
   ```

##########
File path: 
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/alarm/ServiceRelationMetaInAlarm.java
##########
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.oap.server.core.alarm;
+
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.Setter;
+import org.apache.skywalking.oap.server.core.analysis.IDManager;
+import org.apache.skywalking.oap.server.core.source.DefaultScopeDefine;
+
+@Getter(AccessLevel.PUBLIC)
+@Setter(AccessLevel.PUBLIC)

Review comment:
       All these AccessLevel are default, we could remove them.




----------------------------------------------------------------
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]


Reply via email to