-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
From #12589 This is a new metric counting how many pods have gone into each pod phase as observed by the controller. This is like pods_gauge, but as a counter rather than a gauge. The gauge is useful at telling you what is happening right now in the cluster, but is not useful for long term statistics such as "How many pods has workflows run" because it may never report some pods at all. This counter can answer that question. Note to reviewers: this is part of a stack of reviews for metrics changes. Please don't merge until the rest of the stack is also ready. Signed-off-by: Alan Clucas <[email protected]>
- Loading branch information
Showing
7 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package metrics | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
const ( | ||
namePodPhase = `pods_total_count` | ||
) | ||
|
||
func addPodPhaseCounter(_ context.Context, m *Metrics) error { | ||
return m.createInstrument(int64Counter, | ||
namePodPhase, | ||
"Total number of Pods that have entered each phase", | ||
"{pod}", | ||
withAsBuiltIn(), | ||
) | ||
} | ||
|
||
func (m *Metrics) ChangePodPhase(ctx context.Context, phase, namespace string) { | ||
m.addInt(ctx, namePodPhase, 1, instAttribs{ | ||
{name: labelPodPhase, value: phase}, | ||
{name: labelPodNamespace, value: namespace}, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters