cloud-ark / cloud-ark/kubeplus
Fix custom metrics test
- Dominant language
- Go
- Stars
- 756
- Forks
- 95
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 7
Description
It gives this error when running:
```
Output of kubectl metrics:
{"accountidentity": "", "subresources": "-", "pods": "0", "containers": "0", "nodes": "0", "cpu": "0.0 m", "memory": "0.0 Mi", "storage": "0 Gi", "networkReceiveBytes": "0 bytes", "networkTransmitBytes": "0 bytes", "notRunningPods": "0", "oom_events": "0"}
FAIL: The custom field 'hello_requests_total' does not exist in the metrics JSON output.
E
======================================================================
ERROR: test_metrics_custom (__main__.TestKubePlus.test_metrics_custom)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/ishan/go/src/github.com/cloud-ark/kubeplus/tests/tests.py", line 766, in test_metrics_custom
sys.exit(1)
SystemExit: 1
----------------------------------------------------------------------
Ran 1 test in 19.520s
FAILED (errors=1)
```
Contributor guide
Research direction
Start with tests/tests.py and the test_metrics_custom function, then run the failing test and inspect the kubectl metrics output shown in the issue. Trace why hello_requests_total is absent from the returned metrics JSON; done means the custom metrics test passes and the expected field is present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes, python
- Domain
- devops, observability, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100