> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/reference-1/sql-commands/jobs/create-job/monitoring/datadog.md).

# Datadog

To export monitoring data from your Upsolver account, you must first create a connection that provides the appropriate credentials to access your Datadog account.

## Syntax

```sql
CREATE DATADOG CONNECTION <connection_identifier>
    API_KEY = '<api_key>'
    [ API_HOSTNAME = '<api_hostname>' ]
    [ COMMENT = '<comment>' ];
```

#### Jump to

* [`API_KEY`](#api_key)
* [`API_HOSTNAME`](#api_hostname)
* [`COMMENT`](#comment-editable)

## Connection Options

#### `API_KEY`

Type: `text`

The API key for your Datadog account.

#### `API_HOSTNAME`

Type: `text`

The API hostname for your Datadog account.

#### `COMMENT` — editable

Type: `text`

(Optional) A description or comment regarding this connection.

## Examples

### Create a connection

The following example creates a new connection named **my\_datadog\_connection** that will be used to send monitoring information to Datadog.

```sql
CREATE DATADOG CONNECTION my_datadog_connection
    API_KEY = 'my_api_key'
    API_HOSTNAME = 'app.datadoghq.eu'
    COMMENT = 'Datadog connection for Upsolver metrics';
```

### Create a job

The following script creates a job named **send\_monitoring\_data\_to\_datadog** that sends cluster metrics to the Datadog account **my\_datadog\_connection** created in the above example:

```sql
CREATE JOB send_monitoring_data_to_datadog 
    START_FROM = NOW 
AS INSERT INTO my_datadog_connection
    MAP_COLUMNS_BY_NAME
       SELECT utilization_percent AS utilization_percent,
              tasks_in_queue AS tasks_in_queue,
              memory_load_percent AS memory_load_percent,
              cluster_id AS tags.cluster_id,
              cluster_name AS tags.cluster_name,
              RUN_START_TIME() AS time
       FROM system.monitoring.clusters;
```

The job includes the **cluster\_id** and **cluster\_name** as tags, which is helpful if you have multiple clusters in your organization.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/reference-1/sql-commands/jobs/create-job/monitoring/datadog.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
