Monitor Service Proxies with Prometheus
Membrane Service Proxy collects statistics for your services proxies. These statistics can be made available with Membranes Prometheus interceptor. The collected statistics are consumable by the Prometheus ecosystem out of the box.
order_api_code_200_count 18 order_api_code_200_min 3 ms order_api_code_200_max 60 ms order_api_code_200_avg 26.778 ms ...
Listing 1: Prometheus interceptor output
Listing 1 shows an example output of the Prometheus interceptor.
Setup Prometheus Monitoring
Setting up monitoring for Prometheus is easy. Have a look at the configuration in listing 2.
<api name="Prometheus Monitoring" port="8080"> <path>/prometheus</path> <prometheus/> </api>
Listing 2: Configuration to collect statistics
With this configuration monitoring data is served on localhost:8080/prometheus. The interceptor chain will not continue beyond this interceptor as it returns the collected data directly.