neptune-networks / flow-exporter

Export network flows from Kafka to Prometheus
https://brooks.sh/2019/11/17/network-flow-analysis-with-prometheus/
MIT License
125 stars 20 forks source link

AS name from cidr-report may not be UTF8 #1

Closed bswinnerton closed 5 years ago

bswinnerton commented 5 years ago

Just came cross this panic for a source_as_name that is not UTF-8.

> ./flow-exporter --broker broker.fqdn.com:9092 --topic pmacct.acct --defaultAS 000000
INFO[0000] Fetching up to date AS database
INFO[0013] Starting Kafka consumer
INFO[0013] Starting Prometheus web server
panic: label source_as_name: value "MARAND\xda COMUNICACIONES S.E." is not valid UTF-8

goroutine 1 [running]:
github.com/prometheus/client_golang/prometheus.(*CounterVec).With(0xc0000f00c0, 0xc0003d3ce0, 0x162415d, 0x8)
        /Users/brooks/go/pkg/mod/github.com/prometheus/client_golang@v1.2.1/prometheus/counter.go:217 +0xc2
main.createConsumer(0x7ffeefbff609, 0x1e, 0x7ffeefbff630, 0xb, 0x60f57, 0x0, 0xc000164060)
        /Users/brooks/go/src/github.com/neptune-networks/flow-exporter/flow-exporter.go:170 +0xc0c
main.main()
        /Users/brooks/go/src/github.com/neptune-networks/flow-exporter/flow-exporter.go:69 +0x239