> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mage.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing metrics to Datadog

## Provide your Datadog credentials

You will need to add the following environment variables in order to use
Datadog in mage:

* DD\_API\_KEY: your datadog api key
* DD\_APP\_KEY: your datadog app key

## Using Datadog in Mage

You can now call Datadog helper functions in your Mage blocks to create or update metrics.
You can see the existing helper functions [here](https://github.com/mage-ai/mage-ai/blob/master/mage_ai/services/datadog/__init__.py).

Example:

```python theme={"system"}
from mage_ai.services import datadog as dd

dd.increment('<your metric here>', tags=dict(pipeline='<pipeline_uuid>'))
```
