Monitor Shadowing

This feature requires an enterprise license. To get a trial license key or extend your trial period, generate a new trial license key. To purchase a license, contact Redpanda Sales.

If Redpanda has enterprise features enabled and it cannot find a valid license, restrictions apply.

Monitor your shadow links to ensure proper replication performance and understand your disaster recovery readiness. Use rpk commands, metrics, and status information to track shadow link health and troubleshoot issues.

If you’re running Redpanda in Kubernetes, see Monitor Kubernetes Shadow Links.

See Failover Runbook for immediate step-by-step disaster procedures.

Status commands

To list existing shadow links:

rpk shadow list

To view shadow link configuration details:

rpk shadow describe <shadow-link-name>

For detailed command options, see rpk shadow list and rpk shadow describe. This command shows the complete configuration of the shadow link, including connection settings, filters, and synchronization options.

To check your shadow link status and ensure proper operation:

rpk shadow status <shadow-link-name>
  • Shadow link state: Overall operational state:

    • ACTIVE: The link is replicating.

    • FAILING_OVER: A whole-link failover is running.

    • FAILED_OVER: A whole-link failover completed. This is the expected final state after a failover.

    • FAILOVER_FAULTED: A whole-link failover stopped because a phase missed its deadline. It needs attention.

    • During a whole-link failover, the status also shows the failover phase (FAILOVER PHASE), when the phase started (PHASE STARTED), and, if the failover faulted, the FAULT REASON. See Failover states.

  • Individual topic states: Current state of each replicated topic (ACTIVE, PAUSED, FAILING_OVER, FAILED_OVER, FAULTED, PROMOTING, PROMOTED).

  • Task status: Health of replication tasks across brokers (ACTIVE, PAUSED, FAULTED, NOT_RUNNING, LINK_UNAVAILABLE, FINISHED). FINISHED means a whole-link failover ended the task permanently. For details about shadow link tasks, see Shadow link tasks.

  • Failure reason: When a shadow link or one of its tasks reports a failed state, the Reason field explains why. Check this field first when a link is not replicating as expected.

  • Lag information: Replication lag per partition showing source vs shadow high watermarks (HWM).

  • Schema Registry sync status: For links that replicate schemas through the Schema Registry API, inventory counts for source and destination subjects, sync progress, and the most recent error. See Monitor replication status.

  • Role sync counts: For links that replicate RBAC roles, the Reason field of the Roles Migrator task reports the counts from the most recent sync cycle (roles created, updated, deleted, and failures). See Role filtering.

Shadowing provides comprehensive metrics to track replication performance and health with the public_metrics endpoint.

Metric Type Description

redpanda_shadow_link_shadow_lag

Gauge

The lag of the shadow partition against the source partition, calculated as source partition LSO (Last Stable Offset) minus shadow partition HWM (High Watermark). Monitor by shadow_link_name, topic, and partition to understand replication lag for each partition.

redpanda_shadow_link_total_bytes_fetched

Count

The total number of bytes fetched by a sharded replicator (bytes received by the client). Labeled by shadow_link_name and shard to track data transfer volume from the source cluster.

redpanda_shadow_link_total_bytes_written

Count

The total number of bytes written by a sharded replicator (bytes written to the write_at_offset_stm). Uses shadow_link_name and shard labels to monitor data written to the shadow cluster.

redpanda_shadow_link_client_errors

Count

The number of errors seen by the client. Track by shadow_link_name and shard to identify connection or protocol issues between clusters.

redpanda_shadow_link_shadow_topic_state

Gauge

Number of shadow topics in the respective states. Labeled by shadow_link_name and status to monitor topic state distribution across your shadow links.

redpanda_shadow_link_total_records_fetched

Count

The total number of records fetched by the sharded replicator (records received by the client). Monitor by shadow_link_name and shard to track message throughput from the source.

redpanda_shadow_link_total_records_written

Count

The total number of records written by a sharded replicator (records written to the write_at_offset_stm). Uses shadow_link_name and shard labels to monitor message throughput to the shadow cluster.

redpanda_shadow_link_state

Gauge

1 for the current state of the shadow link, 0 for the other states. Labeled by shadow_link_name and state (active, paused, failing_over, failed_over, or failover_faulted).

redpanda_shadow_link_failover_phase

Gauge

1 while an in-progress or faulted whole-link failover is in that phase. Labeled by shadow_link_name and phase (finish_tasks or fail_over_topics).

redpanda_shadow_link_failover_phase_start_timestamp_seconds

Gauge

Unix time, in seconds, when the whole-link failover entered the phase. 0 when no failover is in that phase. Labeled by shadow_link_name and phase.

redpanda_shadow_link_task_state

Gauge

Number of instances (one per shard) of a sync task on this broker in each state. Labeled by shadow_link_name, task (the task name, for example Source Topic Sync), and state (active, paused, link_unavailable, stopped, faulted, or finished). The stopped label corresponds to the NOT_RUNNING state that rpk and the API report. A high stopped count is normal: on brokers that do not lead the controller, some tasks don’t run.

Only the broker that leads the controller exports redpanda_shadow_link_shadow_topic_state, redpanda_shadow_link_state, redpanda_shadow_link_failover_phase, and redpanda_shadow_link_failover_phase_start_timestamp_seconds. The other brokers don’t export these metrics at all, so a sum across the cluster equals the controller leader’s value. Every broker exports redpanda_shadow_link_task_state for its own task instances.

See also: Public Metrics

Monitoring best practices

Health check procedures

Establish regular monitoring workflows to ensure shadow link health:

# Check that no shadow link has a faulted failover
rpk shadow list | grep "FAILOVER_FAULTED" || echo "No faulted shadow link failovers"

# Check the state of a shadow link
rpk shadow status <shadow-link-name> | grep -E "STATE"

# Monitor lag for critical topics
rpk shadow status <shadow-link-name> | grep -E "LAG|Lag"

A healthy link is ACTIVE, and after a whole-link failover it is FAILED_OVER. Treat any other state as needing attention. For continuous monitoring, use the redpanda_shadow_link_state metric and the alerts in Alert conditions.

Alert conditions

Configure monitoring alerts for the following conditions, which indicate problems with Shadowing:

  • High replication lag: When redpanda_shadow_link_shadow_lag exceeds your RPO requirements

  • Connection errors: When redpanda_shadow_link_client_errors increases rapidly

  • Topic state changes: When topics move to FAULTED state

  • Task failures: When replication tasks enter FAULTED or NOT_RUNNING states

  • Throughput drops: When bytes/records fetched drops significantly

  • Link unavailability: When tasks show LINK_UNAVAILABLE indicating source cluster connectivity issues

  • Faulted failover: When a whole-link failover stops in the FAILOVER_FAULTED state:

    redpanda_shadow_link_state{state="failover_faulted"} == 1
  • Stalled failover phase: When a failover phase approaches its deadline. This example warns at 240 seconds, 80% of the default shadow_link_failover_timeout of 5 minutes. If you change the property, adjust the threshold. The > 0 guard skips phases that no failover is in:

    redpanda_shadow_link_failover_phase_start_timestamp_seconds > 0
      and time() - redpanda_shadow_link_failover_phase_start_timestamp_seconds > 240
      and on (shadow_link_name) redpanda_shadow_link_state{state="failing_over"} == 1

After a whole-link failover, every sync task is in the FINISHED state. FINISHED is expected and does not indicate a failure, so exclude it from task-failure alerts.

For more information about shadow link tasks and their states, see Shadow link tasks.