danielqsj / kafka_exporter

Kafka exporter for Prometheus
Apache License 2.0
2.22k stars 618 forks source link

Not connecting via SASL/TLS #149

Open tonykimani opened 4 years ago

tonykimani commented 4 years ago

I cannot connect to secure kafka for some reason. Following is my docker-compose.

version: '3.7' services: kafka-exporter: image: danielqsj/kafka-exporter:v1.2.0
ports:

Error is: goroutine 1 [running]: | main.NewExporter(0xc420091aa0, 0x1, 0x1, 0x101, 0x7ffe609e1e7f, 0xe, 0x7ffe609e1e9e, 0x15, 0x0, 0x7ffe609e1ee1, ...) |/home/travis/gopath/src/github.com/danielqsj/kafka_exporter/kafka_exporter.go:211 +0x9bd | main.main() | /home/travis/gopath/src/github.com/danielqsj/kafka_exporter/kafka_exporter.go:481 +0x21b5

PS: Also is there any way I can pass in the args as env vars?

tylux commented 4 years ago

By no means an expert here, but had problems talking to Confluent Cloud Kafka, was able to connect like this.

docker run -p 9308 danielqsj/kafka-exporter --kafka.server="server:9092" --sasl.enabled --sasl.username="XXXXXX" --sasl.password="XXXXXXXXXXXXXXX" --tls.insecure-skip-tls-verify --tls.enabled

Ended up making our own fork based on this PR to get ENV Var support

https://github.com/danielqsj/kafka_exporter/pull/89