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

gauge not worked? #9

Closed
artb1sh opened this issue Sep 11, 2018 · 5 comments
Closed

gauge not worked? #9

artb1sh opened this issue Sep 11, 2018 · 5 comments
Labels

Comments

@artb1sh
Copy link

artb1sh commented Sep 11, 2018

panic: inconsistent label cardinality

goroutine 1 [running]:
github.com/carlpett/stream_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*MetricVec).WithLabelValues(0xc420013080, 0xc4201ac2b0, 0x2, 0x2, 0x0, 0x0)
        /go/src/github.com/carlpett/stream_exporter/vendor/github.com/prometheus/client_golang/prometheus/vec.go:135 +0x8e
github.com/carlpett/stream_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*GaugeVec).WithLabelValues(0xc4201c81b0, 0xc4201ac2b0, 0x2, 0x2, 0x0, 0x0)
        /go/src/github.com/carlpett/stream_exporter/vendor/github.com/prometheus/client_golang/prometheus/gauge.go:108 +0x4c
github.com/carlpett/stream_exporter/linemetrics.GaugeVecLineMetric.MatchLine(0xc420017c80, 0x8, 0xc4201082a0, 0x21, 0xc420108510, 0x0, 0xc420017e48, 0x5, 0xc420017f60, 0x5, ...)
        /go/src/github.com/carlpett/stream_exporter/linemetrics/gauge.go:26 +0x173
github.com/carlpett/stream_exporter/linemetrics.(*GaugeVecLineMetric).MatchLine(0xc4200f02a0, 0xc4201b8150, 0x63)
        <autogenerated>:11 +0x9d
main.main()
        /go/src/github.com/carlpett/stream_exporter/exporter.go:130 +0xbd9
@carlpett
Copy link
Owner

Hi @artb1sh,
Sorry about that! Could you provide the pattern you were using which caused this, and if possible also the line that triggers it?

@artb1sh
Copy link
Author

artb1sh commented Sep 12, 2018

Hi @carlpett, Label "test-mongo" not unique?
run option:
-input.type syslog -input.syslog.listenaddr 0.0.0.0:1555 -input.syslog.linetemplate '[tag] [content]' -input.syslog.listenfamily udp -config /app/stream_exporter.yaml -log.level debug

metrics:
  - name: commited
    kind: gauge
    pattern: '(?P<section>test\-mongo).*total (?P<value>\d+)'

input stream syslog line:

DEBU[0022] Got line "test-mongo 2018-09-12 07:28:00,655 [DEBUG] testCopier : [9de2afd4] Committed for 1 to total 29395445600"  source="exporter.go:127"
  DEBU[0000] Got line "test-mongo 2018-09-12 07:28:18,961 [DEBUG] testCopier : [9de2afd4] Committed for 2 to total 29395445639"  source="exporter.go:127"
panic: inconsistent label cardinality

goroutine 1 [running]:
github.com/carlpett/stream_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*MetricVec).WithLabelValues(0xc42010e940, 0xc420182310, 0x2, 0x2, 0x0, 0x0)
        /go/src/github.com/carlpett/stream_exporter/vendor/github.com/prometheus/client_golang/prometheus/vec.go:135 +0x8e
github.com/carlpett/stream_exporter/vendor/github.com/prometheus/client_golang/prometheus.(*GaugeVec).WithLabelValues(0xc42022a0d0, 0xc420182310, 0x2, 0x2, 0x0, 0x0)
        /go/src/github.com/carlpett/stream_exporter/vendor/github.com/prometheus/client_golang/prometheus/gauge.go:108 +0x4c
github.com/carlpett/stream_exporter/linemetrics.GaugeVecLineMetric.MatchLine(0xc4200fc580, 0x8, 0xc420110870, 0x2b, 0xc420110ae0, 0x0, 0xc4200fc860, 0x7, 0xc4200fc868, 0x7, ...)
        /go/src/github.com/carlpett/stream_exporter/linemetrics/gauge.go:26 +0x173
github.com/carlpett/stream_exporter/linemetrics.(*GaugeVecLineMetric).MatchLine(0xc4201362a0, 0xc420212100, 0x71)
        <autogenerated>:11 +0x9d
main.main()
        /go/src/github.com/carlpett/stream_exporter/exporter.go:130 +0xbd9

@carlpett
Copy link
Owner

Hey,
Turns out this is a bug. Fixing now.
Thanks for the help finding and replicating!

@carlpett
Copy link
Owner

New release out :)

@artb1sh
Copy link
Author

artb1sh commented Sep 13, 2018

@carlpett ,
Thx its work!

jryberg pushed a commit to jryberg/stream_exporter that referenced this issue May 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants