8 Kafka Lag Metrics and HTTP Metrics

This topic provides information about Kafka lag and HTTP client metrics available for monitoring and troubleshooting EDP services.

Overview

plato-edp-services now exposes Prometheus-compatible metrics for:
  1. Kafka subscription lag per assigned topic partition.
  2. Outgoing HTTP calls made by EDP through RestTemplate.

These metrics are intended for operational dashboards, alerting, and faster issue isolation at subscription, API, and downstream dependency level.

Metric Mapping

Micrometer meter names are converted to Prometheus names automatically.

Table 8-1 Metro Mapping

Functional Area Micrometer meter Prometheus series Type
Kafka lag edp.kafka.subscription.partition.lag edp_kafka_subscription_partition_lag Gauge
Outgoing HTTP http.client.requests http_client_requests_seconds_* Timer

Kafka Lag Metric

Metric name

edp_kafka_subscription_partition_lag

Labels

Table 8-2 Labels

Labels Description
subscription_id EDP subscription id
consumer_name Subscriber consumer service name
topic Kafka topic name
partition Kafka partition number
Behaviour
  • One gauge is created per assigned subscription-topic-partition-consumer.
  • The gauge is initialized when Kafka partitions are assigned to the listener.
  • The gauge is updated after a successful Kafka acknowledgment commit.
  • The gauge is removed when partitions are revoked/lost or when the subscription listener is deleted.

Important interpretation note

This is a commit-driven lag gauge, not a continuously polled broker lag metric.

That means:
  • If a subscription is actively consuming and acknowledging, the metric tracks lag normally.
  • If a subscription is paused, idle, or repeatedly failing before acknowledgment, the last exposed lag value can remain unchanged until the next partition assignment or successful acknowledgment.

Users should treat this metric as EDP listener lag visibility, not as a broker-side real-time backlog scanner.

HTTP Metrics

Outgoing HTTP Requests

Outgoing calls made through EDP RestTemplate are exposed through client request timers.

Metric family

http_client_requests_seconds_count
http_client_requests_seconds_sum
http_client_requests_seconds_max

Common labels

Table 8-3 Common labels

Labels Description
method HTTP method
status HTTP response status
outcome High-level response outcome
client_name Downstream host or service name resolved by Micrometer

Usage note

uri is intentionally not published for outgoing client metrics in this release. EDP removes it to avoid high-cardinality series when URLs contain exploded path values or query parameters.

This means dashboards for outbound calls should group by client_name, method, status, or outcome, not by URI.