I've installed prometehus adapter with the following command:
helm install prometheus-adapter prometheus-community/prometheus-adapter --namespace monitoring
-f adapter_custom_values.yaml
However when checking with kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1, I dont see any metrics being registered. Here is a preview of the adapter_custom_values.yaml file:
prometheus:
# Run `kubectl get svc -n namespace` to get the url of Prometheus
url: http://prometheus-kube-prometheus-prometheus.monitoring.svc
port: 9090
logLevel: 10
replicas: 1
rules:
# Whether to enable the default rules
default: false
# Add custom metrics API here
custom:
# plex_queue_size API
- seriesQuery: 'plex_queue_size'
resources:
overrides:
namespace: {resource: "namespace"}
pod: {resource: "pod"}
name:
matches: ^(.*)
as: "plex_queue_size"
metricsQuery: <<.Series>>{<<.LabelMatchers>>}
But when checking the custom metrics api with the command kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1 , I am getting empty response:
{
"kind": "APIResourceList",
"apiVersion": "v1",
"groupVersion": "custom.metrics.k8s.io/v1beta1",
"resources": []
}
From the adapter logs i can see that the request to prometheus is succesfull but the data inside of the Responsde Body is empty:
GET http://prometheus-kube-prometheus-prometheus.monitoring.svc:9090/api/v1/series?match%5B%5D=plex_queue_size&start=1640091045.342 200 OK
Response Body: {"status":"success","data":[]}
Set available metric list from Prometheus to: [[]] .
Kube-prometheus-stack is also installed with helm.
My question is why the custom metrics are't being registered in the Custom Metrics API ? Any help would be appreciated.