[BURNDOWN-234] filter to correct KSM implementation #2134
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR change?
A query for a certain pod that ran for 1 hour returns 2 results: 1 set of values is emitted from kubecosts' implementation of the KSM container status running metric, the other results is from another KSM that came bundled with prometheus. As you can see, the light blue line simply stops returning results when the pod exists, however, the third party KSM keeps emitting the metric but sets it to 0 when the pod exits. Our prom query was just querying for all values and taking the date of the last result, which from the other KSM installation, was the current time even if the value was 0. Our logic then thought the pod was still alive By adding the non zero filter, we stop emitting 0 metrics and pull the upstream KSM implementation query results more into line with what we typically emit.
Does this PR relate to any other PRs?
How will this PR impact users?
Does this PR address any GitHub or Zendesk issues?
How was this PR tested?
Does this PR require changes to documentation?
Have you labeled this PR and its corresponding Issue as "next release" if it should be part of the next OpenCost release? If not, why not?