DEV Community

Furkan Erday
Furkan Erday

Posted on Fully Autonomous

Send your OpenTelemetry Collector data to LogBrew and let your AI agent read it

If you already run the OpenTelemetry Collector, you don't need another SDK to try a new backend. You add one exporter. This post shows the exact config for LogBrew, what happens to your logs, spans, and metrics when they land, and how to let any AI agent read the same data while you fix a bug.

I build LogBrew, so take the product parts with that in mind. The config below works with any OTLP/HTTP backend if you swap the endpoint and the header.

The exporter

LogBrew takes OTLP over HTTP at https://api.logbrew.co. The exporter adds /v1/logs, /v1/traces, and /v1/metrics for you.

exporters:
  otlphttp/logbrew:
    endpoint: https://api.logbrew.co
    compression: gzip
    headers:
      x-logbrew-key: ${env:LOGBREW_INGEST_KEY}

service:
  pipelines:
    logs:
      receivers: [otlp]
      exporters: [otlphttp/logbrew]
    traces:
      receivers: [otlp]
      exporters: [otlphttp/logbrew]
    metrics:
      receivers: [otlp]
      exporters: [otlphttp/logbrew]
Enter fullscreen mode Exit fullscreen mode

Use a server ingest key and keep it in your secret store. If your pipelines already export somewhere else, add otlphttp/logbrew next to the existing exporter and both get the same data.

No Collector? An OpenTelemetry SDK reads the standard variables:

export OTEL_EXPORTER_OTLP_ENDPOINT="https://api.logbrew.co"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"
export OTEL_EXPORTER_OTLP_COMPRESSION="gzip"
export OTEL_EXPORTER_OTLP_HEADERS="x-logbrew-key=${LOGBREW_INGEST_KEY}"
export OTEL_SERVICE_NAME="checkout-api"
export OTEL_RESOURCE_ATTRIBUTES="service.version=checkout@1.4.2,deployment.environment.name=production"
Enter fullscreen mode Exit fullscreen mode

Set three resource attributes

Most of the value comes from three attributes you probably already set.

Attribute Becomes If missing
service.name Service unknown_service
service.version Release unversioned
deployment.environment.name Environment production

service.version is the one people skip. Set it, and a new error shows up against the release that introduced it, which is usually the first thing you want to know.

What happens to each signal

A log record becomes a log, and its severity sets the level. A span lands in its trace. Logs and spans keep their trace and span IDs, so a log shows up inside the trace it belongs to.

Errors are the useful part. An exception event on a span becomes an issue, and so does a log record with exception.type or exception.message. LogBrew groups repeats of the same error into one issue and links it to the trace, the logs around it, the release, and the users it hit. You don't change your instrumentation for this. Most OpenTelemetry instrumentation already records exceptions as span events.

Metrics map the way you'd expect. Gauges stay gauges, monotonic sums become counters, and histograms and summaries become a .count and a .sum counter.

Credentials get scrubbed on the way in

Attribute values whose keys look like credentials (authorization, cookie, password, api_key, anything ending in token) are replaced with [redacted] before storage. So are the user and password in a URL and query values like token, code, and signature. It's a safety net. You still shouldn't send secrets on purpose.

Let your AI agent read it

This is the reason I wanted the data in one place. LogBrew runs a hosted MCP server, so an agent can search issues, pull the trace for a failing request, and read the logs around it without you pasting stack traces into chat.

In Claude Code:

claude mcp add --transport http logbrew https://mcp.logbrew.co/mcp
claude mcp login logbrew
Enter fullscreen mode Exit fullscreen mode

The browser opens, you pick which projects the agent can read, and it stays read-only unless you also allow changes. Cursor, VS Code with Copilot, Codex, and Gemini CLI connect to the same URL.

Then ask something like "what's the newest issue in checkout-api since release 1.4.2, and what does its trace show?" The agent reads the issue, the span with the exception, and the logs from the same trace, and starts from there.

Limits worth knowing

A request can be up to 4 MiB after decompression and up to 16,384 records. If you hit a rate limit you get a 429 with Retry-After, and the Collector retries on its own. If some records are rejected, the response says how many and why.

Trying it

There's a generous free tier, no card needed: 100k errors and 50 GB of logs a month, 30-day retention, and all core features on every plan. The full OTLP reference is at https://docs.logbrew.co/guides/opentelemetry and the MCP setup for each client is at https://docs.logbrew.co/guides/mcp.

If you try it with your Collector, I'd like to hear what broke or what was confusing.

Top comments (0)