|
@@ -32,10 +32,11 @@ Javier Gallart
|
|
|
3.1. xhttp_prom_buf_size (integer)
|
|
|
3.2. xhttp_prom_timeout (integer)
|
|
|
3.3. xhttp_prom_stats (str)
|
|
|
- 3.4. xhttp_prom_beginning (str)
|
|
|
- 3.5. prom_counter (str)
|
|
|
- 3.6. prom_gauge (str)
|
|
|
- 3.7. prom_histogram (str)
|
|
|
+ 3.4. xhttp_prom_pkg_stats (str)
|
|
|
+ 3.5. xhttp_prom_beginning (str)
|
|
|
+ 3.6. prom_counter (str)
|
|
|
+ 3.7. prom_gauge (str)
|
|
|
+ 3.8. prom_histogram (str)
|
|
|
|
|
|
4. Functions
|
|
|
|
|
@@ -61,27 +62,28 @@ Javier Gallart
|
|
|
1.1. Set xhttp_prom_buf_size parameter
|
|
|
1.2. Set xhttp_prom_timeout parameter
|
|
|
1.3. Set xhttp_prom_stats parameter
|
|
|
- 1.4. Set xhttp_prom_beginning parameter
|
|
|
- 1.5. prom_counter label example
|
|
|
- 1.6. Set prom_counter parameter
|
|
|
- 1.7. prom_gauge label example
|
|
|
- 1.8. Set prom_gauge parameter
|
|
|
- 1.9. prom_histogram label example
|
|
|
- 1.10. Set prom_histogram parameter
|
|
|
- 1.11. prom_counter_reset usage
|
|
|
- 1.12. prom_gauge_reset usage
|
|
|
- 1.13. prom_counter_inc usage
|
|
|
- 1.14. prom_gauge_set usage
|
|
|
- 1.15. prom_histogram_observe usage
|
|
|
- 1.16. prom_dispatch usage
|
|
|
- 1.17. prom_dispatch usage (more complete)
|
|
|
- 1.18. prom_check_uri usage
|
|
|
- 1.19. xhttp_prom.counter_reset usage
|
|
|
- 1.20. xhttp_prom.counter_inc usage
|
|
|
- 1.21. xhttp_prom.gauge_reset usage
|
|
|
- 1.22. xhttp_prom.gauge_set usage
|
|
|
- 1.23. xhttp_prom.histogram_observe usage
|
|
|
- 1.24. xhttp_prom.metric_list_print usage
|
|
|
+ 1.4. Set xhttp_prom_pkg_stats parameter
|
|
|
+ 1.5. Set xhttp_prom_beginning parameter
|
|
|
+ 1.6. prom_counter label example
|
|
|
+ 1.7. Set prom_counter parameter
|
|
|
+ 1.8. prom_gauge label example
|
|
|
+ 1.9. Set prom_gauge parameter
|
|
|
+ 1.10. prom_histogram label example
|
|
|
+ 1.11. Set prom_histogram parameter
|
|
|
+ 1.12. prom_counter_reset usage
|
|
|
+ 1.13. prom_gauge_reset usage
|
|
|
+ 1.14. prom_counter_inc usage
|
|
|
+ 1.15. prom_gauge_set usage
|
|
|
+ 1.16. prom_histogram_observe usage
|
|
|
+ 1.17. prom_dispatch usage
|
|
|
+ 1.18. prom_dispatch usage (more complete)
|
|
|
+ 1.19. prom_check_uri usage
|
|
|
+ 1.20. xhttp_prom.counter_reset usage
|
|
|
+ 1.21. xhttp_prom.counter_inc usage
|
|
|
+ 1.22. xhttp_prom.gauge_reset usage
|
|
|
+ 1.23. xhttp_prom.gauge_set usage
|
|
|
+ 1.24. xhttp_prom.histogram_observe usage
|
|
|
+ 1.25. xhttp_prom.metric_list_print usage
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
|
|
|
@@ -98,10 +100,11 @@ Chapter 1. Admin Guide
|
|
|
3.1. xhttp_prom_buf_size (integer)
|
|
|
3.2. xhttp_prom_timeout (integer)
|
|
|
3.3. xhttp_prom_stats (str)
|
|
|
- 3.4. xhttp_prom_beginning (str)
|
|
|
- 3.5. prom_counter (str)
|
|
|
- 3.6. prom_gauge (str)
|
|
|
- 3.7. prom_histogram (str)
|
|
|
+ 3.4. xhttp_prom_pkg_stats (str)
|
|
|
+ 3.5. xhttp_prom_beginning (str)
|
|
|
+ 3.6. prom_counter (str)
|
|
|
+ 3.7. prom_gauge (str)
|
|
|
+ 3.8. prom_histogram (str)
|
|
|
|
|
|
4. Functions
|
|
|
|
|
@@ -169,10 +172,11 @@ Chapter 1. Admin Guide
|
|
|
3.1. xhttp_prom_buf_size (integer)
|
|
|
3.2. xhttp_prom_timeout (integer)
|
|
|
3.3. xhttp_prom_stats (str)
|
|
|
- 3.4. xhttp_prom_beginning (str)
|
|
|
- 3.5. prom_counter (str)
|
|
|
- 3.6. prom_gauge (str)
|
|
|
- 3.7. prom_histogram (str)
|
|
|
+ 3.4. xhttp_prom_pkg_stats (str)
|
|
|
+ 3.5. xhttp_prom_beginning (str)
|
|
|
+ 3.6. prom_counter (str)
|
|
|
+ 3.7. prom_gauge (str)
|
|
|
+ 3.8. prom_histogram (str)
|
|
|
|
|
|
3.1. xhttp_prom_buf_size (integer)
|
|
|
|
|
@@ -233,7 +237,21 @@ modparam("xhttp_prom", "xhttp_prom_stats", "200_replies")
|
|
|
modparam("xhttp_prom", "xhttp_prom_stats", "")
|
|
|
...
|
|
|
|
|
|
-3.4. xhttp_prom_beginning (str)
|
|
|
+3.4. xhttp_prom_pkg_stats (str)
|
|
|
+
|
|
|
+ Enable or disable internal Kamailio pkg memory statistics.
|
|
|
+
|
|
|
+ If not 0, pkg memory statistics will be displayed.
|
|
|
+
|
|
|
+ Default value is 0 (no pkg memory statistics).
|
|
|
+
|
|
|
+ Example 1.4. Set xhttp_prom_pkg_stats parameter
|
|
|
+...
|
|
|
+# enable pkg stats
|
|
|
+modparam("xhttp_prom", "xhttp_prom_pkg_stats", 1)
|
|
|
+...
|
|
|
+
|
|
|
+3.5. xhttp_prom_beginning (str)
|
|
|
|
|
|
Specifies beginning of string the metrics are build with.
|
|
|
|
|
@@ -243,7 +261,7 @@ modparam("xhttp_prom", "xhttp_prom_stats", "")
|
|
|
Void string "" is also allowed, meaning no prefix string for every
|
|
|
metric name.
|
|
|
|
|
|
- Example 1.4. Set xhttp_prom_beginning parameter
|
|
|
+ Example 1.5. Set xhttp_prom_beginning parameter
|
|
|
...
|
|
|
# All metrics will start with "my_metric_".
|
|
|
modparam("xhttp_prom", "xhttp_prom_beginning", "my_metric_")
|
|
@@ -252,7 +270,7 @@ modparam("xhttp_prom", "xhttp_prom_beginning", "my_metric_")
|
|
|
modparam("xhttp_prom", "xhttp_prom_beginning", "");
|
|
|
...
|
|
|
|
|
|
-3.5. prom_counter (str)
|
|
|
+3.6. prom_counter (str)
|
|
|
|
|
|
Create a counter metric.
|
|
|
|
|
@@ -268,13 +286,13 @@ modparam("xhttp_prom", "xhttp_prom_beginning", "");
|
|
|
parameter at most allowed in counters. Each label name is separated
|
|
|
by : without spaces. At most only three label names allowed in each
|
|
|
label parameter.
|
|
|
- Example 1.5. prom_counter label example
|
|
|
+ Example 1.6. prom_counter label example
|
|
|
# Create two labels called method and handler
|
|
|
label = method:handler
|
|
|
This would generate {method="whatever", handler="whatever2"} when building
|
|
|
the metric.
|
|
|
|
|
|
- Example 1.6. Set prom_counter parameter
|
|
|
+ Example 1.7. Set prom_counter parameter
|
|
|
...
|
|
|
|
|
|
# Create cnt_first counter with no labels.
|
|
@@ -292,7 +310,7 @@ using it by prom_counter_inc or prom_counter_reset functions.
|
|
|
|
|
|
...
|
|
|
|
|
|
-3.6. prom_gauge (str)
|
|
|
+3.7. prom_gauge (str)
|
|
|
|
|
|
Create a gauge metric.
|
|
|
|
|
@@ -308,13 +326,13 @@ using it by prom_counter_inc or prom_counter_reset functions.
|
|
|
parameter at most allowed in gauges. Each label name is separated
|
|
|
by : without spaces. At most only three label names allowed inside
|
|
|
each label parameter.
|
|
|
- Example 1.7. prom_gauge label example
|
|
|
+ Example 1.8. prom_gauge label example
|
|
|
# Create two labels called method and handler
|
|
|
label = method:handler
|
|
|
This would generate {method="whatever", handler="whatever2"} when building
|
|
|
the metric.
|
|
|
|
|
|
- Example 1.8. Set prom_gauge parameter
|
|
|
+ Example 1.9. Set prom_gauge parameter
|
|
|
...
|
|
|
|
|
|
# Create gg_first gauge with no labels
|
|
@@ -329,7 +347,7 @@ modparam("xhttp_prom", "prom_gauge", "name=gg_third; label=method:handler;");
|
|
|
|
|
|
...
|
|
|
|
|
|
-3.7. prom_histogram (str)
|
|
|
+3.8. prom_histogram (str)
|
|
|
|
|
|
Create a histogram metric.
|
|
|
|
|
@@ -345,7 +363,7 @@ modparam("xhttp_prom", "prom_gauge", "name=gg_third; label=method:handler;");
|
|
|
parameter at most allowed in histograms. Each label name is
|
|
|
separated by : without spaces. At most only three label names
|
|
|
allowed in each label parameter.
|
|
|
- Example 1.9. prom_histogram label example
|
|
|
+ Example 1.10. prom_histogram label example
|
|
|
# Create two labels called method and handler
|
|
|
label = method:handler
|
|
|
This would generate {method="whatever", handler="whatever2"} when building
|
|
@@ -360,7 +378,7 @@ the metric.
|
|
|
values:
|
|
|
[0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10]
|
|
|
|
|
|
- Example 1.10. Set prom_histogram parameter
|
|
|
+ Example 1.11. Set prom_histogram parameter
|
|
|
...
|
|
|
|
|
|
# Create my_histo histogram with no labels and default buckets.
|
|
@@ -406,7 +424,7 @@ using it by prom_histogram_observe function.
|
|
|
Available via KEMI framework as counter_reset_l0, counter_reset_l1,
|
|
|
counter_reset_l2 and counter_reset_l3.
|
|
|
|
|
|
- Example 1.11. prom_counter_reset usage
|
|
|
+ Example 1.12. prom_counter_reset usage
|
|
|
...
|
|
|
# Definition of counter with prom_counter with labels method and IP
|
|
|
modparam("xhttp_prom", "prom_counter", "name=cnt01; label=method:IP;");
|
|
@@ -434,7 +452,7 @@ kamailio_cnt01 {method="push", IP="192.168.0.1"} 0 1234567890
|
|
|
Available via KEMI framework as gauge_reset_l0, gauge_reset_l1,
|
|
|
gauge_reset_l2 and gauge_reset_l3.
|
|
|
|
|
|
- Example 1.12. prom_gauge_reset usage
|
|
|
+ Example 1.13. prom_gauge_reset usage
|
|
|
...
|
|
|
# Definition of gauge with prom_gauge with labels method and IP
|
|
|
modparam("xhttp_prom", "prom_gauge", "name=cnt01; label=method:IP;");
|
|
@@ -464,7 +482,7 @@ kamailio_cnt01 {method="push", IP="192.168.0.1"} 0 1234567890
|
|
|
Available via KEMI framework as counter_inc_l0, counter_inc_l1,
|
|
|
counter_inc_l2 and counter_inc_l3.
|
|
|
|
|
|
- Example 1.13. prom_counter_inc usage
|
|
|
+ Example 1.14. prom_counter_inc usage
|
|
|
...
|
|
|
# Definition of cnt01 counter with no labels.
|
|
|
modparam("xhttp_prom", "prom_counter", "name=cnt01;");
|
|
@@ -501,7 +519,7 @@ kamailio_cnt02 {method="push", IP="192.168.0.1"} 15 1234567890
|
|
|
Available via KEMI framework as gauge_set_l0, gauge_set_l1,
|
|
|
gauge_set_l2 and gauge_set_l3.
|
|
|
|
|
|
- Example 1.14. prom_gauge_set usage
|
|
|
+ Example 1.15. prom_gauge_set usage
|
|
|
...
|
|
|
# Definition of gg01 gauge with no labels.
|
|
|
modparam("xhttp_prom", "prom_gauge", "name=gg01;");
|
|
@@ -538,7 +556,7 @@ kamailio_gg02 {method="push", IP="192.168.0.1"} 2.8 1234567890
|
|
|
Available via KEMI framework as histogram_observe_l0,
|
|
|
histogram_observe_l1, histogram_observe_l2 and histogram_observe_l3.
|
|
|
|
|
|
- Example 1.15. prom_histogram_observe usage
|
|
|
+ Example 1.16. prom_histogram_observe usage
|
|
|
...
|
|
|
# Definition of hist01 histogram with no labels and default buckets.
|
|
|
modparam("xhttp_prom", "prom_histogram", "name=hist01;");
|
|
@@ -571,7 +589,7 @@ hist02_count{method="push", IP="192.168.0.1"} 1 1592574659768
|
|
|
|
|
|
Available via KEMI framework as xhttp_prom.dispatch
|
|
|
|
|
|
- Example 1.16. prom_dispatch usage
|
|
|
+ Example 1.17. prom_dispatch usage
|
|
|
...
|
|
|
# Needed to use SIP frames as HTTP ones.
|
|
|
tcp_accept_no_cl=yes
|
|
@@ -594,7 +612,7 @@ event_route[xhttp:request] {
|
|
|
}
|
|
|
...
|
|
|
|
|
|
- Example 1.17. prom_dispatch usage (more complete)
|
|
|
+ Example 1.18. prom_dispatch usage (more complete)
|
|
|
|
|
|
Another example with counters and gauge:
|
|
|
...
|
|
@@ -674,7 +692,7 @@ kamailio_sl_xxx_replies 0 1554839325461
|
|
|
|
|
|
Available via KEMI framework as xhttp_prom.check_uri
|
|
|
|
|
|
- Example 1.18. prom_check_uri usage
|
|
|
+ Example 1.19. prom_check_uri usage
|
|
|
...
|
|
|
# Needed to use SIP frames as HTTP ones.
|
|
|
tcp_accept_no_cl=yes
|
|
@@ -717,7 +735,7 @@ event_route[xhttp:request] {
|
|
|
* l1: value of second label (optional)
|
|
|
* l2: value of the third label (optional)
|
|
|
|
|
|
- Example 1.19. xhttp_prom.counter_reset usage
|
|
|
+ Example 1.20. xhttp_prom.counter_reset usage
|
|
|
...
|
|
|
kamcmd xhttp_prom.counter_reset "cnt01" "push" "192.168.0.1"
|
|
|
...
|
|
@@ -736,7 +754,7 @@ event_route[xhttp:request] {
|
|
|
* l1: value of second label (optional)
|
|
|
* l2: value of the third label (optional)
|
|
|
|
|
|
- Example 1.20. xhttp_prom.counter_inc usage
|
|
|
+ Example 1.21. xhttp_prom.counter_inc usage
|
|
|
...
|
|
|
kamcmd xhttp_prom.counter_inc "cnt01" 15 "push" "192.168.0.1"
|
|
|
...
|
|
@@ -753,7 +771,7 @@ event_route[xhttp:request] {
|
|
|
* l1: value of second label (optional)
|
|
|
* l2: value of the third label (optional)
|
|
|
|
|
|
- Example 1.21. xhttp_prom.gauge_reset usage
|
|
|
+ Example 1.22. xhttp_prom.gauge_reset usage
|
|
|
...
|
|
|
kamcmd xhttp_prom.gauge_reset "gg01" "push" "192.168.0.1"
|
|
|
...
|
|
@@ -771,7 +789,7 @@ event_route[xhttp:request] {
|
|
|
* l1: value of second label (optional)
|
|
|
* l2: value of the third label (optional)
|
|
|
|
|
|
- Example 1.22. xhttp_prom.gauge_set usage
|
|
|
+ Example 1.23. xhttp_prom.gauge_set usage
|
|
|
...
|
|
|
kamcmd xhttp_prom.gauge_set "gg01" -- -5.2
|
|
|
...
|
|
@@ -790,7 +808,7 @@ event_route[xhttp:request] {
|
|
|
* l1: value of second label (optional)
|
|
|
* l2: value of the third label (optional)
|
|
|
|
|
|
- Example 1.23. xhttp_prom.histogram_observe usage
|
|
|
+ Example 1.24. xhttp_prom.histogram_observe usage
|
|
|
...
|
|
|
kamcmd xhttp_prom.histogram_observe "hist01" -- -5.2
|
|
|
...
|
|
@@ -806,7 +824,7 @@ event_route[xhttp:request] {
|
|
|
NOTE:: If you list a lot of metrics you may need to increase buffer
|
|
|
size of your RPC transport layer.
|
|
|
|
|
|
- Example 1.24. xhttp_prom.metric_list_print usage
|
|
|
+ Example 1.25. xhttp_prom.metric_list_print usage
|
|
|
...
|
|
|
kamcmd xhttp_prom.metric_list_print
|
|
|
...
|