Skip to content

Commit

Permalink
r/probe: added offset translator inconsistency error metric
Browse files Browse the repository at this point in the history
Signed-off-by: Michał Maślanka <[email protected]>
(cherry picked from commit 3dc5470)
  • Loading branch information
mmaslankaprv committed Jan 7, 2025
1 parent 2cc10a2 commit e8b4cb0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/v/raft/consensus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2253,6 +2253,7 @@ void consensus::validate_offset_translator_delta(
"than expected: {}",
meta,
last_delta);
_probe->offset_translator_inconsistency_error();
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/v/raft/probe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ void probe::setup_metrics(const model::ntp& ntp) {
[this] { return _full_heartbeat_requests; },
sm::description("Number of full heartbeats sent by the leader"),
labels),
sm::make_counter(
"offset_translator_inconsistency_errors",
[this] { return _offset_translator_inconsistency_error; },
sm::description("Number of append entries requests that failed the "
"offset translator consistency check"),
labels),
},
{},
{sm::shard_label, sm::label("partition")});
Expand Down
5 changes: 4 additions & 1 deletion src/v/raft/probe.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ class probe {

void full_heartbeat() { ++_full_heartbeat_requests; }
void lw_heartbeat() { ++_lw_heartbeat_requests; }
void offset_translator_inconsistency_error() {
++_offset_translator_inconsistency_error;
}

void clear() {
_metrics.clear();
Expand All @@ -89,7 +92,7 @@ class probe {
uint64_t _recovery_request_error = 0;
uint64_t _full_heartbeat_requests = 0;
uint64_t _lw_heartbeat_requests = 0;

uint64_t _offset_translator_inconsistency_error = 0;
metrics::internal_metric_groups _metrics;
metrics::public_metric_groups _public_metrics;
};
Expand Down

0 comments on commit e8b4cb0

Please sign in to comment.