Dave Stanton PhD

Watchtower: Building a Better OTel Collector for AI-Powered Observability

2026-02-05

Your OTel Collectors Are Dumb Pipes

Most organizations running OpenTelemetry in production have the same basic setup: OTel collectors receive telemetry from instrumented services and forward it to a proprietary observability platform. The collector is a passthrough — it batches, maybe enriches with a few resource attributes, and ships everything to a single destination.

This works fine for the workflow it was designed for: humans querying dashboards, investigating incidents, and setting up alerts through a vendor UI. But it means all your telemetry is locked behind that vendor’s API, their query language, their rate limits, and their pricing model.

When you want to do something new with that data — run an LLM against a sample of recent traces, correlate exceptions across services programmatically, or build an MCP server that lets an AI coding assistant ask questions about production behavior — you’re fighting the platform. You’re paying per query, waiting for API responses, and working within someone else’s abstraction.

The telemetry is yours. It’s already flowing through a collector you control. What if that collector was smarter?

Alloy as a Telemetry Router

Grafana Alloy is an OpenTelemetry-compatible collector that can fan out incoming telemetry to multiple destinations simultaneously. This is the key architectural property that makes the pattern work.

Instead of replacing your existing observability platform, you deploy Alloy as your OTel collector and configure it to dual-write: one pipeline sends everything to your current vendor (unchanged), and a second pipeline sends the same data — or a sampled subset — to a Grafana LGTM stack that you control completely.

Dual-write architecture: Services send OTLP to Alloy, which forks to both the existing vendor platform and the LGTM stack

The LGTM stack gives you Tempo for traces, Loki for logs, Mimir for metrics, and Grafana for visualization. But the real value isn’t the dashboards — it’s that these backends expose open, well-documented APIs that are fast, free to query, and designed for programmatic access.

Your existing platform keeps doing exactly what it’s been doing. Nothing changes for the humans using it today. The LGTM stack is a parallel workspace for new workflows — especially AI-powered ones.

Why This Matters for Teams, Not Just Individuals

I built this pattern to solve a specific problem on my own team: we needed faster, cheaper access to telemetry for experimental analysis without risking the production observability pipeline. But the architecture is deliberately simple enough that any team with OTel collectors in production can adopt it.

There’s no custom code in the critical path. Alloy is a standard collector with a declarative config. The LGTM stack deploys via official Helm charts. The dual-write is a routing decision, not an application change. A team that’s already running OTel can have this working in a day — and the applications they’re instrumenting never know the difference.

That low barrier to entry matters. In my experience, the hardest part of adopting new observability tooling isn’t the technology — it’s convincing teams to change their workflow while production is running. The dual-write pattern sidesteps that entirely: nobody has to stop using the tools they know. The new stack runs alongside, proves its value, and earns adoption on its own merits.

The Dual-Write Pattern

The Alloy configuration is straightforward. The receiver accepts OTLP on standard ports and fans out to two independent batch processors, each with its own export pipeline:

// Receive OTLP from instrumented services (drop-in replacement for existing collectors)
otelcol.receiver.otlp "default" {
  grpc { endpoint = "0.0.0.0:4317" }
  http  { endpoint = "0.0.0.0:4318" }

  output {
    traces  = [otelcol.processor.batch.lgtm.input, otelcol.processor.batch.vendor.input]
    metrics = [otelcol.processor.batch.lgtm.input, otelcol.processor.batch.vendor.input]
    logs    = [otelcol.processor.batch.lgtm.input, otelcol.processor.batch.vendor.input]
  }
}

// Pipeline 1: LGTM stack (your new queryable layer)
otelcol.processor.batch "lgtm" {
  timeout = "5s"
  send_batch_size = 1000

  output {
    traces  = [otelcol.exporter.otlphttp.tempo.input]
    metrics = [otelcol.exporter.prometheusremotewrite.mimir.input]
    logs    = [otelcol.exporter.loki.lgtm.input]
  }
}

// Pipeline 2: Existing vendor (unchanged behavior)
otelcol.processor.batch "vendor" {
  timeout = "10s"
  send_batch_size = 2000

  output {
    traces  = [otelcol.exporter.otlphttp.vendor.input]
    metrics = [otelcol.exporter.otlphttp.vendor.input]
    logs    = [otelcol.exporter.otlphttp.vendor.input]
  }
}

The two pipelines are completely independent. If the LGTM stack goes down, the vendor pipeline is unaffected. If the vendor has an API outage, traces still land in Tempo. Alloy handles backpressure per-exporter, so one slow destination doesn’t block the other.

This is the property that makes the whole approach low-risk: you’re adding capability without touching the existing pipeline.

What This Unlocks

Once telemetry lands in an LGTM stack with open APIs, a set of workflows that were previously impractical become straightforward.

Exception triage with LLMs. Query Loki for the top exceptions in the last hour, group them by service and stack trace signature, and feed the results to an LLM for automated triage. The LLM can correlate exception spikes with recent deployments, classify severity, and draft incident summaries. Against a proprietary platform, this workflow burns API quota and hits rate limits. Against your own Loki instance, you can iterate as fast as your model can respond.

Incident correlation across services. Pull a trace from Tempo, extract all the service names and span durations, identify the slow path, and cross-reference with Mimir metrics for those services during the same time window. An AI agent can do this investigation in seconds — if it has low-latency programmatic access to the data.

MCP servers for AI coding assistants. Build an MCP (Model Context Protocol) server that wraps the Tempo, Loki, and Mimir APIs. Now an AI coding assistant can answer questions like “what’s the error rate for the checkout service?” or “show me the slowest traces from the last 30 minutes” and use the answers to inform development decisions. The observability stack becomes input to the development process, not just a monitoring tool.

AI-powered workflows: Exception triage, incident correlation, and MCP servers for coding assistants

Sampling and targeted analysis. You don’t have to dual-write all your telemetry. Alloy supports filtering and sampling in its processing pipeline. Send 100% to the vendor and 10% to the LGTM stack. Or filter to only traces with errors. Or only metrics from a specific service you’re investigating. The LGTM stack doesn’t need to be a complete mirror — it just needs enough data for the analysis you’re running right now. This makes the resource footprint manageable and the cost predictable.

Loose coupling with your vendor. This is a secondary benefit, but it compounds over time. By routing telemetry through Alloy rather than sending directly to a vendor’s proprietary collector, you’ve decoupled your instrumentation from your platform. Your applications emit standard OTLP. Alloy decides where it goes. If you ever need to evaluate a different platform, add a third pipeline — no changes to any application code, no re-instrumentation, no migration project. Just another export block in the Alloy config.

Running It in Kubernetes

The LGTM stack runs well in Kubernetes, and all the Grafana components publish official Helm charts. For a proof-of-concept, you can stand up the entire stack locally using kind (Kubernetes IN Docker) before deploying to your production K8s environment.

The Helm deployments are minimal configuration:

Component Helm Chart Role Key Config
Tempo grafana/tempo Trace storage and query Local filesystem for POC, S3 for production
Loki grafana/loki Log aggregation and query Single-binary mode locally, microservices in prod
Mimir grafana/mimir-distributed Metrics storage (Prometheus-compatible) Single replica locally, distributed in prod
Grafana grafana/grafana Dashboards and Explore UI Pre-provisioned datasources pointing at Tempo/Loki/Mimir
Alloy grafana/alloy Telemetry receiver, processor, and router ConfigMap-driven, swap configs without redeploying

The critical piece is the Grafana datasource configuration. Wire up cross-references between Tempo, Loki, and Mimir so that clicking a trace shows correlated logs, and clicking a log line with a trace ID jumps to the trace view. This correlation is what makes the stack feel like a unified platform rather than three separate tools:

datasources:
  - name: Tempo
    type: tempo
    url: http://tempo:3200
    jsonData:
      tracesToLogsV2:
        datasourceUid: loki
        filterByTraceID: true
      tracesToMetrics:
        datasourceUid: mimir
  - name: Loki
    type: loki
    url: http://loki:3100
    jsonData:
      derivedFields:
        - datasourceUid: tempo
          matcherRegex: '"trace_id":"(\w+)"'
          name: TraceID
  - name: Mimir
    type: prometheus
    url: http://mimir-query-frontend:8080/prometheus
    jsonData:
      exemplarTraceIdDestinations:
        - datasourceUid: tempo
          name: trace_id

For a local proof-of-concept, the entire stack runs with under 2GB of memory. The Helm values minimize resource requests and run everything in single-replica mode. When you move to production, the same charts scale up — Loki switches to microservices mode, Mimir distributes across multiple ingesters and queriers, and storage backends move from local filesystem to S3.

Proving It Out

I started by deploying the full stack in a local kind cluster with a synthetic telemetry generator simulating a multi-service application. This validates the pipeline end-to-end — traces with spans across services, structured logs with trace IDs, and Prometheus-format metrics — without touching any real infrastructure.

Once the local stack was healthy, I configured the dual-write: one pipeline to the LGTM stack, one to a test collector on our existing vendor platform. Data appeared in both within seconds. The fan-out worked exactly as expected, with no observable impact on either pipeline’s throughput or latency.

The step that made it real: a simple Python script querying the Tempo API for traces with error spans, pulling the correlated logs from Loki, and formatting the results for LLM analysis. That query — which would have cost API quota and taken seconds against the vendor — returned in milliseconds from the local stack. That’s the moment the architecture justifies itself.

Measuring Whether It’s Working

The pattern is only worth adopting if it produces measurable improvements. Here’s what to track:

Time-to-insight for incident investigation. How long does it take from “something is wrong” to “here’s what happened”? With AI agents querying the LGTM APIs directly, the hypothesis-generation phase of incident response should compress from minutes to seconds. Compare this against the same investigation workflow through your vendor’s UI.

Query cost reduction. Every query against the LGTM stack is free. If your team is running exploratory or iterative analysis — the kind where you refine a query five or six times before finding what you need — that’s volume you’re shifting off the vendor’s metered API. Track how much analysis moves to the LGTM stack over time.

New workflows enabled. Count the things you can do now that you couldn’t before: automated exception triage, MCP-powered developer queries, scheduled anomaly detection scripts. These weren’t impractical because of missing technology — they were impractical because the data access pattern didn’t support them. The LGTM stack removes that constraint.

Adoption velocity. If you’re rolling this out across teams, track how quickly new groups go from “interested” to “sending telemetry.” The dual-write pattern’s low barrier — no instrumentation changes, no risk to existing pipeline — should show up as faster adoption compared to traditional platform migrations.

A Low-Risk Path to Platform Flexibility

It’s worth being explicit about what this pattern is and isn’t. It’s not a migration plan. It’s not a commitment to replace anything. It’s an architectural choice that gives your team options.

Start with a lower environment. Point its OTel collectors at Alloy, dual-write to both your existing vendor and the LGTM stack, and run them side by side. Build a few dashboards. Run a few AI experiments against the data. See how the query experience compares.

If the LGTM stack proves its value, expand to more environments. If it doesn’t, tear it down — your applications never knew it was there, and your vendor pipeline was never at risk.

The progression looks something like this:

Stage What Changes Risk Level
Local POC Kind cluster on a laptop, synthetic data Zero — nothing touches production
Lower environment Alloy replaces OTel collectors in QA/staging, dual-write enabled Low — production is untouched
Expanded evaluation More environments, real AI workflows running against LGTM data Low — vendor pipeline still primary
Selective migration Shift specific workloads or teams to LGTM-primary Medium — requires confidence in the stack
Full adoption LGTM as primary, vendor reduced or eliminated Strategic decision based on data

Each stage produces data that informs the next decision. No big bang. No leap of faith.

Where This Goes Next

The dual-write pattern is the foundation. Once the LGTM stack is running alongside your existing platform, there are natural next steps that build on it:

Automated exception analysis. A scheduled job queries Loki for new exception patterns, clusters them, runs each cluster through an LLM for root cause hypothesis, and posts findings to Slack or a dashboard. This turns reactive incident response into proactive issue discovery — and it runs entirely against the LGTM stack with no vendor API costs.

AI-powered runbooks. Connect an MCP server to the LGTM APIs and give it access to your runbook documentation. When an alert fires, an AI agent pulls the relevant traces and metrics, compares them against the runbook’s diagnostic steps, and either suggests a resolution or executes the first few steps automatically.

Telemetry-informed development prioritization. Expose the LGTM APIs to development tools via MCP. AI coding assistants can answer “which service has the highest error rate?” or “what’s the p99 latency trend for this endpoint?” and use that context to prioritize what gets worked on next. The observability stack becomes an input to the development process, not just a post-deployment monitoring tool.

Canary analysis and progressive delivery. Use Mimir’s Prometheus-compatible API to build automated canary comparison logic. Compare metrics between canary and baseline deployments programmatically, with an AI layer that can interpret results with more nuance than threshold-based rules.

Cost optimization analysis. Query Mimir for resource utilization metrics across services, identify over-provisioned workloads, and generate right-sizing recommendations. The open API makes it straightforward to build custom analysis that goes deeper than what vendor-provided cost tools typically offer.

The Point

Your OTel collectors are already touching every byte of telemetry your services produce. Making them smarter — giving them a queryable destination that you control — doesn’t require rearchitecting anything. It’s an additive change: keep your existing platform, add a parallel stack, and unlock workflows that proprietary APIs make impractical.

The LGTM stack is one way to build that queryable layer. The specific tools matter less than the pattern: route your telemetry through a collector you control, fork it to a stack with open APIs, and build AI workflows against the fork.

The production observability platform keeps the lights on. The LGTM stack is where you experiment, iterate, and build the next generation of operational workflows.