Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: panic when max-length metrics are excluded #258

Merged
merged 1 commit into from
May 12, 2022

Conversation

j-gourdon
Copy link

This PR fix an exporter crash when excluding max-length and max-length-bytes metrics. (limitsGaugeVec is an empty map in this case)

Step to reproduce :

  • Version : v1.0.0-RC13
  • Set EXCLUDE_METRICS=max-length-bytes,max-length
  • Scrape data

Panic output

[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7c19fd]

goroutine 25 [running]:
github.com/prometheus/client_golang/prometheus.(*GaugeVec).WithLabelValues(0x85cee0, {0xc001b111a0, 0x8cd992, 0xa})
        /home/runner/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/gauge.go:215 +0x1d
main.exporterQueue.Collect({0xc0000cd800, 0xc0000cca50, 0xc0000cd950, 0xc0000a0318, 0xc0000a0320}, {0xa00eb8, 0xc0004904e0}, 0x4669d3)
        /home/runner/work/rabbitmq_exporter/rabbitmq_exporter/exporter_queue.go:219 +0xf69
main.(*exporter).collectWithDuration(0xc000452c80, {0x9fe870, 0xc00044fef0}, {0xc000024029, 0x5}, 0x0)
        /home/runner/work/rabbitmq_exporter/rabbitmq_exporter/exporter.go:142 +0x394
main.(*exporter).Collect(0xc000452c80, 0xc00049e0c0)
        /home/runner/work/rabbitmq_exporter/rabbitmq_exporter/exporter.go:107 +0x23b
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
        /home/runner/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:446 +0x102
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
        /home/runner/go/pkg/mod/github.com/prometheus/[email protected]/prometheus/registry.go:538 +0xb4d

@kbudde kbudde merged commit 49eb959 into kbudde:main May 12, 2022
@kbudde
Copy link
Owner

kbudde commented May 12, 2022

Thank you!

@j-gourdon j-gourdon deleted the queue-max-length branch May 12, 2022 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants