-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe
Now the service graph data includes (parent, child, callCount) for each edge. A few APM products provide more information, such as qps, error rate, latency.
Describe the solution you'd like
When generating service graph data, we can query out more data.
Current logsql is:
(NOT parent_span_id:"") AND (kind:~"2|5")
| fields parent_span_id, resource_attr:service.name
| rename parent_span_id as span_id, resource_attr:service.name as child
| join by (span_id) (
(NOT span_id:"") AND (kind:~"3|4")
| fields span_id, resource_attr:service.name
| rename resource_attr:service.name as parent
) inner
| NOT parent:eq_field(child)
| stats by (parent, child) count() callCount
Suggested logsql:
(NOT parent_span_id:"") AND (kind:~"2|5")
| fields parent_span_id, resource_attr:service.name, duration, status_code
| rename parent_span_id as span_id, resource_attr:service.name as child, duration as child_duration, status_code as child_status_code
| join by (span_id) (
(NOT span_id:"") AND (kind:~"3|4")
| fields span_id, resource_attr:service.name, duration, status_code
| rename resource_attr:service.name as parent, duration as parent_duration, status_code as parent_status_code
) inner
| NOT parent:eq_field(child)
| stats by (parent, child) count() callCount, sum(parent_duration) as parentDurationSum, sum(child_duration) as clientDurationSum, count() if (child_status_code:=2) childErrorCount, count() if (parent_status_code:=2) parentErrorCount
Moreover, we can include the value of servicegraph.taskLookbehind in each edge to calculate:
- rps = callCount / taskLookbehind
- avg duration = durationSum / taskLookbehind
- error rate = errorCount / taskLookbehind
Describe alternatives you've considered
No response
Additional information
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request