question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance: filter spans based on duration

See original GitHub issue

Using 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 500ms
  • span_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:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cdalexndrcommented, Sep 25, 2019

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.

0reactions
SylvainJugecommented, Sep 20, 2021

Also related, there is another related upcoming feature to handle fast exit spans (which include DB spans):

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found