-->

DEVOPSZONES

  • Recent blogs

    How to check your prometheus.yml is valid or not

    How to check your prometheus.yml is valid or not


    Its always a good pratice to check that your configuration is valid before pushing to production. Prometheus will fail to reload if there is a bad configuration. Thus it's wise to check that the configuration is good before deploying it.

    To facilitate this, promtool which comes with Prometheus has a check config command. Let's check a prometheus config:


    • Download and extract prometheus.


    wget https://github.com/prometheus/prometheus/releases/download/v2.5.0/prometheus-2.5.0.linux-amd64.tar.gz
    tar -xzf prometheus-*.tar.gz
    cd prometheus-*

    promtool


    • Now check the configuration



    You see an error. Now fix the Prometheus file and  check the config again.

    No comments