You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "toffentoffen (via GitHub)" <gi...@apache.org> on 2023/06/08 16:57:03 UTC

[GitHub] [skywalking] toffentoffen opened a new pull request, #10905: Consider 4xx as client side error for envoy ALS based metrics

toffentoffen opened a new pull request, #10905:
URL: https://github.com/apache/skywalking/pull/10905

   <!--
       ⚠️ Please make sure to read this template first, pull requests that don't accord with this template
       maybe closed without notice.
       Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
       Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
   -->
   
   <!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
   ### Fix <bug description or the bug issue number or bug issue link>
   - [ ] Add a unit test to verify that the fix works.
   - [ ] Explain briefly why the bug exists and how to fix it.
        ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
   
   <!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
   ### Improve the performance of <class or module or ...>
   - [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
   - [ ] The benchmark result.
   ```text
   <Paste the benchmark results here>
   ```
   - [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
        ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
   
   <!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
   ### <Feature description>
   - [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
   - [ ] Update the documentation to include this new feature.
   - [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
   - [ ] If it's UI related, attach the screenshots below.
        ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
   
   - [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
   - [ ] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).
   
   When metrics are generated from ALS envoy entries, `ServiceRelation` and `ServiceInstanceRelation` **client side** generated metrics should consider 4xx status codes as error (`status` false).


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10905: Consider 4xx as client side error for envoy ALS based metrics

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #10905:
URL: https://github.com/apache/skywalking/pull/10905#discussion_r1225992784


##########
oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/LogEntry2MetricsAdapter.java:
##########
@@ -81,10 +81,16 @@ public HTTPServiceMeshMetric.Builder adaptToUpstreamMetrics() {
         final long outboundStartTime = startTime + formatAsLong(properties.getTimeToFirstUpstreamTxByte());
         final long outboundEndTime = startTime + formatAsLong(properties.getTimeToLastUpstreamRxByte());
 
+        final HTTPServiceMeshMetric.Builder builder = adaptCommonPart();
+        // For client side call, status needs to be overridden because 4xx http status codes
+        // are considered as errors to.
+        final boolean status = builder.getResponseCode() < 400;
+
         return adaptCommonPart()

Review Comment:
   Can we share the two `adaptCommonPart()`s?
   
   ```suggestion
           final HTTPServiceMeshMetric.Builder builder = adaptCommonPart();
           // For client side call, status needs to be overridden because 4xx http status codes
           // are considered as errors to.
           final boolean status = builder.getResponseCode() < 400;
   
           return builder
   ```



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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10905: Consider 4xx as client side error for envoy ALS based metrics

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #10905:
URL: https://github.com/apache/skywalking/pull/10905#discussion_r1223791692


##########
oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/LogEntry2MetricsAdapter.java:
##########
@@ -81,10 +81,16 @@ public HTTPServiceMeshMetric.Builder adaptToUpstreamMetrics() {
         final long outboundStartTime = startTime + formatAsLong(properties.getTimeToFirstUpstreamTxByte());
         final long outboundEndTime = startTime + formatAsLong(properties.getTimeToLastUpstreamRxByte());
 
+        final HTTPServiceMeshMetric.Builder builder = adaptCommonPart();
+        // For client side call, status needs to be overridden because 4xx http status codes
+        // are considered as errors to.
+        final boolean status = builder.getResponseCode() < 400;
+
         return adaptCommonPart()
             .setStartTime(outboundStartTime)
             .setEndTime(outboundEndTime)
             .setLatency((int) Math.max(1L, outboundEndTime - outboundStartTime))
+            .setStatus(status)

Review Comment:
   > The status was not set? If so, the current status should be all `false`.
   > I am feeling there is a later place overriding this?
   
   It was actually set in `adaptCommonPart`, and here is to "override"



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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10905: Consider 4xx as client side error for envoy ALS based metrics

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #10905:
URL: https://github.com/apache/skywalking/pull/10905#discussion_r1223777955


##########
oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/LogEntry2MetricsAdapter.java:
##########
@@ -81,10 +81,16 @@ public HTTPServiceMeshMetric.Builder adaptToUpstreamMetrics() {
         final long outboundStartTime = startTime + formatAsLong(properties.getTimeToFirstUpstreamTxByte());
         final long outboundEndTime = startTime + formatAsLong(properties.getTimeToLastUpstreamRxByte());
 
+        final HTTPServiceMeshMetric.Builder builder = adaptCommonPart();
+        // For client side call, status needs to be overridden because 4xx http status codes
+        // are considered as errors to.
+        final boolean status = builder.getResponseCode() < 400;
+
         return adaptCommonPart()
             .setStartTime(outboundStartTime)
             .setEndTime(outboundEndTime)
             .setLatency((int) Math.max(1L, outboundEndTime - outboundStartTime))
+            .setStatus(status)

Review Comment:
   The status was not set? If so, the current status should be all `false`.
   I am feeling there is a later place overriding this?



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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] toffentoffen commented on a diff in pull request #10905: Consider 4xx as client side error for envoy ALS based metrics

Posted by "toffentoffen (via GitHub)" <gi...@apache.org>.
toffentoffen commented on code in PR #10905:
URL: https://github.com/apache/skywalking/pull/10905#discussion_r1227223783


##########
oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/LogEntry2MetricsAdapter.java:
##########
@@ -81,10 +81,16 @@ public HTTPServiceMeshMetric.Builder adaptToUpstreamMetrics() {
         final long outboundStartTime = startTime + formatAsLong(properties.getTimeToFirstUpstreamTxByte());
         final long outboundEndTime = startTime + formatAsLong(properties.getTimeToLastUpstreamRxByte());
 
+        final HTTPServiceMeshMetric.Builder builder = adaptCommonPart();
+        // For client side call, status needs to be overridden because 4xx http status codes
+        // are considered as errors to.
+        final boolean status = builder.getResponseCode() < 400;
+
         return adaptCommonPart()

Review Comment:
   🤦, sorry my bad. Originally it was meant to be as you say. Copied in a wrong way my original PR.
   Thanks for noticing it.



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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] kezhenxu94 commented on a diff in pull request #10905: Consider 4xx as client side error for envoy ALS based metrics

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #10905:
URL: https://github.com/apache/skywalking/pull/10905#discussion_r1227392768


##########
oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/LogEntry2MetricsAdapter.java:
##########
@@ -81,10 +81,16 @@ public HTTPServiceMeshMetric.Builder adaptToUpstreamMetrics() {
         final long outboundStartTime = startTime + formatAsLong(properties.getTimeToFirstUpstreamTxByte());
         final long outboundEndTime = startTime + formatAsLong(properties.getTimeToLastUpstreamRxByte());
 
-        return adaptCommonPart()
+        final HTTPServiceMeshMetric.Builder builder = adaptCommonPart();
+        // For client side call, status needs to be overridden because 4xx http status codes
+        // are considered as errors to.

Review Comment:
   nit:
   
   ```suggestion
           // are considered as errors too.
   ```



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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10905: Consider 4xx as client side error for envoy ALS based metrics

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #10905:
URL: https://github.com/apache/skywalking/pull/10905#discussion_r1223794791


##########
oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/LogEntry2MetricsAdapter.java:
##########
@@ -81,10 +81,16 @@ public HTTPServiceMeshMetric.Builder adaptToUpstreamMetrics() {
         final long outboundStartTime = startTime + formatAsLong(properties.getTimeToFirstUpstreamTxByte());
         final long outboundEndTime = startTime + formatAsLong(properties.getTimeToLastUpstreamRxByte());
 
+        final HTTPServiceMeshMetric.Builder builder = adaptCommonPart();
+        // For client side call, status needs to be overridden because 4xx http status codes
+        // are considered as errors to.
+        final boolean status = builder.getResponseCode() < 400;
+
         return adaptCommonPart()
             .setStartTime(outboundStartTime)
             .setEndTime(outboundEndTime)
             .setLatency((int) Math.max(1L, outboundEndTime - outboundStartTime))
+            .setStatus(status)

Review Comment:
   OK, got it. Then this should be fine.



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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on a diff in pull request #10905: Consider 4xx as client side error for envoy ALS based metrics

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on code in PR #10905:
URL: https://github.com/apache/skywalking/pull/10905#discussion_r1224558760


##########
docs/en/changes/changes.md:
##########
@@ -53,6 +53,7 @@
 * Deprecated record query protocol.
 * Add component ID for go-redis.
 * Add OpenSearch 2.8.0 to test case.
+* Envoy metrics service generated relation metrics considers http status codes >= 400 has an error.

Review Comment:
   ```suggestion
   * Envoy ALS generated relation metrics considers http status codes >= 400 has an error at the client side.
   ```
   
   This should be client side only, right?



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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng merged pull request #10905: Consider 4xx as client side error for envoy ALS based metrics

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #10905:
URL: https://github.com/apache/skywalking/pull/10905


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

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org