You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "yswdqz (via GitHub)" <gi...@apache.org> on 2024/06/10 14:43:56 UTC

[PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   
   - [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
   - [x] Update the documentation to include this new feature.
   - [x] 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 👆 ==== -->
   
   - [x] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #12245.
   - [x] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).
   


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   We should have 3 new dashboard setups for service, instance and endpoint relationship for `general layer`.
   
   @wankai123 We host service, instance and endpoint dashboards, 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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2160024957

   
   > What do you mean other codes? I mean your new added codes. The previous ones are for other cases, aren't they?
   
   Whatever the type,Layer has added at here.
   https://github.com/apache/skywalking/blob/caeaec6387cf43bb8659238c18cc0c56b9226cc8/oap-server/server-query-plugin/promql-plugin/src/main/java/org/apache/skywalking/oap/query/promql/rt/PromQLExprQueryVisitor.java#L217


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "wankai123 (via GitHub)" <gi...@apache.org>.
wankai123 commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2171273578

   https://skywalking.apache.org/docs/main/next/en/setup/backend/ui-grafana/  pointed to the Grafana Demo in the end section. Users can export the template from the demo or download it from the showcase.
   
   But I think we could update/add a relation-metrics section under https://skywalking.apache.org/docs/main/next/en/setup/backend/ui-grafana/#configure-metric-dashboards


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2159961236

   > You don't add source layer, I think? 
   
   Source Layer has added at another code.
   
   > Please order them in a certain order to avoid confusion.
   
   Is the checklabel part?


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2167318487

   > @yswdqz How about this?
   
   I've been busy with a few things the last few days, so I'll try to get it done today


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   As folded dashboards are added, you could only keep services and layers out of all dashboards, and move instances and endpoints into relative dashboard directly.


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   You don't add source layer, I think?
   Please order them in a certain order to avoid confusion.
   
   Service + instance/endpoint + layer at both sides.


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   > > Can't you move this into the instance tab?
   > 
   > 
   > 
   > I don't know how to do that. Services, ServiceInstances, Endpoints are variables in dashboard. And I don't know how can I bind it to pannel level (maybe not support?).
   > 
   > 
   
   If that is noy supported, I am good of the latest status.


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   @yswdqz When your showcase PR gets merged, could you update a list here pointing to all dashboards?


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2168532195

   I found a bug about armeria,  it will delete `'`, and make promql antlr4 parser sytax mistake in this case.
   <img width="1491" alt="image" src="https://github.com/apache/skywalking/assets/74546965/0083e2c2-8ed6-4d14-b622-e519c2663144">
   


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2170362236

   > Why you need to keep number of rows same? This page is long, we should keep the page as short as possible. Instance could try with 4 widget per row(2 for client, 2 for server) and same for the endpoint.
   
   Is that OK?
   <img width="1511" alt="image" src="https://github.com/apache/skywalking/assets/74546965/28e3dfdf-8db8-45ea-a51c-54e95207b206">
   <img width="1511" alt="image" src="https://github.com/apache/skywalking/assets/74546965/b1c71d9c-9616-4f5a-8a3b-244300389680">
   <img width="1511" alt="image" src="https://github.com/apache/skywalking/assets/74546965/0460cffe-65e4-4823-a4ff-47d54f6030dc">
   


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2170359213

   > Can't you move this into the instance tab?
   
   I don't know how to do that. Services, ServiceInstances, Endpoints are variables in dashboard. And I don't know how can I bind it to pannel level (maybe not support?).
   


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   And for metric graphs in the dashboard, you could make 3 widgets per row. One per row seems too wide, 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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   @wankai123 Any thought?


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   > > You don't add source layer, I think?
   > 
   > Source Layer has added at another code.
   
   What do you mean other codes? I mean your new added codes. The previous ones are for other cases, aren't they?
   
   > 
   > > Please order them in a certain order to avoid confusion.
   > 
   > Is the checklabel part?
   
   Yes. It helps for code reading.
   
   


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   We should have docs update to point to https://github.com/apache/skywalking-showcase/pull/176?


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2158564234

   ![bd5ade0bf1fc72f9f252931b67767c13](https://github.com/apache/skywalking/assets/74546965/3d47fdf4-673f-4fdb-baed-85dcf6279678)
   I have wrote a unit test, and I tested service_relation part on local grafana dashboard. It seems work.


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   > > We should have 3 new dashboard setups for service, instance and endpoint relationship for `general layer`.
   > > @wankai123 We host service, instance and endpoint dashboards, right?
   > 
   > Yes, but they are all on one dashboard with different `Rows` widget.
   
   Relation could be in that case. But maybe a little confused. It is better we have three.


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   I think once you fix another suggestion, and add dashboards for these relations, we're good.


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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


##########
oap-server/server-query-plugin/promql-plugin/src/main/java/org/apache/skywalking/oap/query/promql/rt/PromQLExprQueryVisitor.java:
##########
@@ -440,6 +440,32 @@ private Entity buildEntity(Layer layer,
                 checkLabels(labelMap, LabelName.ENDPOINT);
                 entity.setEndpointName(labelMap.get(LabelName.ENDPOINT));
                 break;
+            case ServiceRelation:
+                checkLabels(labelMap, LabelName.DEST_SERVICE);
+                checkLabels(labelMap, LabelName.DEST_LAYER);
+                entity.setDestServiceName(labelMap.get(LabelName.DEST_SERVICE));
+                entity.setDestNormal(Layer.nameOf(labelMap.get(LabelName.DEST_LAYER)).isNormal());
+                break;
+            case ServiceInstanceRelation:
+                checkLabels(labelMap, LabelName.DEST_SERVICE);
+                checkLabels(labelMap, LabelName.DEST_SERVICE_INSTANCE);
+                checkLabels(labelMap, LabelName.SERVICE_INSTANCE);
+                checkLabels(labelMap, LabelName.DEST_LAYER);
+                entity.setServiceInstanceName(labelMap.get(LabelName.SERVICE_INSTANCE));
+                entity.setDestServiceInstanceName(labelMap.get(LabelName.DEST_SERVICE_INSTANCE));
+                entity.setDestServiceName(labelMap.get(LabelName.DEST_SERVICE));
+                entity.setDestNormal(Layer.nameOf(labelMap.get(LabelName.DEST_LAYER)).isNormal());
+                break;
+            case EndpointRelation:
+                checkLabels(labelMap, LabelName.DEST_SERVICE);
+                checkLabels(labelMap, LabelName.DEST_ENDPOINT);
+                checkLabels(labelMap, LabelName.ENDPOINT);
+                checkLabels(labelMap, LabelName.DEST_LAYER);

Review Comment:
   ```suggestion
                   checkLabels(labelMap, LabelName.ENDPOINT, LabelName.DEST_SERVICE, LabelName.DEST_ENDPOINT, LabelName.ENDPOINT, LabelName.DEST_LAYER);
   ```



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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   Why don't you use double quotations mark to separate? Is your way grammarly correct for a HTTP? 
   
   I prefer the way is "xxxx='yyy'" or 'xxx="yyy"'


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   @yswdqz How about 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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   > > And for metric graphs in the dashboard, you could make 3 widgets per row. One per row seems too wide, right?
   > 
   > Endpoint only has 4 widgets, and service and serviceinstance has 8(server side and client side, so 4 rows is good), so I keep the same style with service and instance(4 rows).
   
   Why you need to keep number of rows same? This page is long, we should keep the page as short as possible. Instance could try with 4 widget per row(2 for client, 2 for server) and same for the endpoint.


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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


##########
docs/en/api/promql-service.md:
##########
@@ -389,20 +389,23 @@ Not all scopes are supported for now, please check the following table:
 | Service                 | yes     |
 | ServiceInstance         | yes     |
 | Endpoint                | yes     |
-| ServiceRelation         | no      |
-| ServiceInstanceRelation | no      |
+| ServiceRelation         | yes     |
+| ServiceInstanceRelation | yes     |

Review Comment:
   We have EndpointRelation too, I think the doc missed that before.



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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "wankai123 (via GitHub)" <gi...@apache.org>.
wankai123 commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2158590176

   > We should have 3 new dashboard setups for service, instance and endpoint relationship for `general layer`.
   > 
   > @wankai123 We host service, instance and endpoint dashboards, right?
   
   Yes, but they are all on one dashboard.
   


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2171471761

   Got 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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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

   Can't you move this into the instance tab?
   
   <img width="838" alt="image" src="https://github.com/apache/skywalking/assets/5441976/767c9b45-7693-4df6-b494-4b02f987b98b">
   


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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


##########
oap-server/server-query-plugin/promql-plugin/src/main/java/org/apache/skywalking/oap/query/promql/rt/PromQLExprQueryVisitor.java:
##########
@@ -440,6 +440,32 @@ private Entity buildEntity(Layer layer,
                 checkLabels(labelMap, LabelName.ENDPOINT);
                 entity.setEndpointName(labelMap.get(LabelName.ENDPOINT));
                 break;
+            case ServiceRelation:
+                checkLabels(labelMap, LabelName.DEST_SERVICE);
+                checkLabels(labelMap, LabelName.DEST_LAYER);
+                entity.setDestServiceName(labelMap.get(LabelName.DEST_SERVICE));
+                entity.setDestNormal(Layer.nameOf(labelMap.get(LabelName.DEST_LAYER)).isNormal());
+                break;
+            case ServiceInstanceRelation:
+                checkLabels(labelMap, LabelName.DEST_SERVICE);
+                checkLabels(labelMap, LabelName.DEST_SERVICE_INSTANCE);
+                checkLabels(labelMap, LabelName.SERVICE_INSTANCE);
+                checkLabels(labelMap, LabelName.DEST_LAYER);

Review Comment:
   ```suggestion
                   checkLabels(labelMap, , LabelName.SERVICE_INSTANCE, LabelName.DEST_SERVICE, LabelName.DEST_SERVICE_INSTANCE,  LabelName.SERVICE_INSTANCE, LabelName.DEST_LAYER);
   ```



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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2170010937

   > And for metric graphs in the dashboard, you could make 3 widgets per row. One per row seems too wide, right?
   
   Endpoint only has 4 widgets, and service and serviceinstance has 8(server side and client side, so 4 rows is good), so I keep the same style with service and instance(4 rows).


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2170020396

   > As folded dashboards are added, you could only keep services and layers out of all dashboards, and move instances and endpoints into relative dashboard directly.
   
   Sorry, I am not familiar with grafana, how can I make 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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2171090164

   I didn't find the documentation I needed to change, the only documentation I found related to grafana was https://skywalking.apache.org/docs/main/next/en/setup/backend/ui-grafana/


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

Posted by "yswdqz (via GitHub)" <gi...@apache.org>.
yswdqz commented on PR #12316:
URL: https://github.com/apache/skywalking/pull/12316#issuecomment-2169841324

   Is these OK? And I think this will be commit in showcase?
   <img width="1507" alt="image" src="https://github.com/apache/skywalking/assets/74546965/0a1209b4-08f8-4cbd-8ef6-f3dc594d545a">
   <img width="1493" alt="image" src="https://github.com/apache/skywalking/assets/74546965/968a6920-d559-4526-934d-41b75ac48ab5">
   <img width="1510" alt="image" src="https://github.com/apache/skywalking/assets/74546965/6d469b82-9ce8-4014-b703-b553a51b53a6">
   <img width="1502" alt="image" src="https://github.com/apache/skywalking/assets/74546965/6a77ae16-e702-4ee8-a1e5-c2f9dc11c228">
   <img width="1511" alt="image" src="https://github.com/apache/skywalking/assets/74546965/707a6b9c-2e3e-4f1e-9fbc-8cb3d867cba8">
   <img width="1504" alt="image" src="https://github.com/apache/skywalking/assets/74546965/bf0e9db4-1d50-4935-8b84-76c80ef94388">
   <img width="1509" alt="image" src="https://github.com/apache/skywalking/assets/74546965/a43281df-8845-45ac-a423-d0516111b367">
   


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


Re: [PR] [Feature] Support to query relation metrics through PromQL. [skywalking]

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


##########
oap-server/server-query-plugin/promql-plugin/src/main/java/org/apache/skywalking/oap/query/promql/rt/PromQLExprQueryVisitor.java:
##########
@@ -440,6 +440,32 @@ private Entity buildEntity(Layer layer,
                 checkLabels(labelMap, LabelName.ENDPOINT);
                 entity.setEndpointName(labelMap.get(LabelName.ENDPOINT));
                 break;
+            case ServiceRelation:
+                checkLabels(labelMap, LabelName.DEST_SERVICE);
+                checkLabels(labelMap, LabelName.DEST_LAYER);
+                entity.setDestServiceName(labelMap.get(LabelName.DEST_SERVICE));
+                entity.setDestNormal(Layer.nameOf(labelMap.get(LabelName.DEST_LAYER)).isNormal());
+                break;
+            case ServiceInstanceRelation:
+                checkLabels(labelMap, LabelName.DEST_SERVICE);
+                checkLabels(labelMap, LabelName.DEST_SERVICE_INSTANCE);
+                checkLabels(labelMap, LabelName.SERVICE_INSTANCE);
+                checkLabels(labelMap, LabelName.DEST_LAYER);
+                entity.setServiceInstanceName(labelMap.get(LabelName.SERVICE_INSTANCE));
+                entity.setDestServiceInstanceName(labelMap.get(LabelName.DEST_SERVICE_INSTANCE));
+                entity.setDestServiceName(labelMap.get(LabelName.DEST_SERVICE));
+                entity.setDestNormal(Layer.nameOf(labelMap.get(LabelName.DEST_LAYER)).isNormal());
+                break;
+            case EndpointRelation:
+                checkLabels(labelMap, LabelName.DEST_SERVICE);
+                checkLabels(labelMap, LabelName.DEST_ENDPOINT);
+                checkLabels(labelMap, LabelName.ENDPOINT);
+                checkLabels(labelMap, LabelName.DEST_LAYER);

Review Comment:
   ```suggestion
                   checkLabels(labelMap, LabelName.DEST_SERVICE, LabelName.DEST_ENDPOINT, LabelName.ENDPOINT, LabelName.DEST_LAYER);
   ```



##########
oap-server/server-query-plugin/promql-plugin/src/main/java/org/apache/skywalking/oap/query/promql/rt/PromQLExprQueryVisitor.java:
##########
@@ -440,6 +440,32 @@ private Entity buildEntity(Layer layer,
                 checkLabels(labelMap, LabelName.ENDPOINT);
                 entity.setEndpointName(labelMap.get(LabelName.ENDPOINT));
                 break;
+            case ServiceRelation:
+                checkLabels(labelMap, LabelName.DEST_SERVICE);
+                checkLabels(labelMap, LabelName.DEST_LAYER);

Review Comment:
   ```suggestion
                   checkLabels(labelMap, LabelName.DEST_SERVICE, LabelName.DEST_LAYER);
   ```
   We can check the labels at the same time. 



##########
oap-server/server-query-plugin/promql-plugin/src/main/java/org/apache/skywalking/oap/query/promql/rt/PromQLExprQueryVisitor.java:
##########
@@ -440,6 +440,32 @@ private Entity buildEntity(Layer layer,
                 checkLabels(labelMap, LabelName.ENDPOINT);
                 entity.setEndpointName(labelMap.get(LabelName.ENDPOINT));
                 break;
+            case ServiceRelation:
+                checkLabels(labelMap, LabelName.DEST_SERVICE);
+                checkLabels(labelMap, LabelName.DEST_LAYER);
+                entity.setDestServiceName(labelMap.get(LabelName.DEST_SERVICE));
+                entity.setDestNormal(Layer.nameOf(labelMap.get(LabelName.DEST_LAYER)).isNormal());
+                break;
+            case ServiceInstanceRelation:
+                checkLabels(labelMap, LabelName.DEST_SERVICE);
+                checkLabels(labelMap, LabelName.DEST_SERVICE_INSTANCE);
+                checkLabels(labelMap, LabelName.SERVICE_INSTANCE);
+                checkLabels(labelMap, LabelName.DEST_LAYER);

Review Comment:
   ```suggestion
                   checkLabels(labelMap, LabelName.DEST_SERVICE, LabelName.DEST_SERVICE_INSTANCE,  LabelName.SERVICE_INSTANCE, LabelName.DEST_LAYER);
   ```



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