Skip to content
This repository has been archived by the owner on Aug 4, 2023. It is now read-only.

duplicate check status #16

Open
freeseacher opened this issue Sep 12, 2018 · 6 comments
Open

duplicate check status #16

freeseacher opened this issue Sep 12, 2018 · 6 comments

Comments

@freeseacher
Copy link

Hi. I've build that exporter from master branch to achieve multiuser functionally and seems found a bug.

If check was modified anyhow exporter began to export each variant of check.
For example

pingdom_check_status{hostname="XXX",id="XXX7",name="Internal check",paused="false",resolution="1",tags="proxy,releng-internal"} 0
pingdom_check_status{hostname="XXX",id="XXX7",name="Internal check",paused="false",resolution="1",tags="proxy,internal"} 0

Id remains the same. after restarting exporter all seems back to normal

@freeseacher
Copy link
Author

Same behaviour with changing pause status.
As a result i got 6 different checks. 2 with first tag list, 2 with second tag list and 2 with paused/unpaused state.

@freeseacher
Copy link
Author

*** go/src/github.com/giantswarm/prometheus-pingdom-exporter/cmd/server.go	2018-09-13 00:59:40.360763474 +0300
--- go/src/github.com/freeseacher/prometheus-pingdom-exporter/cmd/server.go	2018-09-13 00:44:14.383017753 +0300
*************** func serverRun(cmd *cobra.Command, args
*** 95,102 ****
  			}
  			pingdomUp.Set(1)
  
- 			pingdomCheckResponseTime.Reset()
- 			pingdomCheckStatus.Reset()
  			for _, check := range checks {
  				id := strconv.Itoa(check.ID)
  
--- 95,100 ----

 

It seems something like that will fix duplication. But i am not sure if i use right place to reset metrics

@giddel
Copy link

giddel commented Nov 12, 2018

Same behavior here. After renaming a check in Pingdom I get two checks with the old and the new name.
Can anyone fix this please?

@giddel
Copy link

giddel commented Mar 20, 2019

Is there anyone who would fix this. Its really annoying!

@giddel
Copy link

giddel commented Mar 20, 2019

As described in: https://github.com/prometheus/client_golang/blob/da11cf2c83c7414b76736025847c1cbdbb41e11e/prometheus/gauge.go#L159

// GetMetricWithLabelValues returns the Gauge for the given slice of label
// values (same order as the VariableLabels in Desc). If that combination of
// label values is accessed for the first time, a new Gauge is created.

Maybe It is be better to select the gauge by only the "id" label first (I assume the id is unique in Pingdom) and update set the other label / values and the metrics value explizit only on this single gauge.

???

@cryptobioz
Copy link
Contributor

The PR #20 should fix this issue. /cc @giddel @freeseacher @JosephSalisbury

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants