# Export logs to Datadog
source: https://docs.chalk.ai/docs/datadog-telemetry-export

## Connect your Datadog account, enable Chalk log export, and verify that your logs arrive.

Follow this guide to send Chalk logs to your Datadog account. When you finish, you will be able to
find a test message from a Chalk resolver in Datadog Log Explorer.

### Before you start

You need:

- Metrics Export enabled for your Chalk team
- Permission to edit telemetry settings in Chalk
- A Datadog API key and the Datadog site for your account, such as datadoghq.com or datadoghq.eu
- Access to Datadog Log Explorer

If Exporters is missing from your telemetry settings, contact Chalk support to enable access.

### 1. Prepare your Datadog API key

Store your Datadog API key in AWS Secrets Manager in the AWS account and region used by Chalk.
Use the raw API key as the secret value, without JSON or surrounding quotation marks. Copy the
secret's full ARN, for example:

```
arn:aws:secretsmanager:us-east-1:123456789012:secret:datadog-api-key-AbCdEf
```

Chalk needs permission to read this secret. If you need help storing the key or granting access,
ask your cloud administrator or Chalk support. Have the ARN ready for the next step.

### 2. Enable log export in Chalk

- Open Cloud Clusters, select your cluster's Telemetry tab,
and open its telemetry configuration.
- In the guided form, select Vector under Telemetry Runtime. Open
Exporters → Export to Datadog.
- Set API Key Lookup Type to ARN and paste the ARN into API Key Secret ARN.
- Set API Host to your Datadog site. The default is datadoghq.com; use datadoghq.eu for an
EU account, for example. Enter only the hostname, without https:// or an API path.
- Turn on Export Logs to Datadog. For a new logs-only setup, leave Export Metrics to Datadog
and Export Traces to Datadog off. Preserve any exports you already use.
- Leave the optional VRL fields empty for initial setup. Save, review the changes, and confirm
the update. Wait for the dashboard to confirm that the update succeeded.

Leave Telemetry enabled. New logs are sent automatically; historical logs are not replayed.

### 3. Send a test log

- Add the following import to an existing Python resolver file and the log call inside a resolver
you can query. Replace chalk-datadog-check-001 with a unique message for this test.

```
from chalk.clogging import chalk_logger

# Inside your resolver:
chalk_logger.info("chalk-datadog-check-001")
```

- Deploy the updated resolver to the environment whose telemetry you
configured. Run a query that executes the resolver.
- Find the exact message in the Chalk dashboard's logs for that environment. If it is absent,
confirm that the query used the updated deployment and executed the resolver rather than reading
its result from cache.

### 4. Find the log in Datadog

Open Logs → Explorer in your Datadog account. Select a time range covering the test, clear
unrelated filters, and search for your exact message in quotation marks:

```
"chalk-datadog-check-001"
```

Allow time for delivery and ingestion. Open the matching log and confirm that its message and time
match the test you ran.

The export is working when the same message appears in Chalk and Datadog. You can then remove
the test log call from your resolver.

### If the log does not arrive

If you can see the test message in Chalk but not in Datadog:

- Confirm Export Logs to Datadog and Telemetry are enabled and your settings were saved.
- Confirm API Host matches the Datadog account where you are searching.
- Check that you supplied an API key for that account and stored it as a raw string.
- Check your Datadog time range, search filters, and log indexing or exclusion rules.

If the message still does not arrive, send Chalk support your Chalk environment, Datadog site,
test message, query ID, and the time of the test. Do not include your API key in the support message.

### Optional: customize exported events

After verifying delivery, use Vector Remap Language (VRL)
to change events before export. Under Exporters → Shared VRL, remaps apply to every export
destination for the corresponding signal. Under Export to Datadog → VRL, remaps apply only to
Datadog, after the shared remaps. Save and confirm your changes, then repeat the test above.

To send metrics to another monitoring service, follow
Export metrics to Prometheus or
Export metrics over OTLP.

For independent log or trace delivery to an OTLP/HTTP destination, follow
Export telemetry over OTLP. Datadog and OTLP exports can run together;
each destination has its own credentials and exporter-specific remaps.





