Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify type and meaning of stacks_* metrics #402

Merged
merged 3 commits into from
Jan 24, 2023

Conversation

squaremo
Copy link
Contributor

@squaremo squaremo commented Jan 18, 2023

The stacks_failing metric is created as a GaugeVec in the Go code, which represents a set of time series distinguished by labels (in this case, "namespace" and "name"). But each of these time series are of type gauge, so the documentation is misleading in referring to them as gaugevec (which is not a kind of metric).

I've simplified the verbiage a little, in passing.

There was also a fault in the implementation of the stacks_failing count, which I've corrected. From the commit message:

The stacks_failed metric is a set of gauges, each labelled with the
namespace and name of a Stack object. The controller sets a gauge to 1
when its Stack object is given a state of "failed", and 0 for
"succeeded". A query aggregating over the labels will get the count of
failed stacks.

However: once a Stack is deleted, the gauge remains with the last value
-- and if it was failing, it will still be included in the count. So,
this commit resets the gauge to 0 when a Stack is deleted (if it had a
state at all).

Addresses #399.

The stacks_failing metric is created as a GaugeVec in the Go code, which represents a set of time series distinguished by labels (in this case, "namespace" and "name"). But each of these time series are of type `gauge`, so the documentation is misleading in referring to them as `gaugevec` (which is not a kind of metric).

I've simplified the verbiage a little, in passing.

Addresses #399.
The stacks_failed metric is a set of gauges, each labelled with the
namespace and name of a Stack object. The controller sets a gauge to `1`
when its Stack object is given a state of "failed", and `0` for
"succeeded". A query aggregating over the labels will get the count of
failed stacks.

However: once a Stack is deleted, the gauge remains with the last value
-- and if it was failing, it will still be included in the count. So,
this commit resets the gauge to `0` when a Stack is deleted (if it had a
state at all).

Signed-off-by: Michael Bridgen <mbridgen@pulumi.com>
Signed-off-by: Michael Bridgen <mbridgen@pulumi.com>
@squaremo squaremo requested a review from lblackstone January 23, 2023 13:58
@squaremo squaremo merged commit ce3262f into master Jan 24, 2023
@squaremo squaremo deleted the clarify-stacks_failing-gauge branch January 24, 2023 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants