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

feat(autodiscovery): support extra_dbname when templating a database instance #31138

Merged
merged 15 commits into from
Dec 20, 2024

Conversation

wparr-circle
Copy link
Contributor

What does this PR do?

Adds support for templating extra_dbname into a database template for the AWS Aurora auto discovery feature. This will allow users with a non-standard dbname set to automatically discover the primary database named in the Aurora instances.

Fixes #31123

Motivation

Non standardised dbname configuration in our organisations cloud real estate, where we follow neither a practice of using the default postgres db nor a standardised alternative such as app - which is the only hurdle we see in enabling autodiscovery.

Describe how to test/QA your changes

Instance template configured with a database name, using the templated extra_dbname variable.

dbname: %%extra_dbname%%

it would be best to test this against an aurora instance configured with a name which is not postgres, to avoid defaults.

Possible Drawbacks / Trade-offs

Additional Notes

@wparr-circle wparr-circle requested review from a team as code owners November 15, 2024 15:54
@bits-bot
Copy link
Collaborator

bits-bot commented Nov 15, 2024

CLA assistant check
All committers have signed the CLA.

@wparr-circle wparr-circle requested a review from a team as a code owner December 9, 2024 07:39
@lu-zhengda lu-zhengda added this to the 7.62.0 milestone Dec 18, 2024
@lu-zhengda lu-zhengda added the qa/rc-required Only for a PR that requires validation on the Release Candidate label Dec 18, 2024
@lu-zhengda lu-zhengda added qa/done QA done before merge and regressions are covered by tests and removed qa/rc-required Only for a PR that requires validation on the Release Candidate labels Dec 19, 2024
@lu-zhengda
Copy link
Contributor

lu-zhengda commented Dec 19, 2024

Tested in staging with %%extra_dbname%%.
The testing cluster uses mydb instead of the default postgres dbname.
image
Postgres integration config receives dbname: "%%extra_dbname%%" from autodiscovery.

ad_identifiers:
  - _dbm_postgres_aurora
init_config:
instances:
  - host: "%%host%%"
    port: "%%port%%"
    username: datadog
    dbname: "%%extra_dbname%%"
    dbm: true
    aws:
      instance_endpoint: "%%host%%"
      region: "%%extra_region%%"
    tags:
      - "dbclusteridentifier:%%extra_dbclusteridentifier%%"
      - "region:%%extra_region%%"

The database is instrumented successfully in DBM
image

@lu-zhengda lu-zhengda added the short review PR is simple enough to be reviewed quickly label Dec 19, 2024
@lu-zhengda
Copy link
Contributor

/merge

@dd-devflow
Copy link

dd-devflow bot commented Dec 19, 2024

Devflow running: /merge

View all feedbacks in Devflow UI.


2024-12-19 18:51:43 UTC ℹ️ MergeQueue: waiting for PR to be ready

This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2024-12-19 22:51:45 UTC ⚠️ MergeQueue: This merge request was unqueued

[email protected] unqueued this merge request: It did not become mergeable within the expected time

@lu-zhengda
Copy link
Contributor

/merge

@dd-devflow
Copy link

dd-devflow bot commented Dec 20, 2024

Devflow running: /merge

View all feedbacks in Devflow UI.


2024-12-20 18:09:56 UTC ℹ️ MergeQueue: pull request added to the queue

The median merge time in main is 34m.


2024-12-20 19:02:30 UTC ℹ️ MergeQueue: This merge request was merged

@dd-mergequeue dd-mergequeue bot merged commit d2c4983 into DataDog:main Dec 20, 2024
931 of 944 checks passed
louis-cqrl pushed a commit that referenced this pull request Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community qa/done QA done before merge and regressions are covered by tests short review PR is simple enough to be reviewed quickly team/database-monitoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aurora Discovery should support discovering the default database
5 participants