Skip to content

Add Aurora role tag to PostgreSQL metrics - #24901

Open
joelmarcotte wants to merge 3 commits into
masterfrom
joel.marcotte/aurora-role-tag
Open

Add Aurora role tag to PostgreSQL metrics#24901
joelmarcotte wants to merge 3 commits into
masterfrom
joel.marcotte/aurora-role-tag

Conversation

@joelmarcotte

@joelmarcotte joelmarcotte commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds aurora_role:writer|reader to metrics, checks, and DBM metadata emitted by the PostgreSQL integration when the database is Aurora.

The check derives the Aurora role from the existing replication_role query, preserves replication_role:master|standby, and replaces both dynamic tags after a failover. No additional database query is introduced.

Validation:

  • ddev validate config -s postgres
  • ddev validate models -s postgres
  • Focused role-tag unit tests across the configured PostgreSQL test matrix
  • ddev test --lint postgres

The Docker-backed replication tests could not run locally because an existing SSH tunnel owns 127.0.0.1:5432.

Motivation

SDBM-2870 requests Aurora's writer/reader terminology. Changing the existing PostgreSQL replication_role:master|standby values would break existing queries and dashboards, so this adds a separate Aurora-specific tag.

This tag applies to PostgreSQL integration telemetry. It does not add the tag to independently collected aws.rds.* metrics.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add qa/required if this PR needs QA validation, or qa/skip-qa if it does not. Exactly one of the two is required.
  • 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

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 18, 2026

Copy link
Copy Markdown

evalya-impact-summary

evalya impact analysis
Impact analysis: 0 selected, 0 skipped (of 0 test tasks)
Publish tasks:   1 (always emitted)
Diff (5 files):
  postgres/assets/configuration/spec.yaml
  postgres/changelog.d/24901.added
  postgres/datadog_checks/postgres/postgres.py
  postgres/tests/common.py
  postgres/tests/test_pg_integration.py

Debug a specific task: evalya plan impact --path <path> --task <task>

Learn more about CI impact filtering

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e238135e53

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread postgres/datadog_checks/postgres/postgres.py
Comment thread postgres/tests/test_unit.py Outdated
eric-weaver
eric-weaver previously approved these changes Aug 18, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 18, 2026

Copy link
Copy Markdown

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 94.20% (+5.62%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 48aef29 | Docs | View more details | Give us feedback!

@temporal-github-worker-1
temporal-github-worker-1 Bot dismissed eric-weaver’s stale review August 18, 2026 18:08

Review from eric-weaver is dismissed. Related teams and files:

  • database-monitoring-agent
    • postgres/datadog_checks/postgres/postgres.py
    • postgres/tests/test_pg_integration.py
@dd-octo-sts

dd-octo-sts Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Validation Report

All 21 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and code coverage settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
qa-label Validate the pull request declares whether it needs QA for the next Agent release
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

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.

2 participants