1

我想使用 elastcisearch 在 kibana 中显示 jmx 指标。我在 jar 下面起诉以在某些端口中公开 tomcat 指标“jmx_prometheus_javaagent-0.6.jar”,例如。9999 我正在使用以下配置 metricbeat.yml

metricbeat.modules:
- module: prometheus
  metricsets: ["collector"]
  period: 10s
  hosts: ["tomcat_ip:port"]
  metrics_path: /metrics
  namespace: example

我收到以下错误:

2017/07/13 14:21:13.170948 log.go:144: ERR recovered from panic while fetching 'prometheus/collector' for host '10.232.37.17:7070'. Recovering, but please report this: runtime error: index out of range.
2017/07/13 14:21:13.171024 log.go:145: ERR Stacktrace: goroutine 52 [running]:
runtime/debug.Stack(0xbdacf8, 0x2b, 0xc4203b9748)
        /usr/local/go/src/runtime/debug/stack.go:24 +0x79
github.com/elastic/beats/libbeat/logp.Recover(0xc42006c2a0, 0x57)
        /go/src/github.com/elastic/beats/libbeat/logp/log.go:145 +0x138
panic(0xade9a0, 0xc420010110)
        /usr/local/go/src/runtime/panic.go:458 +0x243
github.com/elastic/beats/metricbeat/module/prometheus/collector.extractLabels(0xc42010629b, 0x21, 0xbb6811)
        /go/src/github.com/elastic/beats/metricbeat/module/prometheus/collector/data.go:62 +0x20a
github.com/elastic/beats/metricbeat/module/prometheus/collector.NewPromEvent(0xc420106280, 0x43, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/src/github.com/elastic/beats/metricbeat/module/prometheus/collector/data.go:45 +0x270
github.com/elastic/beats/metricbeat/module/prometheus/collector.(*MetricSet).Fetch(0xc4204c2460, 0x89e5533, 0x11622e0, 0x40d8cf, 0x1166e40, 0x7f0f6eb91280)
        /go/src/github.com/elastic/beats/metricbeat/module/prometheus/collector/collector.go:70 +0x141
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).multiEventFetch(0xc4200e5380, 0x7f0f6eb91280, 0xc4204c2460, 0xc4203b9c70, 0x1, 0xc42006c2a0, 0x57, 0xc4203b9ea4)
        /go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:267 +0x6c
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).fetch(0xc4200e5380, 0xc420494180, 0xc4204942a0, 0x0, 0x0)
        /go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:229 +0x331
github.com/elastic/beats/metricbeat/mb/module.(*metricSetWrapper).startFetching(0xc4200e5380, 0xc420494180, 0xc4204942a0)
        /go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:203 +0x2fe
github.com/elastic/beats/metricbeat/mb/module.(*Wrapper).Start.func1(0xc4201aa120, 0xc420494180, 0xc4204942a0, 0xc4200e5380)
        /go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:139 +0x67
created by github.com/elastic/beats/metricbeat/mb/module.(*Wrapper).Start
        /go/src/github.com/elastic/beats/metricbeat/mb/module/wrapper.go:140 +0x1f9

谁能帮我解决这个问题?

4

0 回答 0