argoproj-labs / argocd-extension-metrics

An Argo CD extension to enable visualization of metrics in Argo CD UI.
Apache License 2.0
118 stars 27 forks source link

Set ChartData key to pod when prometheus metrics contain multiple keys #44

Closed ashutosh16 closed 1 year ago

ashutosh16 commented 1 year ago

Line chart does not render correctly when Prometheus response metrics contain multiple key/value pairs. As there are multiple keys, it is constructed very long name in the chartdata, causing render issue (possibly due to upstream issue in line chart). As a result, an if condition was added to filter pod names to only have one unique name. e.g

"metric": {
            "__name__": "namespace_argocd_pod_memory_usage_bytes",
            "assetId": "xx",
            "namespace": "sandbox-rollout-xx-x",
            "pod": "numalogic-rollout-x",
            "receive": "true",
            "tenant_id": "default"
        }