Changes

Openshift - HAproxy metrics EN

50 bytes added, 19:10, 20 November 2019
Using HAproxy Metric Endpoint
router ClusterIP 172.30.130.191 <none> 80/TCP,443/TCP,1936/TCP 4d
</pre>
You can see that there is an extra port listed upon the default 80 and 433, that which is the '''1936''',that is the port of the metrics endpoint.
==Prometheus integration==
Lets examine the '''Endpoint''' definition of the HAproxy router. Based on that, we can create the Prometheus configuration that will be responsible for finding runtime all the pods running HAproxy instances. We have to find endpoints the OpenShift endpoint object with the name '''router''' that have a port definition called '''1936-tcp'''. Prometheus will extract the port number for the metrics query form this port-definition (/ metrics).
<pre>
# kubectl get Endpoints router -n default -o yaml
Let's look at into the logs in of the side card container running in the Promethues pod (responsible for reloading the configuration).
<pre>
# kubectl logs -c prometheus-server-configmap-reload prometheus-server-75c9d576c9-gjlcr -n mynamespace
</pre>
Let's Lets check the Prometheus logs as well:
<pre>
# kubectl logs -c prometheus-server prometheus-server-75c9d576c9-gjlcr -n mynamespace
Next, open the Promethues console and navigate to the 'target ' page on the console: http://mon.192.168.42.185.nip.io/targets
[[File: ClipCapIt-190722-233253.PNG]]<br>
If there were more routers in the cluster, they would be all appear here listed as separate endpoints.
<br>
<br>
http://people.redhat.com/jrivera/openshift-docs_preview/openshift-origin/glusterfs-review/architecture/networking/haproxy-router.html <br>
At first glance, there are two meaningful metrics provided by the HAproxy. These arethe following:
<br>