Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Multiple up checks are sent causing 500s #16

Open
bfosberry opened this issue May 21, 2017 · 0 comments
Open

Multiple up checks are sent causing 500s #16

bfosberry opened this issue May 21, 2017 · 0 comments

Comments

@bfosberry
Copy link

https://github.com/ofesseler/gluster_exporter/blob/master/main.go#L210

Im seeing a behaviour where the exporter is returning a 500 from the metrics api with this error:

An error has occurred during metrics gathering:

collected metric gluster_up gauge:<value:1 >  was collected before with the same name and label values

My guess is that here

	volumeInfo, err := ExecVolumeInfo()

	if err != nil {
		log.Errorf("couldn't parse xml volume info: %v", err)
		ch <- prometheus.MustNewConstMetric(
			up, prometheus.GaugeValue, 0.0,
		)
	}

	// use OpErrno as indicator for up
	if volumeInfo.OpErrno != 0 {
		ch <- prometheus.MustNewConstMetric(
			up, prometheus.GaugeValue, 0.0,
		)
	} else {
		ch <- prometheus.MustNewConstMetric(
			up, prometheus.GaugeValue, 1.0,
		)
	}

ExecVolumeInfo is returning an error and we are also sending up status on whats in volumeInfo.OpErrno. We should be short circuiting there.

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

1 participant