- Minor changes in the interface of the library.
- Significant changes in names of the exposed metrics.
- Latency summaries (quantiles computed on the client side) are temporary not available. Histograms (quntiles computer on the server side) are not affected.
makeMetersis not simplymeters. It does not register anything but returns a Prometheus metric that you’ll need to register and then pass the result tomonitorServant.monitorServantno longer takes a proxy that specifies the server API as the API can be extracted from the type of the value thatmetersreturns.
This brings the interface more in line with what prometheus-client
provides for its own metric types.
In short, change:
meters <- SP.makeMeters appApi NoQuantiles
run {- ... -} $ SP.monitorServant appApi meters appto
meters <- P.register $ SP.meters appApi
run {- ... -} $ SP.monitorServant meters appservant_path_<path>_<method>_http_status{status_code=<status>}→http_responses_total{path=<path>, method=<method>, status=<status>}servant_path_<path>_<method>_in_flight→http_requests_in_flight{path=<path>, method=<method>}servant_path_<path>_<method>_time_ms→http_request_duration_seconds{path=<path>, method=<method>}(the value is now in seconds rather than ms)
These names are more in line with the examples given in the Prometheus
documentation. The path and method components have been moved
from the metric name to labels to allow for aggregation over endpoints.
Example of a new metric:
http_responses_total{path="profile/:username",method="GET",status="2XX"} 5.0
Also now all metrics with all possible (according to the API definition) labels are initialised on start of the application in line with the recommendations from the Prometheus documentation.
- Histograms (buckets) are now computed unconditionally as their are cheap.
- Default histogram buckets are slightly more fine-grained. They will become configurable in a future version.
- Summaries are temporary unavilable. They will be brought in a future version and will be configurable per-endpoint as before.
- Bump LTS to 14.
- Support servant 0.15 and 0.16.
- Use
getSystemTimeinstead ofgetCurrentTime. - Test are temporarily broken (please, help fix them!).