Skip to content
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

Exclude EXPLAIN queries from pg_stat_statements #9358

Merged
merged 2 commits into from
May 17, 2021

Conversation

djova
Copy link
Contributor

@djova djova commented May 14, 2021

What does this PR do?

Update the collection of postgres query metrics to exclude EXPLAIN queries.

Motivation

If deep database monitoring is enabled and we are collecting execution plans, then there will be at least one tracked EXPLAIN statement for every unique normalized query we encounter. Since these statements are not used in the product we exclude them from collection.

This updates postgres to have the same behavior as mysql, where we do the same exclusion for query metrics.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@ghost ghost added the integration/postgres label May 14, 2021
@djova djova marked this pull request as ready for review May 14, 2021 20:10
@djova djova requested a review from a team as a code owner May 14, 2021 20:10
@codecov
Copy link

codecov bot commented May 17, 2021

Codecov Report

Merging #9358 (d000e84) into master (a8c2e9e) will increase coverage by 0.00%.
The diff coverage is n/a.

Flag Coverage Δ
postgres 91.61% <ø> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
postgres/datadog_checks/postgres/statements.py 85.86% <ø> (ø)
postgres/datadog_checks/postgres/config.py 72.27% <0.00%> (+3.96%) ⬆️

djova added 2 commits May 17, 2021 18:01
Update the collection of postgres query metrics to exclude `EXPLAIN` queries.

If deep database monitoring is enabled and we are collecting execution plans, then there will be at least one tracked EXPLAIN statement for every unique normalized query we encounter. Since these statements are not used in the product we exclude them from collection.

This updates postgres to have the same behavior as mysql, where we do the same exclusion for query metrics.
@djova djova force-pushed the djova/postgres-exclude-explain-pg-stat-statements branch from 68a7eca to d000e84 Compare May 17, 2021 22:02
@ofek ofek changed the title postgres exclude EXPLAIN queries from pg_stat_statements Exclude EXPLAIN queries from pg_stat_statements May 17, 2021
@djova djova merged commit 2c6a9c5 into master May 17, 2021
@djova djova deleted the djova/postgres-exclude-explain-pg-stat-statements branch May 17, 2021 23:02
daanleenders pushed a commit to daanleenders/integrations-core that referenced this pull request May 19, 2021
* postgres exclude EXPLAIN queries from pg_stat_statements

Update the collection of postgres query metrics to exclude `EXPLAIN` queries.

If deep database monitoring is enabled and we are collecting execution plans, then there will be at least one tracked EXPLAIN statement for every unique normalized query we encounter. Since these statements are not used in the product we exclude them from collection.

This updates postgres to have the same behavior as mysql, where we do the same exclusion for query metrics.

* escape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants