k8sgpt-ai/k8sgpt-operator

Bug: Grafana Dashboard number of results

Closed this issue · 6 comments

Checklist

  • I've searched for similar issues and couldn't find anything matching
  • I've included steps to reproduce the behavior

Affected Components

  • K8sGPT (CLI)
  • K8sGPT Operator

K8sGPT Version

latest

Kubernetes Version

latest

Host OS and its Version

ubuntu

Steps to reproduce

  1. Have an existing set of K8sGPT results
  2. Start the operator with grafana dashboard + service monitor enabled
  3. View that the dashboard is missing k8sgpt_results_by_type

Expected behaviour

There is a graph that should populate

Actual behaviour

Missing data

Additional Information

The code will only increment the counter on raw results processing

		if operation == resources.CreatedResult {
			numberOfResultsByType := instance.r.MetricsBuilder.GetCounterVec("k8sgpt_number_of_results_by_type")
			if numberOfResultsByType != nil {
				numberOfResultsByType.WithLabelValues(result.Spec.Kind, result.Spec.Name, instance.k8sgptConfig.Name).Inc()
			} else if operation == resources.UpdatedResult {
				instance.logger.Info("updated successfully %s", result.Name)
			}
		}

I want to pick this issue. @AlexsJones. I am new to this repo can you give me a contribution guide to start with?

Go for it @Yadavanurag13 I linked the code that needs modifying, it's in the pre-analysis step in the controller pkg!

Dear @AlexsJones If the bug is still up for grabs, I would like to take a chance at solving it, however I am new to this project, and I would appreciate any pointers I can get to close the bug.

Thank you

This has been fixed #585

I would like to be a recurring contributor for this repo, and looking at your code fix vs what I had planned in my mind makes me reflect on the knowledge gap that I have, I would like to know if there's any resources you would recommend to be a better contributor.

I would like to be a recurring contributor for this repo, and looking at your code fix vs what I had planned in my mind makes me reflect on the knowledge gap that I have, I would like to know if there's any resources you would recommend to be a better contributor.

I would become familiar with Kubebuilder, golang and the prometheus metrics SDK as a start. Good luck!