-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[receiver/postgresql] collect query samples only after the newest query sample #40622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[receiver/postgresql] collect query samples only after the newest query sample #40622
Conversation
…tor-contrib into only-query-after-last-result
@antonblock please review as codeowner |
@cuichenli Could you please merge/rebase to resolve the conflicts? |
…tor-contrib into only-query-after-last-result
updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'm wondering if this is the correct thing to do. The query sample collection should collect the current activities, right? even if it has been running for a long time. In this assumption, I think probably duplicated events are expected?
Yes that is correct, but not what this PR tries to achieve. It is to address that in certain cases we have some idle sessions, those should not be included in the query sample.
https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW |
…tor-contrib into only-query-after-last-result
Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>
Description
the current implementation scrape query samples from all the time, which is not very efficiency. this pr changes it to only scrape the query that is newer than the previous oldest query.
Link to tracking issue
Fixes
Testing
Documentation