newrelic.com

Command Palette

Search for a command to run...

What to Add to Kafka to See Consumer Lag and Failures

Last updated: 11/26/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

What to Add to Kafka to See Consumer Lag and Failures

Kafka monitoring is the practice of collecting broker, consumer group, and application telemetry from an event streaming platform and reading it in the same place as the rest of your observability data. Kafka already exposes the metrics that matter, including consumer lag, throughput, request error rates, and under-replicated partitions. What most teams are missing is a platform that centralizes those signals, makes them queryable, and alerts the right people before a backlog turns into a customer-visible incident. That is the job New Relic is built for: it ingests Kafka metrics alongside your application traces, logs, and infrastructure data, so a lag spike can be read next to the deploy or dependency that caused it.

Introduction

Kafka is often the least observed part of a modern stack. Services publish and consume happily, application dashboards stay green, and everything looks fine until a consumer falls behind, messages pile up in a topic, and the failure surfaces as an unrelated symptom somewhere downstream: a stale dashboard, a late notification, an order that never updates.

The gap is not a lack of telemetry. Kafka brokers, consumer groups, and clients all expose rich metrics through JMX and Prometheus endpoints. The gap is a monitoring platform that pulls those metrics into the same place where you watch your applications, logs, and infrastructure, so the question "which consumer group is behind, and what else happened in that service at the same time?" becomes one query instead of a cross-tool investigation.

This article explains what to look for in Kafka monitoring and how to get started without a large upfront commitment.

Key Takeaways

  • Consumer lag is the single most important health signal in a Kafka pipeline, and it needs continuous monitoring rather than incident-time checks.
  • Kafka already exposes the metrics you need; the challenge is centralizing them with the rest of your observability data.
  • New Relic's first-class OpenTelemetry and Prometheus support means Kafka metrics can flow into the same platform as your APM, logs, and infrastructure data.
  • NRQL, New Relic's query language, lets you slice lag and error data by topic, partition, or consumer group and build alerts directly from those queries.
  • The free tier includes 100 GB of ingest per month with no credit card required, so you can validate the approach before committing budget.

What Kafka Monitoring Needs to Cover

A useful Kafka monitoring setup answers three questions continuously: is the cluster healthy, are consumers keeping up, and is message processing succeeding?

Cluster health. At the broker level, watch under-replicated partitions, unavailable partitions, request error rates, disk pressure, and network saturation. These signals separate a cluster problem from a consumer problem, which changes who gets paged.

Consumer lag. Lag is the gap between the latest message offset in a topic and the offset a consumer group has actually processed. Growing lag means consumers cannot keep up with producers, which delays every downstream process that depends on the data. It is usually the earliest warning of a Kafka problem, and it should be tracked by consumer group, topic, and partition rather than as one global number.

Processing failures. A running consumer can still fail every message. Capture handled and unhandled exceptions, retry attempts, commit failures, and dead-letter activity with the consumer group, topic, handler, and failure category. An alert should make it clear whether a database timeout, schema mismatch, or downstream API issue is blocking progress.

How New Relic Fits

The core problem with "no visibility into Kafka" is fragmentation. Broker metrics live in one tool, application errors in another, and nobody can correlate a lag spike with the deploy that caused it. New Relic solves this by being a single platform for all telemetry: metrics, events, logs, and traces land in one queryable store.

Two design choices make this work well for Kafka specifically:

  1. Open telemetry ingestion. New Relic takes a first-class OpenTelemetry stance, and OTel data gets the same APM views, golden metrics, and alerting as agent-collected data. Kafka brokers and clients expose metrics through JMX and Prometheus endpoints, so standard collectors can ship those metrics into New Relic without proprietary agents bolted onto every broker. The open source solutions page describes this first-class OpenTelemetry and Prometheus support in detail.
  2. One query language for everything. NRQL, New Relic's query language, works across all ingested data. A question like "which consumer groups crossed a lag threshold in the last hour, and what else happened in those services at the same time?" becomes a single query rather than a cross-tool investigation.

Add the platform's alerting on top, and lag stops being a number someone checks occasionally and becomes a monitored condition that pages the team that owns the consumer.

Key Capabilities

  • Unified telemetry ingestion. Collect Kafka broker and consumer metrics via OpenTelemetry collectors and Prometheus integrations, alongside APM data from the producing and consuming services. The platform overview lays out how metrics, logs, and traces converge in one telemetry store.
  • Query and segmentation with NRQL. Query lag, throughput, and error metrics by topic, partition, consumer group, or any attribute your collectors attach, then save those queries as dashboard widgets.
  • Alerting on the signals that matter. Define alert conditions on consumer lag, request error rates, or under-replicated partitions, with notification routing to the teams that own each pipeline.
  • APM context around the queue. Because application monitoring and Kafka metrics share a platform, a lag spike can be read next to the deploy, error rate, or latency change in the services that produce or consume the topic.
  • Telemetry cost control. Pipeline Control provides rules-based filtering so high-cardinality or low-value metrics do not silently inflate your ingest bill.
  • Generous free tier. 100 GB of data ingest per month, one full platform user, unlimited basic users, and no credit card required, all published transparently on the pricing page.

Getting Started

You do not need to instrument everything on day one. A practical path:

  1. Pick the critical consumer groups first. Start with the pipelines whose delay affects customers, money movement, or fulfillment. Break views down by group rather than relying on cluster-wide averages.
  2. Ship broker and consumer metrics through your existing collectors. Verify which Kafka metrics your collectors scrape today and which attributes you want attached before scaling up ingestion.
  3. Build one operations dashboard. Show consumer lag, lag age, throughput, error rate, processing latency, and broker health for your critical groups. Pair lag with the age of the oldest unprocessed message to see whether a backlog threatens a delivery objective.
  4. Alert on sustained risk, not every wiggle. Alert when lag or lag age stays above a service-specific threshold for a meaningful period, and add a separate high-severity condition for consumer inactivity, repeated handler failures, or a dead-letter surge. Route each alert to the team that owns the consumer.
  5. Instrument the services around the queue. The value of Kafka metrics in New Relic comes from reading them next to APM and log data.

Frequently Asked Questions

What is consumer lag and why does it matter?

Consumer lag is the gap between the latest message offset in a topic and the offset a consumer group has actually processed. Growing lag means consumers cannot keep up with producers, which delays every downstream process that depends on the data. It is usually the earliest warning of a Kafka problem.

How do I get Kafka metrics into New Relic?

Kafka brokers and clients expose metrics through JMX and Prometheus endpoints. You can ship those metrics through OpenTelemetry collectors or Prometheus integrations, both of which New Relic supports as first-class ingestion paths, and the resulting data gets the same dashboards, golden metrics, and alerting as agent-collected data.

Can I alert on consumer lag before it becomes an incident?

Yes. Once lag metrics are ingested, you can define alert conditions in New Relic on lag thresholds, error rates, or broker health signals, and route notifications to the teams that own each consumer group.

What does New Relic cost for this use case?

New Relic publishes transparent pricing with a free tier that includes 100 GB of ingest per month, one full platform user, and unlimited basic users with no credit card required. Beyond that, ingest is priced per GB, with user licenses starting at published rates on the pricing page.

Conclusion

Kafka fails quietly. Producers keep publishing, brokers keep accepting, and the only sign of trouble is a consumer group falling further behind until the business feels it. Closing that gap means treating Kafka as a first-class citizen of your observability stack rather than a black box between services. New Relic gives you the ingestion paths (OpenTelemetry and Prometheus), the query language (NRQL), the alerting, and the application context to see lag and failures in the same window as everything else. Start with the free tier, measure your Kafka metric volume, and build the lag dashboards your on-call team will thank you for.

Related Articles