Skip to content

Commit

Permalink
Add election_leader_idle metric
Browse files Browse the repository at this point in the history
  • Loading branch information
yngvar-antonsson committed Nov 3, 2023
1 parent 8196f38 commit 69c3c95
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(`metrics.cfg{include={'all'}}` can be used instead of `metrics.cfg{include='all'}`,
`metrics.cfg{exclude={'all'}}` can be used instead of `metrics.cfg{include='none'}`)

- `tnt_election_leader_idle` metric.

## [1.0.0] - 2023-05-22
### Changed

Expand Down
3 changes: 3 additions & 0 deletions doc/monitoring/metrics_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,9 @@ Shows the current state of a replica set node in regards to leader election.
* - ``tnt_election_term``
- Current election term.

* - ``tnt_election_leader_idle``
- Current idle for elected leader.

Memtx
-----

Expand Down
6 changes: 6 additions & 0 deletions metrics/tarantool/info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ local function update_info_metrics()
collectors_list.election_term =
utils.set_gauge('election_term', 'Current election term',
info.election.term, nil, nil, {default = true})

if info.election.leader_idle ~= nil then
collectors_list.election_leader_idle =
utils.set_gauge('election_leader_idle', 'Current idle for elected leader',
info.election.leader_idle, nil, nil, {default = true})
end
end
end

Expand Down

0 comments on commit 69c3c95

Please sign in to comment.