# Send logs and metrics to your own tools

> Add a destination for Datadog, Grafana Cloud, Honeycomb or any OTLP endpoint, and check it with a test record

> Nevia is in early access for selected teams. The CLI installs with `curl -fsSL https://get.nevia.cloud | sh`, and the MCP server is at https://api.nevia.cloud/mcp. A person signs in once in the browser.
> Setup, sign-in and requesting access: [SKILL.md](https://nevia.cloud/SKILL.md). When Nevia fits and when it doesn't: [why.md](https://nevia.cloud/why.md).

> For the complete documentation index, see [llms.txt](https://nevia.cloud/llms.txt). This page's HTML version: https://nevia.cloud/docs/observability/destinations

A destination is an OTLP/HTTP endpoint that receives your workspace's logs and
metrics, such as Grafana Cloud, Honeycomb or your own collector. Add one, and
Nevia sends it a test record for logs and one for metrics so you can see it
works.

> **Continuous export is coming soon**
>
> Nevia does not send logs and metrics to destinations on an ongoing basis yet.
> You can add destinations now and check each with its test records. Until
> export starts, a destination's status reads **Waiting**.

You need the `editor` or `admin` role in the workspace to add, change or
delete a destination, and any role to list them. A workspace has at most 10.
The examples use the [CLI](https://nevia.cloud/docs/get-started/install-cli.md).

## Add a destination

Keep the vendor's key in a file and pipe it in, so it never appears in your
shell history or in `ps`:

```bash
nevia destinations create --preset honeycomb --region eu --api-key-file - < key.txt
```

The CLI prints the destination and how each test record went, such as
`delivered`. The destination is saved whatever the endpoint answered, so if a
test record fails you can fix the key or endpoint with
`nevia destinations set` and read the new result.

Header values, such as the key, are write-only. No command, tool or API
response returns them, and they go only to the endpoint they were given for.

By default a destination gets both logs and metrics for every resource in the
workspace. To narrow it, pass `--signal logs` or `--signal metrics`, and
`--project` once per project.

## Presets

A preset knows a vendor's endpoint and which header the key goes in.

| Preset          | You give                                                                                                      | Example                                                                                                                                                              |
| --------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `datadog`       | `--region` `us1` (default), `us3`, `us5`, `eu1`, `ap1`, `ap2` or `uk1`, and an API key                        | `nevia destinations create --preset datadog --region eu1 --api-key-file - < key.txt`                                                                                 |
| `dynatrace`     | Your environment's OTLP endpoint and an access token with the `logs.ingest` and `metrics.ingest` scopes       | `nevia destinations create --preset dynatrace --endpoint https://abc12345.live.dynatrace.com/api/v2/otlp --api-key-file - < token.txt`                               |
| `elastic`       | Your project's managed OTLP endpoint, from its OpenTelemetry setup page, and an API key that may write events | `nevia destinations create --preset elastic --endpoint <endpoint> --api-key-file - < key.txt`                                                                        |
| `grafana_cloud` | Your stack's OTLP gateway, the instance ID shown beside it, and an access policy token                        | `nevia destinations create --preset grafana_cloud --endpoint https://otlp-gateway-prod-eu-west-2.grafana.net/otlp --instance-id 123456 --api-key-file - < token.txt` |
| `honeycomb`     | `--region` `us` (default) or `eu`, and an ingest key                                                          | `nevia destinations create --preset honeycomb --region eu --api-key-file - < key.txt`                                                                                |
| `new_relic`     | `--region` `us` (default) or `eu`, and a license key                                                          | `nevia destinations create --preset new_relic --region us --api-key-file - < key.txt`                                                                                |

Datadog and Dynatrace accept only delta counters, so Nevia sends their
counters as the change since the previous point. The other presets get
counters as they are stored.

## Use any OTLP endpoint

For a collector or a vendor without a preset, give the base URL and a file of
`Name: value` header lines:

```bash
printf 'x-api-key: %s\n' "$COLLECTOR_KEY" > headers.txt
nevia destinations create --endpoint https://otel.example.com --headers-file headers.txt
```

Logs go to `<endpoint>/v1/logs` and metrics to `<endpoint>/v1/metrics`. The
endpoint must use HTTPS and resolve to a public address. Leave out
`--headers-file` for an endpoint that needs no headers.

## Find the test records

In your tool, look for a resource with `service.name` set to `nevia`. The log
record's body is `Nevia test record`, and the metric is the gauge
`nevia.destination.test` with the value 1. Both carry `nevia.workspace.id` and
`nevia.destination.id`.

If a test record failed, its code says why:

| Code                                     | What to check                                                                   |
| ---------------------------------------- | ------------------------------------------------------------------------------- |
| `unauthorized`                           | The key or token, and that it may write OTLP data                               |
| `not_found`                              | The endpoint. Nothing answers OTLP at that path                                 |
| `unreachable`                            | The endpoint's host name                                                        |
| `tls_failed`                             | The endpoint's TLS certificate                                                  |
| `address_not_allowed`                    | The endpoint resolves to a private address, which destinations may not use      |
| `rate_limited`, `unavailable`, `timeout` | The vendor's status, then save the destination again to resend the test records |

## Change or remove a destination

```bash
nevia destinations ls
nevia destinations set <id> --signal logs --api-key-file - < key.txt
nevia destinations rm <id>
```

Because keys are never read back, a change to a destination with headers
gives them again: `--api-key-file` for a preset, with `--instance-id` for
`grafana_cloud`, or `--headers-file` for a custom endpoint. Saving sends the
test records again. `rm` stops the destination and deletes its stored headers.
The [`nevia destinations` reference](https://nevia.cloud/docs/reference/cli/destinations.md) has
every flag.

## In the console

Open **Observability** › **Destinations** and choose **Add destination**. Pick
a vendor or a custom endpoint, fill in the region or endpoint and the key, and
save. The dialog shows how the test record for logs and for metrics went. The
list shows each destination's status, and a last delivery time once export
starts.

## Ask an agent

Over [MCP](https://nevia.cloud/docs/get-started/mcp.md), an agent manages destinations with
`create_destination`, `list_destinations`, `get_destination`,
`update_destination` and `delete_destination`. The key travels in the tool
call, so add the destination from the CLI or the console if you would rather
keep the key out of the agent's context. See the
[MCP reference](https://nevia.cloud/docs/reference/mcp.md#logs-metrics-and-destinations) and
[`POST /v1/destinations`](https://nevia.cloud/docs/reference/api/observability/createDestination.md).
