ribbybibby / ssl_exporter

Exports Prometheus metrics for TLS certificates
Apache License 2.0
504 stars 95 forks source link

Request for `dry-run` feature #111

Open k0ste opened 1 year ago

k0ste commented 1 year ago

With dry-run feature we will can to put ssl_exporter configuration and perform syntax test (exporter can run with this YAML) before restart with new configuration (useful for IaC's)

For example, this YAML seems legit

---
- modules:
    https:
      prober: https

But

[root@mon ssl_exporter]# ./ssl_exporter --log.level=debug --web.listen-address=":9222" --config.file=ssl.yml
ts=2022-08-09T12:07:29.167Z caller=ssl_exporter.go:142 level=error msg="error parsing config file: yaml: unmarshal errors:\n  line 2: cannot unmarshal !!seq into config.Config"
[root@mon ssl_exporter]# echo $?
1

Will be nice if we can check it, like ./ssl_exporter --config.file=/path/to/file.yaml --dry-run and check for non-zero exit-code