Database monitoring with Datadog
======================================
`Database Monitoring with Datadog `_ enables you to capture key metrics on the Datadog platform for any Aiven for PostgreSQL® service with :doc:`Datadog Metrics ` integration.
Datadog Database Monitoring allows you to view query metrics and explain plans in a single place, with the ability to drill into precise execution details, along with query and host metrics correlation.
Prerequisites
-------------
To use Datadog Database Monitoring with your Aiven for PostgreSQL® services, you must perform the following steps:
* Apply any outstanding maintenance updates mentioning the Datadog integration.
* Ensure the :doc:`Datadog Metrics integration ` is enabled.
* The :doc:`PostgreSQL extensions ` - ``pg_stat_statements`` and ``aiven_extras``, must be enabled by executing the following `CREATE EXTENSION `_ SQL commands directly on the Aiven for PostgreSQL® database service.
.. code::
CREATE EXTENSION pg_stat_statements;
CREATE EXTENSION aiven_extras;
Enable monitoring
-----------------
You can individually enable Datadog Database Monitoring for the specific :doc:`Datadog Metrics ` integration for Aiven for PostgreSQL®, by configuring the ``datadog_dbm_enabled`` parameter. Repeat this action for every Datadog Metrics integration for Aiven for PostgreSQL®, which you plan to monitor.
Using the ``avn service integration-list`` :ref:`Aiven CLI command `, you can obtain the Datadog Metric integration you want to monitor and enable the Datadog Database monitoring functionality by using the ``datadog_dbm_enabled`` configuration parameter. For example:
* Find the UUID of the Datadog Metrics integration for a particular service:
.. code::
avn service integration-list --project
* Enable the Datadog Database Monitoring for the Datadog Metrics integration with the following command, substituting the ```` with the integration UUID retrieved at the previous step:
.. code::
avn service integration-update --project --user-config '{"datadog_dbm_enabled": true}'
* Check if user-config ``datadog_dbm_enabled`` set correctly:
.. code::
avn service integration-list \
--project \
--json | jq '.[] | select(.integration_type=="datadog").user_config'
``datadog_dbm_enabled`` should be set to ``true``:
.. code::
{
"datadog_dbm_enabled": true
}
Executing the steps successfully results in enabling Datadog Database Monitoring for your service.
.. seealso::
- Learn more about :doc:`Datadog and Aiven `.
- Learn more about `Datadog Deep Database Monitoring `_ from their product page.