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

> ## Agent Instructions
> Install the Courier skill before writing code: `npx skills add trycourier/courier-skills`. It carries the verified SDK shapes and the rules you cannot get wrong.
> Authenticate every request with `Authorization: Bearer <API_KEY>`. A workspace has several environments and each has its own keys, which are plain `pk_` strings with no environment prefix. Start with Test.
> Send with `client.send.message` from the Node SDK (`@trycourier/courier` v7 and later, where the client is the default import). Reference a template by its `nt_` id or its alias.
> A send accepts a bare Elemental element list, but storing content on a template requires the top-level elements wrapped in a channel element.
> Templates and journeys can be built in the Courier app or created through the API. Either way they live in the workspace and are referenced by ID when you send.
> The hosted MCP server is https://mcp.courier.com. For a briefing on what Courier is and when to use it, read https://www.courier.com/llms.txt.
> Prefer the Guides tab for how-do-I questions and the Docs tab for how-does-it-behave questions. The API reference lives under /api-reference.

# Observability

> Send Courier delivery metrics and logs to Datadog, New Relic, or any OpenTelemetry endpoint.

export const Doc = ({href, children, name, bare}) => {
  const label = children || name || href;
  if (bare) {
    return <a href={href}>{label}</a>;
  }
  return <a className="cx-endpoint" data-kind="doc" href={href}>
      <span className="cx-endpoint-label">{label}</span>
      <span className="cx-endpoint-method">DOC</span>
    </a>;
};

Courier sends its delivery metrics and logs to the monitoring tool you already use. Notification failures show up next to the rest of your telemetry.

<Note>
  Observability integrations require the **Enterprise** plan. See [Courier pricing](https://www.courier.com/pricing).
</Note>

## Choose a destination

<CardGroup cols={3}>
  <Card title="Datadog" href="/docs/integrations/observability/datadog" icon="https://mintcdn.com/courier-4f1f25dc/Ia7FGvhsFU_5CtOa/assets/provider-datadog.svg?fit=max&auto=format&n=Ia7FGvhsFU_5CtOa&q=85&s=3e3ea11b6819730d20c8d83caddae462" width="24" height="24" data-path="assets/provider-datadog.svg">
    API key and site. Includes a ready-made dashboard.
  </Card>

  <Card title="New Relic" href="/docs/integrations/observability/new-relic" icon="https://mintcdn.com/courier-4f1f25dc/Ia7FGvhsFU_5CtOa/assets/provider-new-relic.svg?fit=max&auto=format&n=Ia7FGvhsFU_5CtOa&q=85&s=9be56998ffea6070f210320a73fd390b" width="24" height="24" data-path="assets/provider-new-relic.svg">
    License key, with optional metrics and logs endpoints.
  </Card>

  <Card title="OpenTelemetry" href="/docs/integrations/observability/open-telemetry" icon="https://mintcdn.com/courier-4f1f25dc/Ia7FGvhsFU_5CtOa/assets/provider-open-telemetry.svg?fit=max&auto=format&n=Ia7FGvhsFU_5CtOa&q=85&s=c495aa69914fdf1a047a98bb7ddd6a01" width="24" height="24" data-path="assets/provider-open-telemetry.svg">
    Any OTLP endpoint, with basic auth or a bearer token.
  </Card>
</CardGroup>

## Observability or webhooks

| Use                                                                | When                                                                                                                   |
| :----------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------- |
| **Observability**                                                  | You want charts, dashboards, and alerts on Courier's health, such as delivery rate by channel or undeliverable spikes. |
| **<Doc href="/docs/monitor/webhooks/outbound">Outbound webhooks</Doc>** | Your own code needs to act on each event, such as updating an order when its receipt is delivered.                     |

## What Courier sends

Courier aggregates metrics over a 10-second window and sends them as messages are sent, delivered, or marked undeliverable. Logs go to the same destination in near real time.

Metrics and logs are tagged with your Courier `environment`, `production` or `test`, so you can filter by it.

### Metrics

| Group                 | Metrics                                                                                                                                                                                                            |
| :-------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Messages**          | `courier.message.received`, `.sent`, `.delivered`, `.filtered`, `.throttled`, `.unmapped`, `.unroutable`, `.undeliverable`, `.unique.sent`, `.unique.opened`, `.unique.clicked`, `.total.opened`, `.total.clicked` |
| **Channels**          | `courier.[channel].sent`, `.delivered`, `.error`, `.undeliverable`, where `[channel]` is `email`, `sms`, `push`, `inbox`, `direct_message`, `webhook`, or `banner`                                                 |
| **Users**             | `courier.user.created`, `.updated`, `.deleted`                                                                                                                                                                     |
| **Accounts**          | `courier.account.created`, `.updated`, `.deleted`, `courier.account.user.added`, `.removed`                                                                                                                        |
| **Lists**             | `courier.list.subscribed`, `.unsubscribed`, `.subscribe.failed`                                                                                                                                                    |
| **Audiences**         | `courier.audience.matched`, `.unmatched`                                                                                                                                                                           |
| **Inbox connections** | `courier.inbox.connection_attempt`, `.connection_error`, `.notification_attempt`, `.reconnection_attempt`                                                                                                          |
| **Automations**       | `courier.automation.invoked`, `.throttled`, `.digest.triggered`, `.batch.triggered`, `.fetch-data-step.errored`                                                                                                    |

Slack, Microsoft Teams, and other chat providers report under `direct_message`. There's no `chat` channel.

Each destination's page lists anything specific to it, such as Datadog's extra metrics and tags.

## Limits & behavior

* **Datadog has no backfill.** Courier starts sending metrics when you activate the integration.
* **Metrics count status changes, not messages.** One message moves through several statuses, so metric totals don't match the number of messages in your logs.
* **Per environment.** Filter on the `environment` tag to separate Test from Production.

## FAQ

<AccordionGroup>
  <Accordion title="Which observability tools does Courier support?">
    Datadog, New Relic, and any platform that accepts OpenTelemetry over OTLP, such as Grafana Cloud or your own collector.
  </Accordion>

  <Accordion title="Why don't my metric counts match my message logs?">
    Courier emits a metric per status change. A message that's sent, delivered, and opened adds to three metrics, while it's one row in logs.
  </Accordion>
</AccordionGroup>
