elastic / elastic/apm

Support for span idle time

Open
#391 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Gherkin
Stars
427
Forks
125
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
Some languages support resumable functions, or async/await. Those are blocks of code which might yield execution at certain points, to allow other async blocks to run. At some point, execution is resumed from the yield point. This proves to be problematic for APM, since it doesn't support any notion of idle time, that is time spent while a span is not yet closed, but not executing its code. Since span duration should only encompass actual time spent, this leads to situations where child spans start after parent span ended e.g.

```
parent span
|---1s---|---yeld-1s---|---1s---|

child span
|---1s---|
```

Te above shows an example case when parent span yields execution for 1s and resumes. This is how it should be presented to the end user. APM would present the spans as follows:

```
parent span
|-------2s-------|

child span
|---1s---|
```

**Describe the solution you'd like**
Add idle time to spans and transactions, along with duration and use that in the UI. Alternative (better) approach: allow for lists of time ranges for execution and idle time, to accurately show when a span is executing and when is idle.

**Describe alternatives you've considered**
Adding idle time to duration is an alternative, but it skews duration metrics and makes it impossible to tell how much time a span is actually executing.

**Additional context**
See documentation of async/await in languages like Rust.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.