grafana / cloudcost-exporter

Prometheus Exporter for Cloud Provider agnostic cost metrics
Apache License 2.0
30 stars 1 forks source link

Handling shutdown signal gracefully; minor updates #117

Closed logyball closed 7 months ago

logyball commented 7 months ago

Closes #19

Adding a graceful shutdown to the exporter, complete with a timeout for the server. Additionally, added some minor refactors throughout the exporter.go file to make the code slightly more readable.

Shutdown Changes

Refactors

logyball commented 7 months ago

I'm gonna pass on the os.exit() suggestion for now - this seems like a nice-to-have that we won't need and adds a little bit of clutter. I think it'd be surprising if we used different exit codes for something meaningful, and we can re-evaluate when changing the log -> slog if we feel strongly.