diff --git a/docs/metrics.md b/docs/metrics.md index ca8ae39e4b29..06e9c9205dfe 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -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). diff --git a/docs/upgrading.md b/docs/upgrading.md index 64a9859e5eba..9f190c04f3b1 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -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` diff --git a/workflow/metrics/leader_test.go b/workflow/metrics/leader_test.go index 0f3f46968497..623c5931464d 100644 --- a/workflow/metrics/leader_test.go +++ b/workflow/metrics/leader_test.go @@ -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) { @@ -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) }