kezhenxu94 commented on a change in pull request #6322:
URL: https://github.com/apache/skywalking/pull/6322#discussion_r585358389



##########
File path: oap-server/server-bootstrap/src/main/resources/lal/envoy-als.yaml
##########
@@ -0,0 +1,47 @@
+# 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.
+
+rules:
+  - name: envoy-als
+    dsl: |
+      filter {
+        json {
+        }
+        // only collect abnormal logs (http status code >= 300, or 
commonProperties?.responseFlags is not empty)
+        if (parsed?.response?.responseCode < 300 && 
!parsed?.commonProperties?.responseFlags) {
+          abort {}
+        }
+        extractor {
+          tag 'status.code': parsed?.response?.responseCode as int
+          tag 'response.flag': 
parsed?.commonProperties?.responseFlags?.keySet()
+        }
+        sink {
+          sampler {
+            if (parsed?.commonProperties?.responseFlags) {
+              // use service:errorCode as sampler id so that each 
service:errorCode has its own sampler,
+              // e.g. checkoutservice:[upstreamConnectionFailure], 
checkoutservice:[upstreamRetryLimitExceeded]
+              
rateLimit("${log.service}:${parsed?.commonProperties?.responseFlags?.keySet()}")
 {

Review comment:
       > From my understanding, this means collect less than 100/s per error 
response flag ?
   
   Yes, the sampler samples the logs in dimension <service:errorResponseFlag> 
at most 100/s

##########
File path: oap-server/server-bootstrap/src/main/resources/lal/envoy-als.yaml
##########
@@ -0,0 +1,47 @@
+# 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.
+
+rules:
+  - name: envoy-als
+    dsl: |
+      filter {
+        json {
+        }
+        // only collect abnormal logs (http status code >= 300, or 
commonProperties?.responseFlags is not empty)
+        if (parsed?.response?.responseCode < 300 && 
!parsed?.commonProperties?.responseFlags) {
+          abort {}
+        }
+        extractor {
+          tag 'status.code': parsed?.response?.responseCode as int
+          tag 'response.flag': 
parsed?.commonProperties?.responseFlags?.keySet()
+        }
+        sink {
+          sampler {
+            if (parsed?.commonProperties?.responseFlags) {
+              // use service:errorCode as sampler id so that each 
service:errorCode has its own sampler,
+              // e.g. checkoutservice:[upstreamConnectionFailure], 
checkoutservice:[upstreamRetryLimitExceeded]
+              
rateLimit("${log.service}:${parsed?.commonProperties?.responseFlags?.keySet()}")
 {
+                qps 100
+              }
+            } else {
+              // use service:responseCode as sampler id so that each 
service:responseCode has its own sampler,
+              // e.g. checkoutservice:500, checkoutservice:404.
+              rateLimit("${log.service}:${parsed?.response?.responseCode}") {

Review comment:
       Ditto

##########
File path: oap-server/server-bootstrap/src/main/resources/lal/envoy-als.yaml
##########
@@ -0,0 +1,47 @@
+# 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.
+
+rules:
+  - name: envoy-als
+    dsl: |
+      filter {
+        json {
+        }
+        // only collect abnormal logs (http status code >= 300, or 
commonProperties?.responseFlags is not empty)
+        if (parsed?.response?.responseCode < 300 && 
!parsed?.commonProperties?.responseFlags) {

Review comment:
       I'd say >=300 <400 is normal because the proxy will follow the redirect 
URL (query against the URL returned by 301, 302, or similar)

##########
File path: oap-server/server-bootstrap/src/main/resources/lal/envoy-als.yaml
##########
@@ -0,0 +1,47 @@
+# 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.
+
+rules:
+  - name: envoy-als
+    dsl: |
+      filter {
+        json {
+        }
+        // only collect abnormal logs (http status code >= 300, or 
commonProperties?.responseFlags is not empty)
+        if (parsed?.response?.responseCode < 300 && 
!parsed?.commonProperties?.responseFlags) {

Review comment:
       I'd say >=300 <400 is normal because the proxy should follow the 
redirect URL (query against the URL returned by 301, 302, or similar)




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