[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 |
sincejune
left a comment
There was a problem hiding this comment.
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>
…ry sample (open-telemetry#40622) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### 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. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes <!--Describe what testing was performed and which tests were added.--> #### Testing <!--Describe the documentation added.--> #### Documentation <!--Please delete paragraphs that you did not use before submitting.--> --------- 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