How to collected the azure postgres metrics via Prometheus and show these metrics on Grafana?

Song Song Li 21 Reputation points
2022-04-07T03:22:25.587+00:00

I have a PostgreSQL server in Azure, I want to collect the DB metrics to Prometheus and show these metrics on Grafana? I do not found any doc about this topic. so please help and guide me on how to do it? thanks.

Azure Database for PostgreSQL
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 27,642 Reputation points Microsoft Employee
    2022-04-08T13:05:26.07+00:00

    Hi @ soli-9724 Can you try using the below docker image which is working as expected, either you build it from the scratch or you can use the sample one from the below.
    Postgres metrics and make sure you disable SSL.

    Please let us know if this is helpful
    Regards
    Geetha


2 additional answers

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 27,642 Reputation points Microsoft Employee
    2022-04-11T12:06:57.397+00:00

    Hi, @Song Song Li you have not validated the IP address of Pods. Pods go through AKS load balancer

    1. kubectl run --restart=Never --image=raesene/alpine-nettools nettools
    2. kubectl exec -it nettools -- /bin/sh
    3. inside the pod execute curl ifconfig.me
      to get the external IP address of the load balancer of aks it is static and will not change.

    Please let me know if this helps.

    Regards
    Geetha


  2. Song Song Li 21 Reputation points
    2022-04-12T13:36:36.717+00:00

    sure that is useful for me. I will try it again, thank you so much