Skip to content

Commit

Permalink
missing bits
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Clucas <[email protected]>
  • Loading branch information
Joibel committed Aug 12, 2024
1 parent 423b3a1 commit 9ee5081
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ A counter of the number of API requests sent to the Kubernetes API.
| `verb` | The verb of the request, such as `Get` or `List` |
| `status_code` | The HTTP status code of the response |

#### `leader`
#### `is_leader`

A gauge indicating if this Controller is the [leader](high-availability.md#workflow-controller).

Expand Down
2 changes: 1 addition & 1 deletion docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ These notes explain the differences in using the Prometheus `/metrics` endpoint

The following are new metrics:

* `leader`
* `is_leader`
* `queue_duration`
* `queue_longest_running`
* `queue_retries`
Expand Down
10 changes: 4 additions & 6 deletions workflow/metrics/leader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ func TestIsLeader(t *testing.T) {
assert.NotNil(t, te)
attribs := attribute.NewSet()
val, err := te.GetInt64GaugeValue(`is_leader`, &attribs)
if assert.NoError(t, err) {
assert.Equal(t, int64(1), val)
}
require.NoError(t, err)
assert.Equal(t, int64(1), val)
}

func TestNotLeader(t *testing.T) {
Expand All @@ -38,7 +37,6 @@ func TestNotLeader(t *testing.T) {
assert.NotNil(t, te)
attribs := attribute.NewSet()
val, err := te.GetInt64GaugeValue(`is_leader`, &attribs)
if assert.NoError(t, err) {
assert.Equal(t, int64(0), val)
}
require.NoError(t, err)
assert.Equal(t, int64(0), val)
}

0 comments on commit 9ee5081

Please sign in to comment.