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

Create e2e tests for all exposed Prometheus metrics #4127

Closed
8 tasks done
Tracked by #2357
zroubalik opened this issue Jan 17, 2023 · 8 comments · Fixed by #4437
Closed
8 tasks done
Tracked by #2357

Create e2e tests for all exposed Prometheus metrics #4127

zroubalik opened this issue Jan 17, 2023 · 8 comments · Fixed by #4437
Assignees
Labels
feature-request All issues for new features that have not been committed to good first issue Good for newcomers help wanted Looking for support from community testing

Comments

@zroubalik
Copy link
Member

zroubalik commented Jan 17, 2023

Proposal

At the moment KEDA exposes following metrics:

  • keda_scaler_active
  • keda_scaler_metrics_value
  • keda_scaler_metrics_latency
  • keda_scaler_errors
  • keda_scaler_error_totals
  • keda_scaled_object_errors
  • keda_resource_totals
  • keda_trigger_totals

We should cover all of these metrics by e2e tests:

  • test that metrics are exposed
  • test that metrics are correctly calculated (ie. we should test that metrics related to errros are correctly incremented in case of an error in a scaler/scaledobject, etc.).

Exisiting Prometheus Metrics e2e tests: https://github.com/kedacore/keda/blob/main/tests/internals/prometheus_metrics/prometheus_metrics_test.go

Docs: https://keda.sh/docs/2.10/operate/prometheus/

@zroubalik zroubalik added help wanted Looking for support from community good first issue Good for newcomers feature-request All issues for new features that have not been committed to testing labels Jan 17, 2023
@zroubalik zroubalik changed the title Create e2e test fall all exposed Prometheus metrics Create e2e tests for all exposed Prometheus metrics Jan 17, 2023
@Parthiba-Hazra
Copy link
Contributor

hey, is this issue already worked on ? if not then I want to give a try... as I'm new in open source.

@JorTurFer
Copy link
Member

Hey @Parthiba-Hazra
There isn't anybody working on this AFAIK, I assign the issue to you 😄
Thanks for the help!

@Parthiba-Hazra
Copy link
Contributor

Hey @JorTurFer thank you for the response .
As a new folk how should I approach this issue, anything that could help me..

@zroubalik
Copy link
Member Author

@Parthiba-Hazra there's a doc around e2e tests: https://github.com/kedacore/keda/tree/main/tests#readme

Existing Prometheus metrics related tests are here:
https://github.com/kedacore/keda/blob/main/tests/internals/prometheus_metrics/prometheus_metrics_test.go

In the issue description you can see missing tests, so you need to create test cases for them.

@Parthiba-Hazra
Copy link
Contributor

got it 👍

@Parthiba-Hazra
Copy link
Contributor

Hey @zroubalik I need some help --
for the keda_scaler_errors test case, first I have to apply a scaled_object that will cause error with Prometheus , then get the operator metrics and check that keda operator show the errors...
is that right?

@zroubalik
Copy link
Member Author

@Parthiba-Hazra yeah, check that Prometheus metrics show the error.

@Parthiba-Hazra
Copy link
Contributor

hey @zroubalik I created test cases that asserts that applying wrong scaled object increase the counter-value of keda_scaler_errors , keda_scaler_error_totals and keda_scaled_object_errors metrics from 0 to any positive number .. is there anything that I should check also ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request All issues for new features that have not been committed to good first issue Good for newcomers help wanted Looking for support from community testing
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants