integrations-core icon indicating copy to clipboard operation
integrations-core copied to clipboard

PG: Make query collection interval configurable

Open bonnefoa opened this issue 1 year ago • 2 comments

What does this PR do?

Make collection interval configurable on a per query basis

Motivation

Some queries executed by the agent can be expensive to run, like getting tables' sizes on db with a lot of relations. This could lead to situation where running the check takes longer than the collection interval. Currently, the only solution is to disable the offending which is not great.

This patch adds a way to make collection_interval configurable for queries that are using the QueryExecutor. This will allow the user to run some queries at a higher collection interval, generating the related metrics while limiting impact of expensive queries on both the db and the agent.

Additional Notes

Review checklist (to be filled by reviewers)

  • [ ] Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • [ ] Changelog entries must be created for modifications to shipped code
  • [ ] Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • [ ] If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

bonnefoa avatar Jul 29 '24 14:07 bonnefoa

The validations job has failed; please review the Files changed tab for possible suggestions to resolve.

github-actions[bot] avatar Jul 29 '24 14:07 github-actions[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.12%. Comparing base (35be561) to head (396f471). Report is 826 commits behind head on master.

Additional details and impacted files
Flag Coverage Δ
activemq ?
cassandra ?
hive ?
hivemq ?
ignite ?
jboss_wildfly ?
kafka ?
postgres 93.13% <100.00%> (+3.47%) :arrow_up:
presto ?
solr ?

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Jul 29 '24 15:07 codecov[bot]