prometheus-adapter: Resources list is empty at /apis/custom.metrics.k8s.io/v1beta1/
Hi there!
I have the following metrics in Prometheus:
http_requests_total{namespace!="",pod!=""}
->
http_requests_total{endpoint="http",instance="100.96.3.10:8080",job="sample-app",namespace="default",pod="sample-app-74f4657c87-5s54g",service="sample-app"}
My config is:
apiVersion: v1
kind: ConfigMap
metadata:
name: adapter-config
namespace: custom-metrics
data:
config.yaml: |
rules:
- seriesQuery: 'http_requests_total{namespace!="",pod!=""}'
resources:
overrides:
namespace: {resource: "namespace"}
pod: {resource: "pod"}
name:
matches: "^(.*)_total"
as: "${1}_per_second"
metricsQuery: 'http_requests_total{<<.LabelMatchers>>}'
When I check I get:
kubectl get --raw /apis/custom.metrics.k8s.io/v1beta1/ --v=6
{"kind":"APIResourceList","apiVersion":"v1","groupVersion":"custom.metrics.k8s.io/v1beta1","resources":[]}
What can be wrong? Now I’m just trying to make it work
Use image directxman12/k8s-prometheus-adapter-amd64
Is there way I can debug? Or which logs should I check?
k8s version:
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:05:37Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 20 (3 by maintainers)
I have right URL specified. But still facing with the same issue.
Ok, I figured it out: prometheus URL was wrong
Hi! I had the same problem with empty at /apis/custom.metrics.k8s.io/v1beta1/ but prometheus URL was right in my case but not completely correct: url need the http:// and adapter works as excpect.
logs: