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

Rework postgres check to split server metrics from db metrics #1073

Merged
merged 1 commit into from
Feb 1, 2018

Conversation

hush-hush
Copy link
Member

@hush-hush hush-hush commented Jan 30, 2018

What does this PR do?

Rework postgres check to split server metrics from db metrics

For postgres some metrics are collected only once per postgres server
(even if the user is monitoring multiple databases on the server from
one agent).

This rework is needed so the postgres check work properly on agent6
where check instances don't share the same check instance.

The check detect the version of the agent running by trying to import datadog_agent and only apply instance tags to COMMON_METRICS, NEWER_92_METRICS, DATABASE_SIZE_METRICS, COMMON_BGW_METRICS, NEWER_91_BGW_METRICS and COMMON_ARCHIVER_METRICS if its running on agent5.

Versioning

  • Bumped the check version in manifest.json
  • Bumped the check version in datadog_checks/{integration}/__init__.py
  • Updated CHANGELOG.md. Please use Unreleased as the date in the title
    for the new section.
  • If PR impacts documentation, docs team has been notified or an issue has been opened on the documentation repo

Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit but overall LGTM. Tests are 🍰 if you did some QA on the check, I'd ship it.

log_func = self.log.debug
else:
log_func = self.log.warning
# server wide metrics aren't tag with instance_tags starting from agent 6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aren't tagged anymore with instance tags, starting from Agent 6.0

For postgres some metrics are collected only once per postgres server
(even if the user is monitoring multiple databases on the server from
one agent).

This rework is needed so the postgres check work properly on agent6
where check instances don't share the same check instance.

The check detect the version of the agent running by trying to import
"datadog_agent" and only apply instance tags to COMMON_METRICS,
NEWER_92_METRICS, DATABASE_SIZE_METRICS, COMMON_BGW_METRICS,
NEWER_91_BGW_METRICS and COMMON_ARCHIVER_METRICS if its running on
agent5.
Copy link
Contributor

@masci masci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@hush-hush hush-hush merged commit ff5f9d5 into master Feb 1, 2018
@hush-hush hush-hush deleted the maxime/postgre-instance-tags branch February 1, 2018 16:19
@hush-hush hush-hush added this to the 5.22 milestone Feb 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants