GoogleCloudPlatform / GoogleCloudPlatform/k8s-stackdriver
List of available External Metrics are showing up in Custom Metrics list and not External Metrics
- Dominant language
- Go
- Stars
- 409
- Forks
- 236
- Avg merge
- 2h 34m
- Merged PRs (30d)
- 9
Description
This one took some time to figure out. I was trying to debug if the adapter pod was able to provide external metrics, however when I check the external metrics endpoint, I see no resources.
```
$ curl http://localhost:8001/apis/external.metrics.k8s.io/v1beta1
{
"kind": "APIResourceList",
"apiVersion": "v1",
"groupVersion": "external.metrics.k8s.io/v1beta1",
"resources": []
}
```
However, the external metrics are being listed under the custom metrics endpoint
```
$ kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1" | jq
{
"kind": "APIResourceList",
"apiVersion": "v1",
"groupVersion": "custom.metrics.k8s.io/v1beta1",
"resources": [
{
"name": "*/actions.googleapis.com|smarthome_action|local_event_count",
"singularName": "",
"namespaced": true,
"kind": "MetricValueList",
"verbs": [
"get"
]
},
{
"name": "*/actions.googleapis.com|smarthome_action|num_active_users",
"singularName": "",
"namespaced": true,
"kind": "MetricValueList",
"verbs": [
"get"
]
},
....
```
So I assumed that the external metrics were available under the `custom.metrics.k8s.io` endpoint. But when looking up metrics under the custom endpoint, it would cause the stackdriver adapter to panic.
After trying out a hunch, the external metrics worked as expected when changing to the `external.metrics.k8s.io` endpoint (as intended).
I am not sure if listing the external metrics under the custom endpoint is intentional, but if so, it is a bit misleading.
Contributor guide
Assessment
This issue has not been assessed yet.