ngx-export-tools-extra 0.5.6.0 → 0.5.6.1
raw patch · 3 files changed
+22/−17 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Changelog.md +4/−0
- NgxExport/Tools/Prometheus.hs +17/−16
- ngx-export-tools-extra.cabal +1/−1
Changelog.md view
@@ -1,3 +1,7 @@+### 0.5.6.1++- Fixed wrong partitioning of gauges and counters from *special* counters.+ ### 0.5.6.0 - Added labeled parameterization for all supported types of metrics by using
NgxExport/Tools/Prometheus.hs view
@@ -459,7 +459,7 @@ cntsH'' = M.mapWithKey (\k -> toHistogram cntsH' k . range) hs'' in (cntsH'', cntsC', cntsG')- (cntsOC, cntsOG) = M.partitionWithKey gCounter $ toValues ocnts+ (cntsOG, cntsOC) = M.partitionWithKey gCounter $ toValues ocnts -- the _err counters from the Nginx custom counters module will be -- automatically deleted in such ordering of unions, but only if there -- are custom labels (i.e. annotations) for the given histogram@@ -885,18 +885,18 @@ -- $parameterization -- -- In the previous examples we used many counters which served similar purposes.--- For example, counters /cnt_4xx/, /cnt_5xx/, /cnt_u_4xx/, and /cnt_u_5xx/ all+-- For example, counters /cnt_4xx/, /cnt_5xx/, /cnt_u_4xx/, and /cnt_u_5xx/ -- counted response statuses in different conditions: particularly, the 2 former -- counters counted /4xx/ and /5xx/ response statuses sent to clients, while the -- latter 2 counters counted /4xx/ and /5xx/ response statuses received from the--- upstreams. It looks like they could be shown as a single compound counter--- parameterized by the value and the origin. We also had two histograms--- /hst_request_time/ and /hst_u_response_time/ which could be combined in a--- single entity parameterized by the scope (the time of the whole request--- against the time spent in the upstream).+-- upstream. It feels that they could be shown as a single compound counter+-- parameterized by the range of values and the origin. We also had two+-- histograms /hst_request_time/ and /hst_u_response_time/ which could also be+-- combined in a single entity parameterized by the scope (the time of the whole+-- request against the time spent in the upstream). -- -- Fortunately, Prometheus provides a mechanism to make such custom--- parameterizations by using metrics /labels/. This module supports the+-- parameterizations by using /labels/ in metrics. This module supports the -- parameterization with labels by expecting special /annotations/ attached to -- the names of the counters. --@@ -981,12 +981,13 @@ -- } -- @ ----- Notice that the 4 status counters are combined into a compound counter--- /cnt_status/ whose name gets annotated by a tail starting with __/\@/__.--- This annotation will be put in the list of labels of the Prometheus metrics--- with symbols __/(/__ and __/)/__ replaced with __/\"/__ but without any--- further validation. The request time histograms and the corresponding sum--- counters are annotated in a similar way.+-- Notice that the 4 status counters were combined into a compound counter+-- /cnt_status/ whose name was annotated by a tail starting with /\@/. This+-- annotation gets put in the list of labels of the Prometheus metrics with+-- symbols /(/ and /)/ replaced by /\"/ without any further validation. The+-- request time histograms and the corresponding sum counters were annotated in+-- a similar way. Annotations in histogram sum counters must be put between the+-- base name of the counter and the suffix /_sum/. -- -- ==== A simple test --@@ -1053,6 +1054,6 @@ -- > hst_request_time_count{scope="total"} 21 -- > hst_request_time_sum{scope="total"} 7.02 ----- Notice that the histogram error counter from /nginx-custom-counters-module/--- is not shown in annotated histograms.+-- Notice that the histogram error counters from /nginx-custom-counters-module/+-- are not shown in annotated histograms.
ngx-export-tools-extra.cabal view
@@ -1,5 +1,5 @@ name: ngx-export-tools-extra-version: 0.5.6.0+version: 0.5.6.1 synopsis: More extra tools for Nginx haskell module description: More extra tools for <https://github.com/lyokha/nginx-haskell-module Nginx haskell module>.