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

Show multiple metric values in KeptnMetric #1883

Closed
2 tasks done
rakshitgondwal opened this issue Aug 13, 2023 · 9 comments
Closed
2 tasks done

Show multiple metric values in KeptnMetric #1883

rakshitgondwal opened this issue Aug 13, 2023 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@rakshitgondwal
Copy link
Member

rakshitgondwal commented Aug 13, 2023

Introduce a new range.storedResults field in the KeptnMetric struct. This field would be defined as the total number of results we want to store in the Status of the KeptnMetric.
The metrics-controller would query the SLI provider in an interval of fetchIntervalSeconds and keep the last spec.range.storedResults amount of results. It basically acts as an LRU with a capacity of spec.range.storedResults.
The maximum amount should be tested and found as part of this ticket - a good value could be 255.

Later, we can modify the status field to have a status.results field that would contain a slice/array of a Result struct.
The Result struct can have the value, rawValue, lastUpdated fields for a particular metric.

This whole thing might look somewhat like this:

Screenshot from 2023-08-13 21-06-40

apiVersion: metrics.keptn.sh/v1alpha3
kind: KeptnMetric
metadata:
  name: podtato-head
spec:
  provider:
    name: "my-provider"
  query: "sum(kube_pod_container_resource_limits{resource='cpu'})"
  fetchIntervalSeconds: 5
  range:
    interval: "5m"
    step: "1m"
    aggregation: "p90"
    storedResults: 5
status:
  results:
  - value: 1
    range:
    - interval: 5m
      step: 1m
      aggregaion: max
    lastUpdated: ...
  - value: 1
    rawValue: []byte
    range:
    - interval: 5m
      step: 1m
      aggregaion: max
    lastUpdated: ....
  errMsg: nil

Tasks

Preview Give feedback
  1. rakshitgondwal
  2. metrics-operator
    rakshitgondwal
@RealAnna RealAnna added enhancement New feature or request status: ready-for-refinement Issue is relevant for the next backlog refinment labels Aug 16, 2023
@thisthat thisthat removed the status: ready-for-refinement Issue is relevant for the next backlog refinment label Aug 16, 2023
@rakshitgondwal
Copy link
Member Author

What did we decide to do with the rawValue over here? Should it be removed? Showing rawValue for every metric will make the CRD more lengthy.

cc @RealAnna @thisthat @bacherfl

@rakshitgondwal
Copy link
Member Author

Also, should we have a slice or an array for results?

@prakrit55
Copy link
Member

Hey @rakshitgondwal, is this still not done yet, I will work on it.

@rakshitgondwal
Copy link
Member Author

Hey @prakrit55, the first part of this issue has been completed, and I am working on the second part right now.

@prakrit55
Copy link
Member

It looked similar to an issue, so I approached. Thanks for the response.

@mowies
Copy link
Member

mowies commented Nov 15, 2023

What did we decide to do with the rawValue over here? Should it be removed? Showing rawValue for every metric will make the CRD more lengthy.

CC'ing again @RealAnna @thisthat @bacherfl

Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be
closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 15, 2024
@rakshitgondwal
Copy link
Member Author

Have a PR under review that will close this issue.

@rakshitgondwal
Copy link
Member Author

Closing as both the tasks have been completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

5 participants