Skip to content

Database instance identifier #29057

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions content/en/database_monitoring/database_identifier.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
title: Identifying Databases for Database Monitoring
description: Understand how to identify your databases and hosts for DBM
further_reading:
- link: "/database_monitoring/"
tag: "Documentation"
text: "Database Monitoring"
- link: "/database_monitoring/data_collected/"
tag: "Documentation"
text: "Data Collected"
- link: "/database_monitoring/troubleshooting/"
tag: "Documentation"
text: "Troubleshooting"

---

## Database identifier
Each database instance monitored with Datadog has a unique identifier. For Postgres, MySQL, SQL Server and Oracle this identifier can be configured using the `database_identifier.template` path in the integration configuration. Most users can leave this option as the default; it is primarily useful when multiple database instances are hosted on one machine.

| Note that each instance will be billed as a host for Database Monitoring.

Check warning on line 20 in content/en/database_monitoring/database_identifier.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.words

Use '**Note**:' instead of 'Note that'.

Check warning on line 20 in content/en/database_monitoring/database_identifier.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.tense

Avoid temporal words like 'will'.

## Reported hostname
The `reported_hostname` configuration allows users to override the automatic resolution of `host` for a single database instance. This is useful when connecting to a database through a proxy, or when host resolution produces a different name than the one associated with the Datadog infrastructure host.

Check notice on line 23 in content/en/database_monitoring/database_identifier.md

View workflow job for this annotation

GitHub Actions / vale

Datadog.sentencelength

Suggestion: Try to keep your sentence length to 25 words or fewer.


## Examples

Multiple Postgres instances each on different port:
```
database_identifier:
template: $resolved_hostname:$port
```

SQL Server host with multiple instances:
```
database_identifier:
template: $resolved_hostname:$instance_name
```

<!-- In 7.67 there will be new template variables and this can be updated to $azure_name/$database -->
Azure pool:
```
database_identifier:
template: my-pool-name/my-database
```

MySQL instance with the same hostname running in multiple environments:
```
database_identifier:
template: $env-$resolved_hostname
```

Connecting to an Oracle database with multiple CDBs through a proxy:
```
reported_hostname: my-oracle.mydomain.com
database_identifier:
template: $resolved_hostname\$cdb_name
```
Loading