---
title: "OTLP"
description: "Send Blyp logs to named OTLP-compatible targets such as Grafana Cloud, Datadog, Honeycomb, or your own collector."
canonical_url: "https://www.blyp.dev/docs/connectors/otlp"
markdown_url: "https://www.blyp.dev/docs/connectors/otlp.md"
last_updated: "2018-10-20"
x_farming_labs_generated_preamble: true
agent:
  task: "Export Blyp logs to one or more named OTLP HTTP targets."
  outcome: "A test record reaches the selected collector with Blyp resource and log attributes."
  appliesTo:
    package:
      - "@blyp/core"
      - "@opentelemetry/sdk-logs"
  prerequisites:
    - "An OTLP HTTP logs endpoint and required authentication headers are available."
  files:
    - "blyp.config.ts"
    - ".env"
  commands:
    - "pnpm add @blyp/core @opentelemetry/api-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources @opentelemetry/sdk-logs"
  sideEffects:
    - "Selected logs are exported to external collectors."
  verification:
    - "Emit and flush a unique record"
    - "then query the configured OTLP backend for it."
  rollback:
    - "Set connectors.otlp to false or remove the affected named target."
  failureModes:
    - symptom: "The collector returns 404 or unsupported media type."
      resolution: "Use the OTLP HTTP logs endpoint rather than a traces endpoint and retain the exporter content type."
---

# OTLP
URL: /docs/connectors/otlp
LLM index: /llms.txt
Description: Send Blyp logs to named OTLP-compatible targets such as Grafana Cloud, Datadog, Honeycomb, or your own collector.
Related: /docs/connectors, /docs/configuration, /docs/working-with-blyp/production

<!-- farming-labs:agent-contract:start -->
## Agent Contract

Task: Export Blyp logs to one or more named OTLP HTTP targets.
Outcome: A test record reaches the selected collector with Blyp resource and log attributes.

### Applies To

- Package: `@blyp/core`, `@opentelemetry/sdk-logs`

### Prerequisites

- An OTLP HTTP logs endpoint and required authentication headers are available.

### Files

- `blyp.config.ts`
- `.env`

### Commands

- `pnpm add @blyp/core @opentelemetry/api-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources @opentelemetry/sdk-logs`

### Side Effects

- Selected logs are exported to external collectors.

### Verification

- Emit and flush a unique record
- then query the configured OTLP backend for it.

### Rollback

- Set connectors.otlp to false or remove the affected named target.

### Failure Modes

- The collector returns 404 or unsupported media type. — Recovery: Use the OTLP HTTP logs endpoint rather than a traces endpoint and retain the exporter content type.
<!-- farming-labs:agent-contract:end -->

# OTLP

Install the OpenTelemetry log peers, configure a named OTLP HTTP logs endpoint and auth headers, then
emit a unique record and await flush. A 404 commonly means the URL points to traces or the collector
root instead of its logs endpoint. Remove only the failing named target to preserve other exports.

Use `connectors.otlp` when you want Blyp to forward logs to one or more OTLP-compatible backends.

Common targets include:

- Grafana Cloud
- Datadog
- Honeycomb
- a self-hosted OpenTelemetry Collector

## Install required peer packages

Install the optional peer dependencies when this connector is enabled:

```bash
bun add @opentelemetry/api-logs @opentelemetry/exporter-logs-otlp-http @opentelemetry/resources @opentelemetry/sdk-logs
```

## Config

OTLP connectors are configured as a named array:

```ts
export default {
  connectors: {
    otlp: [
      {
        name: "grafana",
        enabled: true,
        mode: "auto",
        endpoint: process.env.OTLP_HTTP_ENDPOINT,
        auth: process.env.OTLP_AUTH_HEADER,
        serviceName: "api",
      },
      {
        name: "honeycomb",
        enabled: true,
        mode: "manual",
        endpoint: process.env.HONEYCOMB_OTLP_ENDPOINT,
        headers: {
          "x-honeycomb-team": process.env.HONEYCOMB_API_KEY ?? "",
        },
      },
    ],
  },
};
```

## Config fields

- `name`: required identifier for the OTLP target
- `enabled`: enables the target
- `mode`: `auto` or `manual`
- `endpoint`: absolute OTLP HTTP logs endpoint
- `headers`: optional custom headers
- `auth`: convenience value for the `Authorization` header
- `serviceName`: defaults to `blyp-app`

## Automatic server forwarding

When a target is both enabled and ready and `mode: "auto"`, Blyp forwards normal server logs to that target automatically.

> Blyp forwards each log as an OTLP `LogRecord`, mapping the log message to the body, the Blyp level to `severityText`, and structured fields to OTLP attributes.

## Manual APIs

Manual OTLP APIs always target a named connector:

```ts
import {
  createOtlpLogger,
  createStructuredOtlpLogger,
} from "@blyp/core/otlp";

createOtlpLogger({
  name: "grafana",
}).info("manual otlp log");

const structured = createStructuredOtlpLogger(
  "checkout",
  { orderId: "ord_123" },
  { name: "grafana" }
);

structured.info("manual start");
structured.emit({ status: 200 });
```

## Browser and Expo forwarding

```ts
const browserLogger = createClientLogger({
  endpoint: "/inngest",
  connector: { type: "otlp", name: "grafana" },
});
```

```ts
const expoLogger = createExpoLogger({
  endpoint: "https://api.example.com/inngest",
  connector: { type: "otlp", name: "grafana" },
});
```

Browser and Expo still post to Blyp first. Blyp forwards to the named OTLP target only when that server connector is configured and ready.

## Notes

- `connectors.delivery` can make retryable OTLP forwarding failures durable without Redis or another external queue
- manual OTLP APIs always target a named connector
- Convex isolate export uses `@blyp/core/convex`. Pass a shared `blyp.config.ts` into `configureConvexLogger()` so auto `connectors.otlp` targets and native vendor connectors export from actions. See [Convex](/docs/integrations/convex).

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
