You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -17,87 +17,166 @@ The goal of this endpoint, besides the usual resources consumption monitoring, a
17
17
18
18
All the counters are "since CrowdSec start".
19
19
20
+
### Metrics levels
21
+
22
+
The [prometheus configuration](/configuration/crowdsec_configuration.md#prometheus) accepts a `level` parameter that controls the verbosity of exposed metrics. The possible values are:
23
+
24
+
-`none` : no metrics are registered
25
+
-`aggregated` : only aggregated metrics are registered (per-machine and per-bouncer LAPI metrics, per-node parser metrics, decision/alert gauges, and LAPI response time are not available)
26
+
-`full` (default) : all metrics are registered
27
+
28
+
Acquisition metrics are registered per datasource — they only appear when the corresponding datasource is configured.
29
+
20
30
### Metrics details
21
31
22
32
#### Scenarios
23
33
24
-
-`cs_buckets` : number of scenario that currently exist
25
-
-`cs_bucket_created_total` : total number of instantiation of each scenario
26
-
-`cs_bucket_overflowed_total` : total number of overflow of each scenario
27
-
-`cs_bucket_underflowed_total` : total number of underflow of each scenario (bucket was created but expired because of lack of events)
28
-
-`cs_bucket_poured_total` : total number of event poured to each scenario with source as complementary key
34
+
-`cs_buckets` : number of buckets that currently exist (Gauge, labels: `name`)
35
+
-`cs_bucket_instantiation_total` : total number of instantiation of each scenario (Counter, labels: `name`)
36
+
-`cs_bucket_overflowed_total` : total number of overflow of each scenario (Counter, labels: `name`)
37
+
-`cs_bucket_underflowed_total` : total number of underflow of each scenario — bucket was created but expired because of lack of events (Counter, labels: `name`)
38
+
-`cs_bucket_canceled_total` : total number of canceled buckets (Counter, labels: `name`)
39
+
-`cs_bucket_poured_total` : total number of events poured to each scenario (Counter, labels: `source`, `type`, `name`)
29
40
30
41
<details>
31
42
<summary>example</summary>
32
43
33
44
```
34
45
#2030 lines from `/var/log/nginx/access.log` were poured to `crowdsecurity/http-scan-uniques_404` scenario
-`cs_node_hits_total` : how many times an event from a specific source was processed by a parser node :
53
+
-`cs_node_hits_total` : how many times an event from a specific source was processed by a parser node (Counter, labels: `source`, `type`, `name`, `stage`, `acquis_type`)
43
54
44
55
<details>
45
56
<summary>example</summary>
46
57
47
58
```
48
59
# 235 lines from `auth.log` were processed by the `crowdsecurity/dateparse-enrich` parser
-`cs_node_hits_ko_total` : how many times an event from a specific was unsuccessfully parsed by a specific parser
65
+
-`cs_node_hits_ko_total` : how many times an event from a specific source was unsuccessfully parsed by a specific parser (Counter, labels: `source`, `type`, `name`, `stage`, `acquis_type`)
55
66
56
67
<details>
57
68
<summary>example</summary>
58
69
59
70
```
60
71
# 2112 lines from `error.log` failed to be parsed by `crowdsecurity/http-logs`
-`cs_node_hits_ok_total` : how many times an event from a specific source was successfully parsed by a specific parser
77
+
-`cs_node_hits_ok_total` : how many times an event from a specific source was successfully parsed by a specific parser (Counter, labels: `source`, `type`, `name`, `stage`, `acquis_type`)
78
+
79
+
-`cs_node_wl_hits_total` : how many times an event was processed by a whitelist node (Counter, labels: `source`, `type`, `name`, `reason`, `stage`, `acquis_type`)
80
+
-`cs_node_wl_hits_ok_total` : how many times an event was successfully whitelisted by a node (Counter, labels: `source`, `type`, `name`, `reason`, `stage`, `acquis_type`)
81
+
82
+
-`cs_parser_hits_total` : how many times an event from a source has hit the parser (Counter, labels: `source`, `type`)
83
+
-`cs_parser_hits_ok_total` : how many times an event from a source was successfully parsed (Counter, labels: `source`, `type`, `acquis_type`)
84
+
-`cs_parser_hits_ko_total` : how many times an event from a source was unsuccessfully parsed (Counter, labels: `source`, `type`, `acquis_type`)
85
+
86
+
#### Processing
87
+
88
+
-`cs_parsing_time_seconds` : time spent parsing a line (Histogram, labels: `type`, `source`)
89
+
-`cs_bucket_pour_seconds` : time spent pouring an event to buckets (Histogram, labels: `type`, `source`)
67
90
68
-
-`cs_parser_hits_total` : how many times an event from a source has hit the parser
69
-
-`cs_parser_hits_ok_total` : how many times an event from a source was successfully parsed
70
-
-`cs_parser_hits_ko_total` : how many times an event from a source was unsuccessfully parsed
91
+
#### Decisions & Alerts
92
+
93
+
-`cs_active_decisions` : number of active decisions (Gauge, labels: `reason`, `origin`, `action`)
94
+
-`cs_alerts` : number of alerts, excluding CAPI (Gauge, labels: `reason`)
95
+
96
+
#### Application Security Engine
97
+
98
+
-`cs_appsec_reqs_total` : total events processed by the Application Security Engine (Counter, labels: `source`, `appsec_engine`)
99
+
-`cs_appsec_block_total` : total events blocked by the Application Security Engine (Counter, labels: `source`, `appsec_engine`)
-`cs_appsec_parsing_time_seconds` : time spent processing a request by the Application Security Engine (Histogram, labels: `source`, `appsec_engine`)
102
+
-`cs_appsec_inband_parsing_time_seconds` : time spent processing a request by the inband Application Security Engine (Histogram, labels: `source`, `appsec_engine`)
103
+
-`cs_appsec_outband_parsing_time_seconds` : time spent processing a request by the outband Application Security Engine (Histogram, labels: `source`, `appsec_engine`)
71
104
72
105
#### Acquisition
73
106
74
-
Acquisition metrics are split by datasource. The following metrics are available :
107
+
Acquisition metrics are split by datasource. They only appear when the corresponding datasource is configured. The following metrics are available :
75
108
76
109
##### Cloudwatch
77
110
78
-
-`cs_cloudwatch_openstreams_total` : number of opened stream within group (by group)
79
-
-`cs_cloudwatch_stream_hits_total` : number of event read from stream (by group and by stream)
111
+
-`cs_cloudwatch_openstreams_total` : number of opened streams within group (Gauge, labels: `group`)
112
+
-`cs_cloudwatch_stream_hits_total` : number of events read from stream (Counter, labels: `group`, `stream`)
113
+
114
+
##### Docker
115
+
116
+
-`cs_dockersource_hits_total` : total lines that were read (Counter, labels: `source`)
80
117
81
118
##### Files
82
119
83
-
-`cs_filesource_hits_total` : Total lines that were read (by source file)
120
+
-`cs_filesource_hits_total` : total lines that were read (Counter, labels: `source`)
121
+
122
+
##### HTTP
123
+
124
+
-`cs_httpsource_hits_total` : total lines that were read from HTTP source (Counter, labels: `path`, `src`)
84
125
85
126
##### Journald
86
127
87
-
-`cs_journalctlsource_hits_total` : Total lines that were read (by source filter)
128
+
-`cs_journalctlsource_hits_total` : total lines that were read (Counter, labels: `source`)
129
+
130
+
##### Kafka
131
+
132
+
-`cs_kafkasource_hits_total` : total lines that were read from topic (Counter, labels: `topic`)
133
+
134
+
##### Kinesis
135
+
136
+
-`cs_kinesis_stream_hits_total` : number of events read per stream (Counter, labels: `stream`)
137
+
-`cs_kinesis_shards_hits_total` : number of events read per shard (Counter, labels: `stream`, `shard`)
138
+
139
+
##### Kubernetes Audit
140
+
141
+
-`cs_k8sauditsource_hits_total` : total number of events received by k8s-audit source (Counter, labels: `source`)
142
+
-`cs_k8sauditsource_requests_total` : total number of requests received (Counter, labels: `source`)
143
+
144
+
##### Loki
145
+
146
+
-`cs_lokisource_hits_total` : total lines that were read (Counter, labels: `source`)
147
+
148
+
##### S3
149
+
150
+
-`cs_s3_hits_total` : number of events read per bucket (Counter, labels: `bucket`)
151
+
-`cs_s3_objects_total` : number of objects read per bucket (Counter, labels: `bucket`)
152
+
-`cs_s3_sqs_messages_total` : number of SQS messages received per queue (Counter, labels: `queue`)
88
153
89
154
##### Syslog
90
155
91
-
-`cs_syslogsource_hits_total` : Total lines that were received (by the syslog server)
92
-
-`cs_syslogsource_parsed_total` : Total lines that were successfully parsed by the syslog server
156
+
-`cs_syslogsource_hits_total` : total lines that were received (Counter, labels: `source`)
157
+
-`cs_syslogsource_parsed_total` : total lines that were successfully parsed by the syslog server (Counter, labels: `source`, `type`)
158
+
159
+
##### VictoriaLogs
160
+
161
+
-`cs_victorialogssource_hits_total` : total lines that were read (Counter, labels: `source`)
162
+
163
+
##### Windows EventLog
164
+
165
+
-`cs_winevtlogsource_hits_total` : total events that were read (Counter, labels: `source`)
93
166
94
167
#### Local API
95
168
96
-
-`cs_lapi_route_requests_total` : number of calls to each route per method
97
-
-`cs_lapi_machine_requests_total` : number of calls to each route per method grouped by machines
98
-
-`cs_lapi_bouncer_requests_total` : number of calls to each route per method grouped by bouncers
99
-
-`cs_lapi_decisions_ko_total` : number of unsuccessfully responses when bouncers ask for an IP.
100
-
-`cs_lapi_decisions_ok_total` : number of successfully responses when bouncers ask for an IP.
169
+
-`cs_lapi_route_requests_total` : number of calls to each route per method (Counter, labels: `route`, `method`)
170
+
-`cs_lapi_machine_requests_total` : number of calls to each route per method grouped by machines (Counter, labels: `machine`, `route`, `method`)
171
+
-`cs_lapi_bouncer_requests_total` : number of calls to each route per method grouped by bouncers (Counter, labels: `bouncer`, `route`, `method`)
172
+
-`cs_lapi_decisions_ko_total` : number of calls to /decisions that returned nil result (Counter, labels: `bouncer`)
173
+
-`cs_lapi_decisions_ok_total` : number of calls to /decisions that returned non-nil result (Counter, labels: `bouncer`)
174
+
-`cs_lapi_request_duration_seconds` : response time of LAPI (Histogram, labels: `endpoint`, `method`)
175
+
176
+
#### Cache
177
+
178
+
-`cs_cache_size` : entries per cache (Gauge, labels: `name`, `type`)
179
+
-`cs_regexp_cache_size` : entries per regexp cache (Gauge, labels: `name`)
0 commit comments