Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import static org.apache.pulsar.common.util.Runnables.catchingAndLoggingThrowables;
import io.netty.buffer.ByteBuf;
import io.prometheus.client.Counter;
import io.prometheus.client.Gauge;
import java.io.IOException;
import java.time.Clock;
Expand Down Expand Up @@ -80,6 +81,14 @@ public class ReplicatedSubscriptionsController implements AutoCloseable, Topic.P
"Counter of currently pending snapshots")
.register();

// timeouts use SnapshotOperationResult.TIMEOUT.attributes on the same metric
@PulsarDeprecatedMetric(
newMetricName = OpenTelemetryReplicatedSubscriptionStats.SNAPSHOT_OPERATION_COUNT_METRIC_NAME)
@Deprecated
private static final Counter timedoutSnapshotsMetric = Counter
Comment thread
lhotari marked this conversation as resolved.
.build().name("pulsar_replicated_subscriptions_timedout_snapshots")
.help("Counter of timed out snapshots").register();

private final OpenTelemetryReplicatedSubscriptionStats stats;

public ReplicatedSubscriptionsController(PersistentTopic topic, String localCluster) {
Expand Down Expand Up @@ -263,6 +272,7 @@ private void cleanupTimedOutSnapshots() {
}

pendingSnapshotsMetric.dec();
timedoutSnapshotsMetric.inc();
var latencyMillis = entry.getValue().getDurationMillis();
stats.recordSnapshotTimedOut(latencyMillis);
it.remove();
Expand Down