tess1o / go-ecoflow-exporter

MIT License
25 stars 2 forks source link

ERROR No metric handlers enabled #6

Closed sinist3rr closed 3 months ago

sinist3rr commented 3 months ago

Hi! I tried to run the docker container but got an error.

docker compose -f exporter-remote-compose.yml up
[+] Running 2/2
 ✔ Network docker-compose_default  Created                                                                                                                                                                      0.1s 
 ✔ Container go_ecoflow_exporter   Created                                                                                                                                                                      0.0s 
Attaching to go_ecoflow_exporter
go_ecoflow_exporter  | 2024/07/09 13:12:30 ERROR No metric handlers enabled, exiting
go_ecoflow_exporter exited with code 0

Maybe I need to enable something else? Any clues?

tess1o commented 3 months ago

Hello,

Yes, you need to enable exporting the metrics to one (or many) of the systems: Prometheus, TimescaleDB, Redis.

To enable it for Prometheus (probably the default choice) in .env variable change PROMETHUS_ENABLED to true. By default it's disabled.

For Prometheus please check the documentation, it describes what mandatory parameters you need to set and how to run everything via docker compose:

https://github.com/tess1o/go-ecoflow-exporter/blob/main/docs/prometheus.md

sinist3rr commented 3 months ago

I think I figured it out. The point is that the PROMETHEUS_ENABLED: ${PROMETHEUS_ENABLED} has been added to exporter-local-compose.yml. But it is not present in the exporter-remote-compose.yml. So the variable from the env file was simply not used. Now the container works. Thanks.

tess1o commented 3 months ago

You are right, I've fixed the issue.