Performance: filter spans based on duration
See original GitHub issueUsing the APM, my span index is full of db spans (span.type:db) containing lots of fast execution queries that are of little interest. A method to filter these spans based on duration will help to ignore fast queries and trace only important long running queries. Using sampling can ignore important long queries.
I suggest a dynamic configuration option based on span type and subtype:
span_min_duration_[type]_[subtype]=[ms]
Example:
span_min_duration_db=500ms
will record only spans with type db and any subtype longer than 500msspan_min_duration_app_maintenance=100ms
will record spans with type app and subtype maintenance longer than 100ms
Related: https://github.com/elastic/apm-agent-java/issues/440
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Trace Explorer - Datadog Docs
Custom retention filters that you can create to determine which spans to index. Once indexed through a custom retention filter, traces are retained...
Read more >Configure Span Filters - Oracle Help Center
Use the Time range dropdown list to show the spans that match the selected time range. Click Create. Use the action menu to...
Read more >Analyze data on Span level | Sumo Logic Docs
The Spans page allows you to filter and aggregate your trace data at the raw span level so you can understand the performance...
Read more >spans() Function | Tanzu Observability Documentation
Span filters let you limit which spans to return traces for. ... Doing so allows you to filter traces according to the duration...
Read more >Understand and use the distributed tracing UI
Sort through your traces using a filter to find that specific request and show only ... Query returns are based on span attributes,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My example scales, in a 2GB span index with 11.5M docs, 95% spans are db type and more than 99% of db span duration is below 4ms. Such a waste of disk space…
Thinking to disable db spans and use postgres logging feature of threshold duration queries, then parse with logstash and manual crossreference log time with transaction to find the source, until this issue is resolved.
Also related, there is another related upcoming feature to handle fast exit spans (which include DB spans):