Closed StefThomas closed 1 year ago
It's already fixed i think. The new version is released the 6 july. Otherwise you can use the unstable plugin.
Would be nice. I also tested the version Stéphane Duret sent me on June the 19th and the problem is still present. I’ll try with the unstable version.
Sadly the issue is still present in centreon-plugin-Cloud-Prometheus-Api-20230628-083750.el8.noarch
To be clear: the issue which led to a "skipped (no value)" result is fixed. But not he first one I reported (ie: the pod restart not being detected).
The strangest thing is that the last stable version (20230608) fixes the first issue (the restart one), but not the last unstable version (20230628). In other words, I can’t find a version with both the issues fixed.
Also, why tag the issue as "question"?
I have checked and the mode works as expected. As you can see, you have the same pod value (that's why you have 0 and not 67. The mode uses the last value of the json):
{
"metric": {
"__name__": "restarts",
"container": "springboot",
"endpoint": "https-main",
"job": "kube-state-metrics",
"namespace": "beryl-rec1",
"pod": "beryl-api-64d7fdb854-k8w76",
"service": "kube-state-metrics",
"uid": "0c57cc8a-183e-44ce-bf16-64df989c72be"
},
....
"value": [
1687960012.192,
"67"
]
},
{
"metric": {
"__name__": "restarts",
"container": "undertow-logs",
"endpoint": "https-main",
"job": "kube-state-metrics",
"namespace": "beryl-rec1",
"pod": "beryl-api-64d7fdb854-k8w76",
"service": "kube-state-metrics",
"uid": "0c57cc8a-183e-44ce-bf16-64df989c72be"
},
"value": [
1687960012.192,
"0"
]
},
You should use the following option: --instance='pod' --instance='container' --output='Restarts du pod %{instance} container %{container} (%{restarts})'
OK. I’m closing the issue.
Hi,
I have the following check, which is supposed to alert if there has been a restart of an Openshift pod in the last hour:
It returns an OK status although the data returned by Prometheus is the following:
As there is a value of 67 for pod “beryl-api-64d7fdb854-k8w76” it shouldn’t return an OK status.
Version of the plugin used is from the package centreon-plugin-Cloud-Prometheus-Api-20230117-074217.el8.noarch.
With version from the package centreon-plugin-Cloud-Prometheus-Api-20230608-122119.el8.noarch it works, but then that’s another of our checks which does not anymore:
while data returned by the API is the following:
As I can’t obviously use a different version of the plugin for a particular check, I need both checks to work with the same version of the plugin (preferably the last version of course).