peschmae / exporter-go-mystrom

MyStrom metrics exporter for prometheus
MIT License
3 stars 3 forks source link

no logs #1

Closed tuxpeople closed 3 years ago

tuxpeople commented 3 years ago

Hoi Mathias

Is it expected to see no logs from the container? Or does that mean something is wrong in my deployment?

Br Thomas

peschmae commented 3 years ago

Hi Thomas

Currently the log level is hardcoded to fatal (see: https://github.com/peschmae/exporter-go-mystrom/blob/main/main.go#L175 )

So if the exporter is working properly, no logs are shown at all. If you access the metrics endpoint, and an exception is thrown (e.g. invalid json returned from the MyStrom switch, or the switch not begin reachable), it will create an log entry.

But this is something that could be improved upon, that at least a successful startup message is displayed.

BR Mathias

tuxpeople commented 3 years ago

Ok, thanks for the explanation. I'm currently trying to find out why I can't reach the endpoint:

image

So I think the exporter itself is working (hence no log) and I need to search the error somewhere else.

peschmae commented 3 years ago

I assume you are running prometheus and the exporter both in docker on the same host? Are they part of the same network?

tuxpeople commented 3 years ago

They are both running in the same namespace of a Kubernetes cluster. mystrom-exporter-printer is the name of the service, and in-cluster dns is working properly. I can lookup the name, but not connect from the prometheus-pod:

/prometheus $ wget http://mystrom-exporter-printer:9452/metrics
Connecting to mystrom-exporter-printer:9452 (10.43.92.118:9452)

I'm pretty sure its something little which is wrong, but didn't find it so far. This is the current deployment: https://github.com/tuxpeople/k8s-homelab/blob/master/cluster/apps/monitoring/mystrom-exporter.yaml

tuxpeople commented 3 years ago

ok, found my fault: https://github.com/tuxpeople/k8s-homelab/commit/5624b37e90eca0bee351f9f4f0d501e92ee5c433

Do you have by chance an example Grafana dashboard somewhere?

peschmae commented 3 years ago

That looks like a nice k8s setup! I might have to get some inspiration from it, and recreate my cluster 😁

I currently don't have a grafana dashboard uploaded anywhere.

tuxpeople commented 3 years ago

This is my first attempt: https://github.com/tuxpeople/k8s-homelab/blob/master/cluster/apps/monitoring/grafana/dashboards/mystrom.json