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

Prometheus collector metricset fails when a label has "," #3946

Closed
vjsamuel opened this issue Apr 7, 2017 · 0 comments
Closed

Prometheus collector metricset fails when a label has "," #3946

vjsamuel opened this issue Apr 7, 2017 · 0 comments

Comments

@vjsamuel
Copy link
Contributor

vjsamuel commented Apr 7, 2017

Prometheus collector fails whenever there is a label that has a comma.

Ex:

apiserver_request_count{client="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36",code="200",contentType="application/json",resource="applications",verb="GET"} 1
2017/04/07 02:57:49.521217 log.go:161: ERR recovered from panic while fetching 'prometheus/collector' for host 'api.system.svc.31.tess.io'. Recovering, but please report this: runtime error: index out of range.
2017/04/07 02:57:49.521297 log.go:162: ERR Stacktrace: goroutine 25 [running]:
runtime/debug.Stack(0x546c08a, 0x2b, 0xc420561728)
	/usr/local/Cellar/go/1.7.4_2/libexec/src/runtime/debug/stack.go:24 +0x79
github.com/elastic/beats/libbeat/logp.Recover(0xc42017a0c0, 0x5f)
	/go/src/github.com/elastic/beats/libbeat/logp/log.go:162 +0x138
panic(0x5242cc0, 0xc4200120f0)
	/usr/local/Cellar/go/1.7.4_2/libexec/src/runtime/panic.go:458 +0x243
github.com/elastic/beats/metricbeat/module/prometheus/collector.extractLabels(0xc4200d22e8, 0xce, 0x5435f0d)
	/go/src/github.com/elastic/beats/metricbeat/module/prometheus/collector/data.go:61 +0x205
github.com/elastic/beats/metricbeat/module/prometheus/collector.NewPromEvent(0xc4200d22d0, 0xe9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
	/go/src/github.com/elastic/beats/metricbeat/module/prometheus/collector/data.go:44 +0x20f
github.com/elastic/beats/metricbeat/module/prometheus/collector.(*MetricSet).Fetch(0xc420514460, 0x37f1840f, 0x5f48ce0, 0x400e6df, 0x5f4ed00, 0x6156110)
	/go/src/github.com/elastic/beats/metricbeat/module/prometheus/collector/collector.go:72 +0x1f1
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).multiEventFetch(0xc4202e0ea0, 0x6156110, 0xc420514460, 0xc4205a5c80, 0x1, 0xc42017a0c0, 0x5f, 0x200)
	/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:273 +0x6c

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

No branches or pull requests

1 participant