the {{.name}} parameter in the configMap does not get passed through to prometheus.
When i open the metrics tab i get no results back:
so i started investigating and wrote a very simple http-logger. When i look at the chrome console, it tells me that the correct request against argocd-metrics-server is fired:
https://argo.*******.***/extensions/metrics/api/applications/http-debugger/groupkinds/pod/rows/pod/graphs/pod_cpu_line?name=http-debugger-5b54d4556c-7hp2p.*&namespace=default&application_name=http-debugger&project=administration&uid=b6e323fe-a997-431a-b81a-41f1fcbb99a0&duration=1h
so the {{.name}} is clearly there in form of "http-debugger-5b54d4556c-7hp2p.*" which is correct.
when i look at the logs of my http-logger it shows me this:
The first one is a FIXED name in the config. i created a new row just to test if its even working. And yes, it works when i hardcode the podname into the config.
The second one is with {{.name}} variable. And here we can see that it did not get passed through to prometheus ( Thanos in my case here )
So i pinned down the problem to the argocd metrics server. Then i looked into the code here but I'm not a go expert anymore :D Maybe the query parameter does not get parsed correctly?
I was curious and investigated further.. i found that no placeholder whatsoever gets parsed. No namespace, no name, no whatever.
After i had a look inside the cluster to check if there is something wrong with my template, i found the solution:
Helm was the problem. I deploy all my applications via argocd and helm. So the {{.name}} got parsed by helm and replaced with "nothing"
the {{.name}} parameter in the configMap does not get passed through to prometheus. When i open the metrics tab i get no results back:![image](https://github.com/argoproj-labs/argocd-extension-metrics/assets/23294566/789306c7-9057-4797-b542-d3419f5cea53)
so i started investigating and wrote a very simple http-logger. When i look at the chrome console, it tells me that the correct request against argocd-metrics-server is fired:
https://argo.*******.***/extensions/metrics/api/applications/http-debugger/groupkinds/pod/rows/pod/graphs/pod_cpu_line?name=http-debugger-5b54d4556c-7hp2p.*&namespace=default&application_name=http-debugger&project=administration&uid=b6e323fe-a997-431a-b81a-41f1fcbb99a0&duration=1h
so the {{.name}} is clearly there in form of "http-debugger-5b54d4556c-7hp2p.*" which is correct.
when i look at the logs of my http-logger it shows me this:
The first one is a FIXED name in the config. i created a new row just to test if its even working. And yes, it works when i hardcode the podname into the config.
The second one is with {{.name}} variable. And here we can see that it did not get passed through to prometheus ( Thanos in my case here )
So i pinned down the problem to the argocd metrics server. Then i looked into the code here but I'm not a go expert anymore :D Maybe the query parameter does not get parsed correctly? I was curious and investigated further.. i found that no placeholder whatsoever gets parsed. No namespace, no name, no whatever.
After i had a look inside the cluster to check if there is something wrong with my template, i found the solution:
Helm was the problem. I deploy all my applications via argocd and helm. So the {{.name}} got parsed by helm and replaced with "nothing"
So if anyone else has this problem, have a look here: https://github.com/helm/helm/issues/2798#issuecomment-326454957
it should look something like this:
i hope this can help someone :-)