|
@@ -4,6 +4,10 @@
|
|
|
|
|
|
#if !defined(TURN_NO_PROMETHEUS)
|
|
|
|
|
|
+prom_counter_t *stun_binding_request;
|
|
|
+prom_counter_t *stun_binding_response;
|
|
|
+prom_counter_t *stun_binding_error;
|
|
|
+
|
|
|
prom_counter_t *turn_traffic_rcvp;
|
|
|
prom_counter_t *turn_traffic_rcvb;
|
|
|
prom_counter_t *turn_traffic_sentp;
|
|
@@ -41,7 +45,15 @@ void start_prometheus_server(void) {
|
|
|
nlabels++;
|
|
|
}
|
|
|
|
|
|
- // Create traffic counter metrics
|
|
|
+ // Create STUN counters
|
|
|
+ stun_binding_request = prom_collector_registry_must_register_metric(
|
|
|
+ prom_counter_new("stun_binding_request", "Incoming STUN Binding requests", 0, NULL));
|
|
|
+ stun_binding_response = prom_collector_registry_must_register_metric(
|
|
|
+ prom_counter_new("stun_binding_response", "Outgoing STUN Binding responses", 0, NULL));
|
|
|
+ stun_binding_error = prom_collector_registry_must_register_metric(
|
|
|
+ prom_counter_new("stun_binding_error", "STUN Binding errors", 0, NULL));
|
|
|
+
|
|
|
+ // Create TURN traffic counter metrics
|
|
|
turn_traffic_rcvp = prom_collector_registry_must_register_metric(
|
|
|
prom_counter_new("turn_traffic_rcvp", "Represents finished sessions received packets", nlabels, label));
|
|
|
turn_traffic_rcvb = prom_collector_registry_must_register_metric(
|
|
@@ -160,6 +172,24 @@ void prom_dec_allocation(SOCKET_TYPE type) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void prom_inc_stun_binding_request(void) {
|
|
|
+ if (turn_params.prometheus == 1) {
|
|
|
+ prom_counter_add(stun_binding_request, 1, NULL);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void prom_inc_stun_binding_response(void) {
|
|
|
+ if (turn_params.prometheus == 1) {
|
|
|
+ prom_counter_add(stun_binding_response, 1, NULL);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void prom_inc_stun_binding_error(void) {
|
|
|
+ if (turn_params.prometheus == 1) {
|
|
|
+ prom_counter_add(stun_binding_error, 1, NULL);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
#else
|
|
|
|
|
|
void start_prometheus_server(void) {
|