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

[Metricbeat] Panic in dropwizard collector #8365

Closed
adriansr opened this issue Sep 19, 2018 · 0 comments
Closed

[Metricbeat] Panic in dropwizard collector #8365

adriansr opened this issue Sep 19, 2018 · 0 comments
Labels

Comments

@adriansr
Copy link
Contributor

User reports a panic during metrics collection in the dropwizard module:

2018-09-19T10:54:14.354-0700    ERROR   runtime/panic.go:35 recovered from panic while fetching 'dropwizard/collector' for host 'stlrck-virh007.wsgc.com:8082'. Recovering, but please report this: runtime error: slice bounds out of range.   {"stack": "github.com/elastic/beats/libbeat/logp.Recover
	/go/src/github.com/elastic/beats/libbeat/logp/global.go:88
runtime.call32
	/usr/local/go/src/runtime/asm_amd64.s:509
runtime.gopanic
	/usr/local/go/src/runtime/panic.go:491
runtime.panicslice
	/usr/local/go/src/runtime/panic.go:35
github.com/elastic/beats/metricbeat/module/dropwizard/collector.splitTagsFromMetricName
	/go/src/github.com/elastic/beats/metricbeat/module/dropwizard/collector/data.go:94
github.com/elastic/beats/metricbeat/module/dropwizard/collector.eventMapping
	/go/src/github.com/elastic/beats/metricbeat/module/dropwizard/collector/data.go:25
github.com/elastic/beats/metricbeat/module/dropwizard/collector.(*MetricSet).Fetch
	/go/src/github.com/elastic/beats/metricbeat/module/dropwizard/collector/collector.go:84
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).multiEventFetch
	/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:227
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).fetch
	/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:207
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).startPeriodicFetching
	/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:184
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).run
	/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:171
github.com/elastic/beats/metricbeat/mb/module.(*Wrapper).Start.func1
	/go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:112"}

Adjusting the line offset to account for the only modification in dropwizard/collector/data.go yields line 111. The whole splitTagsFromMetricName method could use some bounds checking here and there.

Waiting for more information to understand what kind of data is it dealing with. Also exact dropwizard version.

@adriansr adriansr added bug Metricbeat Metricbeat labels Sep 19, 2018
adriansr added a commit to adriansr/beats that referenced this issue Sep 24, 2018
Dropwizard metrics parser extracts tags embedded into metrics names.
However, it crashes when the metric name contains curly braces.

This patch improves parsing by adding additional checks and also makes
sures that only tags at the end of the metric name are extracted.

Assuming that the tags extracted by the dropwizard module are the ones
introduced by this PR: dropwizard/metrics#839

Fixes elastic#8365
adriansr added a commit that referenced this issue Sep 24, 2018
Dropwizard metrics parser extracts tags embedded into metrics names.
However, it crashes when the metric name contains curly braces.

This patch improves parsing by adding additional checks and also makes
sures that only tags at the end of the metric name are extracted.

Assuming that the tags extracted by the dropwizard module are the ones
introduced by this PR: dropwizard/metrics#839

Fixes #8365
adriansr added a commit to adriansr/beats that referenced this issue Sep 25, 2018
Dropwizard metrics parser extracts tags embedded into metrics names.
However, it crashes when the metric name contains curly braces.

This patch improves parsing by adding additional checks and also makes
sures that only tags at the end of the metric name are extracted.

Assuming that the tags extracted by the dropwizard module are the ones
introduced by this PR: dropwizard/metrics#839

Fixes elastic#8365

(cherry picked from commit f5890b7)
adriansr added a commit that referenced this issue Sep 25, 2018
Dropwizard metrics parser extracts tags embedded into metrics names.
However, it crashes when the metric name contains curly braces.

This patch improves parsing by adding additional checks and also makes
sures that only tags at the end of the metric name are extracted.

Assuming that the tags extracted by the dropwizard module are the ones
introduced by this PR: dropwizard/metrics#839

Fixes #8365

(cherry picked from commit f5890b7)
adriansr added a commit to adriansr/beats that referenced this issue Oct 11, 2018
Dropwizard metrics parser extracts tags embedded into metrics names.
However, it crashes when the metric name contains curly braces.

This patch improves parsing by adding additional checks and also makes
sures that only tags at the end of the metric name are extracted.

Assuming that the tags extracted by the dropwizard module are the ones
introduced by this PR: dropwizard/metrics#839

Fixes elastic#8365

(cherry picked from commit f5890b7)
adriansr added a commit that referenced this issue Oct 11, 2018
Dropwizard metrics parser extracts tags embedded into metrics names.
However, it crashes when the metric name contains curly braces.

This patch improves parsing by adding additional checks and also makes
sures that only tags at the end of the metric name are extracted.

Assuming that the tags extracted by the dropwizard module are the ones
introduced by this PR: dropwizard/metrics#839

Fixes #8365

(cherry picked from commit f5890b7)
leweafan pushed a commit to leweafan/beats that referenced this issue Apr 28, 2023
Dropwizard metrics parser extracts tags embedded into metrics names.
However, it crashes when the metric name contains curly braces.

This patch improves parsing by adding additional checks and also makes
sures that only tags at the end of the metric name are extracted.

Assuming that the tags extracted by the dropwizard module are the ones
introduced by this PR: dropwizard/metrics#839

Fixes elastic#8365

(cherry picked from commit 652c7ba)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant