Metrics
Served in the Prometheus text format on http://127.0.0.1:9330/metrics (see metrics). For how to use them during a game, see Watching with metrics.
Counters survive a rules reload and reset when vulnboxd restarts.
Traffic
| metric | type | labels | |
|---|---|---|---|
vulnboxd_connections_total | counter | service, port | client connections accepted |
vulnboxd_connections_open | gauge | service, port | client connections currently open |
vulnboxd_bytes_total | counter | service, port, direction | payload bytes forwarded; direction is in or out |
vulnboxd_http_responses_total | counter | service, port, class | responses by status class: 2xx, 4xx, 5xx, ... |
vulnboxd_upstream_errors_total | counter | service, port | failures to reach the service at all |
Flags
| metric | type | labels | |
|---|---|---|---|
vulnboxd_flags_out_total | counter | service, port | flags in responses sent to clients |
vulnboxd_flags_out_last_tick | gauge | service, port | flags that went out during the last whole tick |
A flag out is one of the game's flags, by its flag format, in something vulnboxd sent back to a client. That is what an attacker is stealing, so a jump here is an exploit working. It counts what is actually sent, after rules have run: a flag a rule rewrote away is not counted, and one a rule decrypts on the way out is.
It needs the flag format, from the config, the game mode or the gameserver. Without one nothing is counted. Responses that are compressed by the service are not read, and neither are the data connections of ftp. Every flag in a response counts, including your own checker's reads, so expect a steady baseline and watch for what rises above it.
vulnboxd_flags_out_last_tick is updated once a tick ends. It is not there for a tick that vulnboxd did not see from start to end, such as the one it was started in.
Rules
| metric | type | labels | |
|---|---|---|---|
vulnboxd_rule_hits_total | counter | service, port, rule, action | times a rule fired; action is blocked, stalled, rewritten or matched |
vulnboxd_rule_hits_dropped_total | counter | rule hits counted above that never made it into <state_dir>/rule-hits.jsonl, the log the agent sends to the hub: the log fell behind a flood of hits, or could not be written. They are still counted and logged, but the hub does not see them | |
vulnboxd_connections_stalled | gauge | service, port | connections held open by a stall rule, out of limits.stalled; at the limit, further stalls block instead |
vulnboxd_bypassed_total | counter | service, port | requests that skipped every rule with a bypass header |
vulnboxd_mirror_total | counter | service, port, rule, result | mirrored requests; result is agrees, body differs, status differs, unreachable or timed out (no answer within deploy.grace + timeouts.http_request); at most 64 comparisons run at once, past that a copy is not sent |
vulnboxd_connections_refused_total | counter | service, port | tcp connections closed on accept because the port carried limits.connections, and udp sessions let go of early for limits.udp_sessions |
rule is the rule's name, or #1, #2, ... by position for rules without one. Name your rules.
A rule set to action: stall counts as stalled whenever it fires, including when the port was already holding limits.stalled connections and it blocked instead. vulnboxd_connections_stalled is what says how many are really being held.
Health
| metric | type | labels | |
|---|---|---|---|
vulnboxd_port_up | gauge | service, port | whether the port answered its last check, 1 or 0 |
vulnboxd_sla_up | gauge | service | whether the game's checker found the service working in the latest tick, 1 or 0; needs a game mode |
Deploys
| metric | type | labels | |
|---|---|---|---|
vulnboxd_deploys_total | counter | service, result | deploys, ok or failed |
vulnboxd_unproxied_bindings | gauge | service | ports Docker publishes where the game can reach them that are not behind the proxy, as of the last deploy (each one also alerts) |
vulnboxd_host_networked_services | gauge | service | compose services on the host network (network_mode: host, the external host network, or network_mode: service: one of those): Docker publishes nothing for them, so nothing of theirs is behind the proxy (also alerts) |
vulnboxd_deploy_ms | gauge | service | how long the last deploy took, in milliseconds |
vulnboxd_builds_total | counter | service, result | builds of a new version, ok or failed |
vulnboxd_git_polls_total | counter | result | git fetches, ok, failed, or skipped while vulnboxd-agent held the checkout longer than 5 s |
vulnboxd_git_background_pushes_total | counter | result | pushes of vulnboxd's own commits (rollbacks, bisect versions, rules) made in the background, ok or failed; a failed one is tried again at every poll |
vulnboxd_rollbacks_total | counter | service, trigger | rollbacks vulnboxd made, health or sla |
vulnboxd_crashed_after_deploy_total | counter | service, outcome | versions that answered after a deploy and then went down, which is never rolled back for (possibly an attack): recovered or down after the second look, and bisect_recheck / bisect_skipped for a version a bisect tests |
vulnboxd_bisects_total | counter | service, trigger | bisects started, by health, checker or manual (counted before the range is known; an automatic one with fewer than min_commits commits ends at once) |
vulnboxd_bisect_running | gauge | service | 1 while a bisect of the service runs |
vulnboxd_bisect_results_total | counter | service, result | bisects that ended: done (culprits reverted, the rest works) or fell_back (gave up and put back the newest version found working) |
vulnboxd_bisect_culprits_total | counter | service | commits a bisect found and reverted |
vulnboxd_services | gauge | services being managed | |
vulnboxd_tick | gauge | the tick it is now, counted from the start time; follows the gameserver's timing when it gives one | |
vulnboxd_game_tick | gauge | the latest tick the gameserver has verdicts for | |
vulnboxd_gameserver_up | gauge | whether the gameserver answered the last time it was asked, 1 or 0 | |
vulnboxd_info | gauge | version | build information, always 1 |
Internals
For debugging vulnboxd itself rather than watching a game: what the proxy holds, how long Git, deploys and docker take, and how the main loop keeps up. The internals dashboard shows them. Durations are in seconds.
Proxy
| metric | type | labels | |
|---|---|---|---|
vulnboxd_proxy_buffered_bytes | gauge | service, port | bytes of HTTP bodies held in memory whole for rules that need the whole body |
vulnboxd_proxy_buffered_total_bytes | gauge | bytes held against limits.buffered_total: every held HTTP body and partial gRPC message, all ports together | |
vulnboxd_proxy_buffer_budget_exhausted_total | counter | dir | bodies or messages that did not fit in limits.buffered_total (or the connection's share, limits.buffered_connection): passed on through the raw contains/regex view only, or refused (503, a response 502) when a rule needed them whole |
vulnboxd_proxy_undecidable_total | counter | service, port, dir, reason | messages the rules could not decide on, by reason (too_large, budget_full, rpc_framing, content_encoding, websocket_too_large, ...) |
vulnboxd_proxy_upstream_connect_seconds | histogram | service, port | getting a connection to the service, waiting out a deploy included; successful ones only |
vulnboxd_proxy_rule_eval_seconds | histogram | service, port, stage | time in the rules: message per HTTP head or whole body, datagram, ftp line or websocket frame; stream per chunk of a streamed body or tcp connection. Ports without rules are not timed |
vulnboxd_proxy_decode_seconds | histogram | service, port, part | decoding one part (target, headers, body) of an HTTP message for rules with decoded or anomalies; only on ports with such rules, and only when the raw form did not already match |
vulnboxd_proxy_decode_failures_total | counter | service, port | parts the decoder failed on; they counted as decoding to nothing, and the message went on |
vulnboxd_proxy_decode_truncated_total | counter | service, port | parts whose decoding stopped at its limits (64 KiB of decoded text, 512 values) |
vulnboxd_proxy_decode_skipped_total | counter | service, port, reason | bodies not decoded although a rule would have looked at their decoded form or anomalies: streamed, too large for limits.buffered_body |
vulnboxd_proxy_pool_idle_connections | gauge | service, port | idle HTTP connections to the service kept for reuse |
vulnboxd_proxy_pool_connections_total | counter | service, port, result | upstream HTTP connections, reused from the pool or new |
vulnboxd_proxy_pool_evictions_total | counter | service, port, reason | pooled connections let go: closed by the service, pool full, cleared before a deploy, or not_keep_alive when the service said it closes the connection after the response (HTTP/1.0 without keep-alive, or Connection: close) |
vulnboxd_proxy_upstream_retries_total | counter | service, port | requests sent again on a fresh connection because a kept one turned out to be closed before any of the answer arrived (idempotent requests, or ones that never left) |
vulnboxd_rule_hits_queue_depth | gauge | rule hits waiting for the writer of rule-hits.jsonl | |
vulnboxd_rule_hits_written_total | counter | rule hits written to it | |
vulnboxd_rule_hits_rotations_total | counter | times it was moved aside for being full | |
vulnboxd_rule_hits_write_seconds | histogram | writing and flushing one batch of rule hits | |
vulnboxd_request_log_written_total | counter | lines written to the request log, requests.jsonl | |
vulnboxd_request_log_dropped_total | counter | requests that never made it into it: the writer fell behind a flood (the queue holds 16384), or the file could not be written. The proxy never waits for the log | |
vulnboxd_request_log_queue_depth | gauge | lines waiting for its writer | |
vulnboxd_request_log_rotations_total | counter | times it was moved aside to requests.jsonl.1 for being full (64 MiB) | |
vulnboxd_request_log_write_seconds | histogram | writing and flushing one batch of lines | |
vulnboxd_request_log_nat_lookups_total | counter | result | conntrack lookups for a new backend connection: translated (DNAT; the line gets nat), not_translated (docker-proxy answered on loopback), not_found, unavailable (conntrack could not be read; tried again a minute later) |
Git
Git is used by vulnboxd and by the agent's rule pushes, so these come in both: as vulnboxd_git_* from vulnboxd and as vulnboxd_agent_git_* from the agent. The two share a lock on each repository's checkout, and these say how long each waited for the other.
| metric | type | labels | |
|---|---|---|---|
vulnboxd_git_op_seconds | histogram | op | how long Git operations took: fetch, push, fast_forward, rebase, commit, restore, and pull, the daemon's whole poll of one repository |
vulnboxd_git_ops_total | counter | op, result | the same, ok, failed, or busy when the checkout lock was held too long by the other process |
vulnboxd_git_checkout_lock_wait_seconds | histogram | waiting for the checkout lock, got or not | |
vulnboxd_git_checkout_lock_timeouts_total | counter | times the lock was given up on | |
vulnboxd_git_checkout_lock_held_seconds | histogram | how long the lock was held |
Deploys and docker
| metric | type | labels | |
|---|---|---|---|
vulnboxd_deploy_step_seconds | histogram | service, step | each step of getting a version live: build (compose build and pull), deploy (the override and up), settle (waiting for health), revert (a health rollback) |
vulnboxd_service_transitions_total | counter | service, to | changes of a service's deploy state, by the state it went into: live, building, waiting, deploying, failed, rolled_back |
vulnboxd_service_state | gauge | service, state | 1 for the state the service is in, 0 for the others |
vulnboxd_compose_command_seconds | histogram | command | docker compose commands: up, build, pull, ps, down, stop, restart, other |
vulnboxd_compose_commands_total | counter | command, result | the same, ok, failed, timeout when it ran past its limit (deploy.build_timeout, deploy.up_timeout) and was killed, or error when docker could not be run at all |
vulnboxd_inventory_refreshes_total | counter | result | refreshes of the container inventory, ok or failed (a docker call failed or timed out) |
vulnboxd_inventory_refresh_seconds | histogram | one refresh: the containers of each service, their docker inspect, /proc | |
vulnboxd_inventory_event_refreshes_total | counter | refreshes asked for by Docker's events (a container started, died or changed health), besides the interval's | |
vulnboxd_docker_api_requests_total | counter | call, result | requests to the Docker API: call is list, inspect, network_inspect, version (and others' calls through the shared client); result is ok, not_found, error or timeout |
vulnboxd_docker_api_request_seconds | histogram | call | one request, its answer read |
vulnboxd_docker_api_fallbacks_total | counter | call | times the CLI was run because the API could not answer: compose_ps, inspect, network_inspect |
vulnboxd_docker_events_total | counter | action | container events from Docker's event stream: create, start, restart, die, oom, destroy, health_status, other |
vulnboxd_inventory_writes_total | counter | times inventory.json was rewritten because something in it changed (or it was due) | |
vulnboxd_inventory_containers | gauge | containers in it | |
vulnboxd_inventory_docker_proxy_ports | gauge | proxied ports whose loopback hop goes through docker-proxy, which the request log cannot follow into the container; 0 with userland-proxy: false |
Loops, gameserver, alerts and handover
| metric | type | labels | |
|---|---|---|---|
vulnboxd_main_loop_seconds | histogram | branch | the main loop handling one wakeup, by what woke it: window, reload, poll, monitor, game, event |
vulnboxd_loop_seconds | histogram | loop | one run of a periodic job: poll (Git), monitor (port checks), game (the gameserver's report) |
vulnboxd_loop_lag_seconds | histogram | loop | how late a periodic job started against its schedule, reload too; for the others this includes waiting for the run before |
vulnboxd_game_request_seconds | histogram | kind | questions to the gameserver: report, flag_ids, vulnbox; the agent's are vulnboxd_agent_game_* |
vulnboxd_game_requests_total | counter | kind, result | the same, ok or failed |
vulnboxd_alerts_total | counter | result | webhook alerts sent, failed, or dropped with the queue closed; the agent's and the broker's are vulnboxd_agent_alerts_total and vulnboxd_pcap_alerts_total |
vulnboxd_alert_send_seconds | histogram | sending one alert, waiting out the webhook's rate limit included | |
vulnboxd_alerts_queue_depth | gauge | alerts waiting to be sent | |
vulnboxd_handovers_total | counter | mode, result | upgrades handing over to a new build: drain or exec, handed_over or failed (a successful exec replaces the process, so it never counts one) |
vulnboxd_handover_seconds | histogram | from starting the new build to handing everything over | |
vulnboxd_handover_sockets_inherited | gauge | listening sockets taken over from the daemon before | |
vulnboxd_handover_sockets_passed | gauge | listening sockets passed on at the last handover | |
vulnboxd_drain_seconds | histogram | finishing open connections after handing over | |
vulnboxd_drain_abandoned_connections | gauge | connections still open when the drain ran out of time | |
vulnboxd_manager_lock_wait_seconds | histogram | waiting at start for the daemon before to stop managing the services | |
vulnboxd_manager_held | gauge | whether this daemon manages the services, 1 or 0 |
vulnboxd-agent
vulnboxd-agent serves its own metrics on http://127.0.0.1:9331/metrics (see agent.metrics), next to its process, runtime and task metrics under the prefix vulnboxd_agent. They are for debugging the agent — a backlog, a stalled hub, a filling spool — and start again from 0 when it restarts. Durations are in seconds.
Uplink
| metric | type | labels | |
|---|---|---|---|
vulnboxd_agent_uplink_connected | gauge | whether a session with the hub is up, 1 or 0 | |
vulnboxd_agent_uplink_sessions_total | counter | sessions that got as far as the hub's Welcome | |
vulnboxd_agent_uplink_disconnects_total | counter | reason | connections that ended or never started: connect (TCP), handshake (TLS), timeout (the hub stopped answering, reading or acknowledging), closed, protocol, io |
vulnboxd_agent_uplink_frames_total | counter | direction, type | frames sent and received, by type: hello, welcome, segment, gap, ack, manifest, events, heartbeat, state, rules_push, rules_result, proxy_log, inventory, file_pull, file_result, service_files_request, service_files_reply, files_push, files_result |
vulnboxd_agent_uplink_frames_skipped_total | counter | frames left out because they were too large for the hub to read | |
vulnboxd_agent_uplink_bytes_total | counter | direction | bytes sent and received on the connection, before TLS |
vulnboxd_agent_uplink_send_seconds | histogram | writing one frame; a hub that reads slowly shows here first | |
vulnboxd_agent_uplink_ack_seconds | histogram | from sending a segment to the hub acknowledging it | |
vulnboxd_agent_uplink_segments_in_flight | gauge | segments sent and not acknowledged yet | |
vulnboxd_agent_uplink_window | gauge | how many segments the hub lets be in flight | |
vulnboxd_agent_uplink_mailbox_letters | gauge | kind | frames that must reach the hub waiting to go: events (rule hits), rules_result, proxy_log (requests), file_result, service_files_reply (snapshots) and files_result (file push steps) |
Spool
| metric | type | labels | |
|---|---|---|---|
vulnboxd_agent_spool_segments | gauge | place | segments held for the hub, on disk or in memory |
vulnboxd_agent_spool_bytes | gauge | place | bytes held: allocated blocks on disk, compressed payload in memory |
vulnboxd_agent_spool_budget_bytes | gauge | what the spool may use on disk, as of its last look | |
vulnboxd_agent_spool_disk_free_bytes | gauge | free space on its filesystem, as of its last look | |
vulnboxd_agent_spool_memory_only | gauge | 1 while capture is kept in memory only (no room, a failing disk, or max_size: 0) | |
vulnboxd_agent_spool_gaps_pending | gauge | gaps (capture given up) the hub has not been told about yet | |
vulnboxd_agent_spool_oldest_unacked_age_seconds | gauge | how old the oldest capture not acknowledged yet is; 0 when the hub has everything | |
vulnboxd_agent_spool_writer_queue | gauge | segments cut and waiting for the spool's writer; at 16 the capture starts losing them | |
vulnboxd_agent_spool_store_seconds | histogram | the writer's work for one segment: compressing and storing it | |
vulnboxd_agent_spool_write_seconds | histogram | writing one segment file, fsync included | |
vulnboxd_agent_spool_fsync_seconds | histogram | the fsync alone | |
vulnboxd_agent_spool_delete_seconds | histogram | deleting one segment file | |
vulnboxd_agent_spool_budget_recomputations_total | counter | times the spool looked at the filesystem and worked its budget out again | |
vulnboxd_agent_spool_disk_fallbacks_total | counter | reason | times it went to memory only for a while: no_room or write_failed |
vulnboxd_agent_spool_acked_segments_total | counter | segments the hub acknowledged | |
vulnboxd_agent_spool_stored_segments_total | counter | kind | segments the writer stored, on disk or in memory: packets or host_events |
vulnboxd_agent_spool_dropped_segments_total | counter | reason | segments given up before the hub had them: writer_behind (the capture could not hand them over), disk_budget, memory_budget, too_large |
vulnboxd_agent_spool_dropped_bytes_total | counter | reason | the bytes of those; raw for writer_behind, compressed otherwise |
Every dropped segment is also a gap the hub is told about. Host events share the spool and its budget with the capture, so these count both.
Capture
| metric | type | labels | |
|---|---|---|---|
vulnboxd_agent_capture_connected | gauge | whether the agent is reading the broker, 1 or 0 | |
vulnboxd_agent_capture_reconnects_total | counter | times the connection to the broker was lost or could not be made | |
vulnboxd_agent_capture_packets_total | counter | packets read from the broker | |
vulnboxd_agent_capture_bytes_total | counter | captured bytes of those packets | |
vulnboxd_agent_capture_backlog | gauge | packets read and not yet cut into segments; near 4096 the reader waits, and the broker may drop the agent | |
vulnboxd_agent_capture_segments_total | counter | result | segments cut: queued for the writer, or lost because it was behind |
vulnboxd_agent_capture_segment_age_seconds | histogram | how long a segment had been collecting when it was cut; about 1 s when quiet, less when busy |
Host events
| metric | type | labels | |
|---|---|---|---|
vulnboxd_agent_sensor_connected | gauge | whether vulnboxd-sensor is connected and said hello, 1 or 0 | |
vulnboxd_agent_sensor_connections_total | counter | connections from the sensor accepted | |
vulnboxd_agent_sensor_replaced_total | counter | connections closed because a newer one arrived | |
vulnboxd_agent_sensor_rejected_total | counter | reason | connections refused: peer (another user), version, no_hello |
vulnboxd_agent_sensor_decode_errors_total | counter | connections closed because a frame did not read | |
vulnboxd_agent_host_events_total | counter | host events taken from the sensor | |
vulnboxd_agent_host_events_dropped_total | counter | reason | host events the agent dropped: channel_full (the cutter was behind) or writer_behind (the spool's writer was) |
vulnboxd_agent_host_events_sensor_lost_total | counter | host events the sensor reported it lost itself | |
vulnboxd_agent_host_events_backlog | gauge | events taken and not yet cut into segments; at 65536 the agent drops them | |
vulnboxd_agent_host_event_segments_total | counter | result | segments cut: queued for the writer, or lost because it was behind |
File pulls and the inventory
| metric | type | labels | |
|---|---|---|---|
vulnboxd_agent_file_pulls_total | counter | outcome | files the hub asked for: read, or refused as disabled, busy, no_container, bad_path, not_found, not_regular, denied, unsupported, error |
vulnboxd_agent_file_pull_bytes_total | counter | bytes of files pulled | |
vulnboxd_agent_file_pull_seconds | histogram | one pull, from taking it up to having the result | |
vulnboxd_agent_inventory_reads_total | counter | result | reads of inventory.json after it changed, parsed or failed |
Containers and shells
| metric | type | labels | |
|---|---|---|---|
vulnboxd_agent_container_requests_total | counter | op, outcome | container requests from the hub (overview, inspect, restart, logs, exec): ok, failed, refused, busy |
vulnboxd_agent_shell_sessions | gauge | shells open now | |
vulnboxd_agent_container_streams | gauge | log streams open now | |
vulnboxd_agent_container_stream_output_bytes_total | counter | shell output and log bytes sent to the hub | |
vulnboxd_agent_shell_input_bytes_total | counter | shell input written into containers | |
vulnboxd_agent_shell_processes_killed_total | counter | processes a shell left behind, killed when it ended | |
vulnboxd_agent_container_outbox_full_total | counter | container frames dropped because the outbox to the hub was full (32 MiB; never in normal use) | |
vulnboxd_agent_inventory_updates_total | counter | inventories handed to the uplink because they changed or were due a refresh | |
vulnboxd_agent_bisect_requests_total | counter | result | bisect start and stop requests from the hub, left for vulnboxd or refused (agent.bisect off, or no such service) |
Rule pushes
| metric | type | labels | |
|---|---|---|---|
vulnboxd_agent_rules_step_seconds | histogram | step | each step of applying a rule push: current (reading the file), validate, write, load (waiting for vulnboxd), commit, push |
vulnboxd_agent_rules_results_total | counter | step | steps reported to the hub: validated, rejected, conflict, refused, live, committed, pushed, push_failed |
vulnboxd_agent_rules_unpushed | gauge | services with a pushed change that has not reached the remote yet; retried every 30 s | |
vulnboxd_agent_git_checkout_lock_wait_seconds and the other vulnboxd_agent_git_* | the same Git metrics as vulnboxd's vulnboxd_git_*, for the commits and pushes the agent makes |
State and logs
| metric | type | labels | |
|---|---|---|---|
vulnboxd_agent_collect_seconds | histogram | what | asking for vulnboxd's state (every second), or putting the manifest together (every 10 s) |
vulnboxd_agent_collect_changes_total | counter | what | times the state or manifest was handed to the uplink because it changed or was due |
vulnboxd_agent_state_step_seconds | histogram | step | putting the state together: scrape (vulnboxd's metrics), build (state directory, compose files, Git) |
vulnboxd_agent_state_scrapes_total | counter | result | scrapes of vulnboxd's metrics, ok or failed |
vulnboxd_agent_rule_hits_behind_bytes | gauge | how far vulnboxd's rule-hit log has grown past what the agent has read | |
vulnboxd_agent_rule_hits_read_total | counter | rule hits read from the log | |
vulnboxd_agent_rule_hits_read_seconds | histogram | one read of the log | |
vulnboxd_agent_rule_hits_dropped_lines_total | counter | lines skipped as too long or not a hit | |
vulnboxd_agent_rule_hits_rotations_lost_total | counter | times the log rotated twice between reads, losing what it gained meanwhile | |
vulnboxd_agent_proxy_log_behind_bytes, …_read_total, …_read_seconds, …_dropped_lines_total, …_rotations_lost_total | the same for the proxy's request log, requests.jsonl |
vulnboxd_agent_rule_hits_behind_bytes growing while vulnboxd_agent_uplink_mailbox_letters{kind="events"} sits at 16 means the hub is not taking rule hits as fast as vulnboxd writes them; the log is the buffer.
vulnboxd-sensor
vulnboxd-sensor serves its metrics on http://127.0.0.1:9333/metrics (see sensor.metrics), next to its process, runtime and task metrics under the prefix vulnboxd_sensor. The kernel-side counters are read once per sensor.interval.
| metric | type | labels | |
|---|---|---|---|
vulnboxd_sensor_events_total | counter | kind, op | host events seen, before roll-up |
vulnboxd_sensor_events_sent_total | counter | events handed on after roll-up (a rolled-up event counts once) | |
vulnboxd_sensor_records_total | counter | ring buffer records read | |
vulnboxd_sensor_userspace_seconds_total | counter | time spent turning records into events; divided by records, the cost of one | |
vulnboxd_sensor_kernel_dropped_total | counter | kind | records the programs dropped because the ring buffer was full |
vulnboxd_sensor_rate_limited_total | counter | kind | records dropped because their cgroup was over sensor.rate_limit |
vulnboxd_sensor_kernel_errors_total | counter | reason | pending_full (a syscall could not be kept for its result), fd_map_full (a descriptor could not be counted), read_failed |
vulnboxd_sensor_jit_skipped_total | counter | executable-memory events not recorded for a JIT runtime | |
vulnboxd_sensor_ringbuf_pending_bytes | gauge | bytes waiting in the ring buffer when last looked at | |
vulnboxd_sensor_ringbuf_size_bytes | gauge | its size | |
vulnboxd_sensor_program_loaded | gauge | program | whether the eBPF program loaded, 1 or 0 |
vulnboxd_sensor_program_attachments | gauge | program | places it is attached to |
vulnboxd_sensor_attach_failures_total | counter | program | loads and attachments that failed; the sensor carries on without them |
vulnboxd_sensor_program_runs_total | counter | program | times the program ran |
vulnboxd_sensor_program_run_seconds_total | counter | program | time spent in it; divided by runs, its cost per event |
vulnboxd_sensor_rollup_keys | gauge | event shapes the roll-up tracks | |
vulnboxd_sensor_rolled_up_total | counter | occurrences counted into a repeat instead of sent | |
vulnboxd_sensor_rollup_evicted_total | counter | shapes forgotten early for room | |
vulnboxd_sensor_cgroups | gauge | cgroups watched | |
vulnboxd_sensor_processes | gauge | processes tracked | |
vulnboxd_sensor_usdt_probes_attached | gauge | USDT probe sites attached (once per file) | |
vulnboxd_sensor_usdt_files | gauge | files with attached probes | |
vulnboxd_sensor_usdt_processes | gauge | processes scanned for probes | |
vulnboxd_sensor_usdt_attach_failures_total | counter | probes found but not attached or not understood | |
vulnboxd_sensor_usdt_semaphores_raised_total | counter | probe semaphores the sensor raised itself in a process started late, for binaries whose .probes page is shared with another segment | |
vulnboxd_sensor_usdt_files_refused_total | counter | mapped files not opened for a probe scan: not a regular file, not the inode the process mapped, or too large | |
vulnboxd_sensor_usdt_backlog_dropped_total | counter | probe records of a process not scanned yet that were dropped from the waiting backlog (full, or waited too long) | |
vulnboxd_sensor_usdt_probes_left_out_total | counter | probe sites not attached because a limit was reached: 512 per file, the attach budget in all, the probe registry, or out of descriptors; each also reaches the hub as a lost event (probe_limit) | |
vulnboxd_sensor_usdt_attach_budget | gauge | the most probe sites attached at once (at most 8192, less when the open-file limit is low: each takes up to two descriptors) | |
vulnboxd_sensor_usdt_probes_known | gauge | probe descriptions held; forgotten when no attached site uses them any more | |
vulnboxd_sensor_usdt_requests_dropped_total | counter | scan requests dropped because the scanner thread was busy | |
vulnboxd_sensor_kernel_offsets_missing | gauge | kernel struct members this kernel's BTF lacks | |
vulnboxd_sensor_agent_connected | gauge | whether it is connected to the agent, 1 or 0 | |
vulnboxd_sensor_agent_connects_total | counter | connections made to the agent | |
vulnboxd_sensor_agent_frames_total, …_bytes_total, …_events_total | counter | what was written to the agent | |
vulnboxd_sensor_agent_dropped_events_total | counter | reason | events dropped rather than wait: queue_full or disconnected; the agent hears of them as a lost event |
vulnboxd_sensor_agent_queued_events | gauge | events waiting for the writer |
The programs' run counts and times come from the kernel's BPF statistics, which the sensor turns on while it runs (a few nanoseconds per program run).
vulnboxd-pcap
vulnboxd-pcap serves its metrics on http://127.0.0.1:9332/metrics (see pcap.metrics), under the prefix vulnboxd_pcap. The broker exits when the capture command does and systemd starts it again, so a restarted capture shows as a new vulnboxd_pcap_process_start_time_seconds and the counters starting from 0.
| metric | type | labels | |
|---|---|---|---|
vulnboxd_pcap_capturing | gauge | whether the capture command (tcpdump) is running, 1 or 0 | |
vulnboxd_pcap_captures_started_total | counter | times the capture command was started in this process | |
vulnboxd_pcap_capture_packets_total | counter | packets read from the capture | |
vulnboxd_pcap_capture_bytes_total | counter | bytes of packet records read from it, record headers included | |
vulnboxd_pcap_clients | gauge | PCAP-over-IP readers connected now, the agent among them | |
vulnboxd_pcap_clients_accepted_total | counter | readers that connected and were sent the header | |
vulnboxd_pcap_clients_dropped_total | counter | readers disconnected for falling more than pcap.buffer_mb behind | |
vulnboxd_pcap_relayed_packets_total | counter | packets handed to readers, once per reader | |
vulnboxd_pcap_relayed_bytes_total | counter | bytes written to readers' sockets | |
vulnboxd_pcap_backlog_bytes | gauge | bytes handed to readers and not written yet, all of them together | |
vulnboxd_pcap_max_client_backlog_bytes | gauge | the most any one reader had waiting, as of the last packet; at pcap.buffer_mb it is dropped | |
vulnboxd_pcap_interfaces | gauge | with pcap.interfaces: interface captures running now. Below the number of interfaces asked for means one is failing to start (see the log) | |
vulnboxd_pcap_capture_restarts_total | counter | with pcap.interfaces: interface captures that ended and were started again (with a growing pause, up to 30s) | |
vulnboxd_pcap_unconvertible_packets_total | counter | with pcap.interfaces: packets of a link type that cannot be written as LINUX_SLL2, left out |
With pcap.interfaces one interface's capture ending does not end the broker: it is started again on its own, and vulnboxd_pcap_capturing is 1 while any of them runs.
Readers are not told apart: their addresses would make a series per connection.
Hub
The hub's ingest, assemble, link, alert and api serve metrics of their own, wherever --metrics says; the chart puts ingest's, assemble's, link's and alert's on ports 9100, 9101, 9103 and 9104 behind the vulnboxd-hub-metrics Service, and each API replica's on port 9102 behind the headless vulnboxd-hub-api-metrics Service, which lists every replica (with metrics.serviceMonitor.enabled, a ServiceMonitor scrapes all of them). They restart from 0 with their process. The ones in the tables below have no labels; the finer ones under Hub internals do, from small fixed sets only.
Two Grafana dashboards come with them, in contrib/grafana/ (and in the chart, with metrics.dashboards.enabled): hub.json for a game — capture coming in and its lag, gaps, assembly, flows per second, the API's latency and errors, who is online, rule pushes — and hub-internals.json for debugging: memory, the runtime, the task table, ClickHouse and the segment store by table and operation, and each component's loops and queues.
ingest
| metric | type | |
|---|---|---|
hub_ingest_connected | gauge | whether the agent is connected now, 1 or 0 |
hub_ingest_connections_total | counter | agent connections that got as far as saying hello |
hub_ingest_dropped_connections_total | counter | connections ended by an error or a protocol violation |
hub_ingest_frames_total | counter | frames received from the agent |
hub_ingest_segments_total | counter | segments stored and acknowledged |
hub_ingest_segment_bytes_total | counter | compressed bytes of segments stored |
hub_ingest_duplicate_segments_total | counter | segments received again after they were stored; acknowledged and ignored |
hub_ingest_last_seq | gauge | the seq of the newest stored segment |
hub_ingest_rule_hits_total | counter | rule hits stored |
hub_ingest_rule_hits_lost_total | counter | rule hits received that could not be stored. The agent counts them delivered, so they are not sent again |
hub_ingest_pushes_sent_total | counter | rule pushes delivered to the agent |
hub_ingest_rule_results_total | counter | rule push steps the agent reported |
hub_agent_rule_hits_dropped_total | counter | lines of vulnboxd's rule-hit log the agent skipped because they were too long or not hits, as it last reported |
hub_agent_rule_hit_rotations_lost_total | counter | times the rule-hit log rotated twice before the agent read on, losing hits, as it last reported |
hub_ingest_newest_capture_seconds | gauge | capture time of the newest packet stored, as a Unix time; time() - it is how far the hub is behind the vulnbox |
hub_ingest_gaps_total | counter | gaps the agent reported (segments it dropped before sending them) that lost something not stored |
hub_ingest_gap_segments_total | counter | segments lost in those gaps |
hub_ingest_gap_bytes_total | counter | compressed bytes lost in those gaps |
hub_ingest_pushes_refused_total | counter | rule pushes refused for their author's rate limit |
hub_agent_last_heartbeat_seconds | gauge | when the agent's last heartbeat arrived, by the hub's clock |
hub_agent_capture_connected | gauge | whether the agent reaches the capture broker on the vulnbox, 1 or 0 |
hub_agent_memory_only | gauge | whether the agent has no usable disk and holds segments in memory only |
hub_agent_spool_bytes | gauge | bytes the agent's spool holds |
hub_agent_spool_budget_bytes | gauge | bytes the spool may hold now |
hub_agent_disk_free_bytes | gauge | free space on the spool's filesystem |
hub_agent_segments_pending | gauge | segments the agent holds that the hub has not acknowledged |
hub_agent_oldest_unacked_seconds | gauge | how long the oldest of them has waited |
hub_agent_dropped_bytes_total | counter | capture the agent dropped because its spool budget ran out |
hub_agent_broker_reconnects_total | counter | times the agent reconnected to the capture broker |
hub_ingest_host_segments_total | counter | host-event segments stored and acknowledged |
hub_ingest_host_events_total | counter | host events in them |
hub_ingest_proxy_requests_total | counter | lines of vulnboxd's proxy request log stored |
hub_ingest_proxy_requests_lost_total | counter | request log lines received that could not be stored |
hub_ingest_inventories_total | counter | versions of vulnboxd's inventory stored (only ones that changed) |
hub_ingest_file_pulls_sent_total | counter | file pulls delivered to the agent |
hub_ingest_file_results_total | counter | file pull results the agent sent back |
hub_agent_sensor_connected | gauge | whether vulnboxd-sensor is connected to the agent, 1 or 0 |
hub_agent_host_events_total | counter | host events the agent took from the sensor |
hub_agent_host_events_dropped_total | counter | host events the agent dropped because it could not keep up |
hub_agent_host_events_sensor_lost_total | counter | host events the sensor reported lost (its ring buffer was full) |
hub_agent_proxy_log_dropped_total | counter | lines of the request log the agent skipped because they were not requests |
hub_agent_proxy_log_rotations_lost_total | counter | times the request log rotated twice before the agent read on |
hub_agent_file_pulls_failed_total | counter | file pulls the agent refused or failed |
The hub_agent_ metrics mirror the agent's heartbeat as it last arrived. Its counters start again from 0 when the agent restarts, which Prometheus reads as a counter reset.
assemble
| metric | type | |
|---|---|---|
hub_assemble_behind | gauge | segments stored but not assembled yet |
hub_assemble_checkpoint | gauge | the seq of the last segment assembled |
hub_assemble_segments_total | counter | segments assembled |
hub_assemble_bad_segments_total | counter | segments skipped because their object was missing or did not open |
hub_assemble_packets_total | counter | packets fed to the assembler |
hub_assemble_flow_rows_total | counter | flow rows written |
hub_assemble_chunk_rows_total | counter | chunk rows written |
hub_assemble_http_rows_total | counter | HTTP exchange rows written |
hub_assemble_db_op_rows_total | counter | database operation rows written |
hub_assemble_open_flows | gauge | flows the assembler holds open |
hub_assemble_ignored_flows_total | counter | flows ignored after a rewind because they began before it |
hub_assemble_orphan_outputs | gauge | chunks and exchanges for flows the hub never saw, which should not happen |
hub_assemble_rebuilds_total | counter | times the assembler was rebuilt because the manifest changed what it needs to know |
hub_assemble_newest_capture_seconds | gauge | capture time of the newest packet assembled, as a Unix time; hub_ingest_newest_capture_seconds minus this is how far the flows in the UI lag |
hub_assemble_waiting_flows | gauge | ended flows held back a minute for rule hits that may still arrive |
link
| metric | type | |
|---|---|---|
hub_link_host_segments_total | counter | host-event segments read and stored |
hub_link_host_events_total | counter | host events stored |
hub_link_bad_host_events_total | counter | lines of host-event segments that did not read |
hub_link_bad_segments_total | counter | host-event segments skipped because their object was missing or did not open |
hub_link_host_checkpoint | gauge | the seq of the last host-event segment read |
hub_link_host_behind | gauge | host-event segments stored but not read yet |
hub_link_process_rows_total | counter | process rows written (on fork, exec, exit) |
hub_link_live_processes | gauge | processes the linker knows to be running |
hub_link_links_total | counter | links written |
hub_link_unmatched_total | counter | joins that found nothing to link to |
hub_link_ambiguous_total | counter | joins that found more than one candidate, which link nothing |
hub_link_join_lag_seconds | gauge | how far the join pass's checkpoint is behind the hub's clock |
hub_link_summaries_total | counter | flow host summaries written again (what host filters read) |
hub_link_summaries_pending | gauge | flows queued for their host summary (500 are written per pass, oldest first; the rest wait for the next passes) |
hub_link_summaries_dropped_total | counter | flows not queued for a summary because 200 000 were waiting already |
hub_link_tags_total | counter | built-in host tags given |
alert
The alert worker: baselines learned, alerts raised, webhooks posted to.
| metric | type | |
|---|---|---|
hub_alert_passes_total | counter | passes over a window of event time |
hub_alert_observations_total | counter | observations judged: HTTP exchanges, database operations, host events, proxy connections |
hub_alert_truncated_total | counter | sources that ended a pass early, with more than 50 000 rows in its window; the checkpoint moves only as far as was read and an alert_truncated alert is raised |
hub_alert_raised_total | counter | alerts raised |
hub_alert_recurrences_total | counter | occurrences counted on an alert raised before (deduplicated) |
hub_alert_muted_total | counter | alerts raised muted by a mute rule |
hub_alert_baseline_items | gauge | baseline items known, in a baseline or not |
hub_alert_unusual_items | gauge | items seen outside the baseline and not learned or accepted since |
hub_alert_checkpoint_seconds | gauge | the event time passes have covered, as a Unix time |
hub_alert_lag_seconds | gauge | how far the checkpoint is behind the hub's clock: alerts come at least this late |
hub_alert_webhook_held_back_total | counter | webhook messages held back by a webhook's limit a minute (summed up in one message later) |
With labels:
| metric | type | labels | |
|---|---|---|---|
hub_alert_raised_by_kind_total | counter | kind, severity | alerts raised, by kind and severity |
hub_alert_suppressed_total | counter | kind | new alerts past the per-pass limit, counted on a flood alert instead |
hub_alert_items_learned_total | counter | kind, origin | items taken into a baseline by the alert worker, by item kind and warmup (accepted items are not counted here) |
hub_alert_webhook_messages_total | counter | format, result | webhook messages by discord, slack, generic, and sent, failed or dropped (the queue of 1000 was full) |
hub_alert_webhook_send_seconds | histogram | how long posting one message took, waits for a rate limit included | |
hub_alert_pass_seconds | histogram | how long one pass took |
hub_alert_lag_seconds grows when the worker falls behind, and also when the assembler or the linker does, since it waits for both. hub_alert_webhook_messages_total{result="failed"} going up means a webhook URL is wrong or the receiver is down; each alert's history in the UI says which.
api
Each replica counts only what it served, so sum them across replicas. Requests turned away by sign-in before they reach the API are not counted.
| metric | type | |
|---|---|---|
hub_api_responses_2xx_total | counter | /api requests answered with a 2xx status, by a signed-in user |
hub_api_responses_3xx_total | counter | /api requests answered with a 3xx status |
hub_api_responses_4xx_total | counter | /api requests answered with a 4xx status: refused input, conflicts, rate limits |
hub_api_responses_5xx_total | counter | /api requests answered with a 5xx status: ClickHouse unreachable, a query past its time limit, a bug |
hub_api_live_streams | gauge | live-update streams (browser tabs) open on this replica |
hub_api_previews_total | counter | rule previews (what a draft rule would have matched) started on this replica |
hub_api_previews_running | gauge | rule previews running on this replica |
hub_api_tag_rule_runs_total | counter | tag rule runs over past flows started on this replica |
hub_api_tag_rule_runs_running | gauge | tag rule runs over past flows running on this replica |
hub_api_users_online | gauge | people with a live-update stream open on any replica, as this replica last read it (take the max across replicas, not the sum) |
hub_api_live_watermark_seconds | gauge | the newest flow the live poller has read, as a Unix time; time() - it is how late new flows reach open tabs |
hub_api_previews_running and hub_api_live_streams are refreshed every 5 seconds; hub_api_tag_rule_runs_running changes as runs start and end.
hub_ingest_connected at 0 means nothing new is arriving; the agent's spool is filling meanwhile. hub_assemble_behind climbing means the flows in the UI lag behind the capture.
Hub internals
For debugging rather than for a game: where the time goes, what is queued, what failed. Labels take values from small fixed sets — route templates, table names, frame types, reasons — never user names, flow ids or addresses. Histograms (_seconds, and _rows, _segments, _packets for counts) come as the usual _bucket, _sum and _count series.
ClickHouse and the segment store, from every component; component is ingest, assemble or api:
| metric | type | labels | |
|---|---|---|---|
hub_clickhouse_query_seconds | histogram | component, op, table | how long statements took, failed ones included; op is select, insert or command, table the schema's table the statement is about (none, other) |
hub_clickhouse_errors_total | counter | component, op, table, class | failed statements; class is timeout, oom, unavailable or other |
hub_clickhouse_queries_in_flight | gauge | component, op | statements running now |
hub_clickhouse_inserted_rows_total | counter | component, table | rows written |
hub_clickhouse_inserted_bytes_total | counter | component, table | bytes written, as RowBinary |
hub_clickhouse_insert_rows | histogram | component, table | rows per insert |
hub_clickhouse_read_rows_total | counter | component, table | rows read |
hub_clickhouse_read_bytes_total | counter | component, table | bytes of results received (the API's queries) |
hub_store_seconds | histogram | component, backend, op | segment store operations; backend is file or s3, op is put, get or head |
hub_store_bytes_total | counter | component, backend, op | bytes written and read |
hub_store_errors_total | counter | component, backend, op | failed operations, a missing object read among them |
ingest:
| metric | type | labels | |
|---|---|---|---|
hub_ingest_frames_by_type_total | counter | type | frames received, by type: segment, heartbeat, events, ... |
hub_ingest_frame_bytes_total | counter | type | their bytes on the wire (inside TLS) |
hub_ingest_segment_stage_seconds | histogram | stage | taking in a segment: verify (sizes, checksum), store (its object), row (its seq and row) |
hub_ingest_ack_seconds | histogram | from a segment's frame being read to its acknowledgement being queued | |
hub_ingest_last_segment_id | gauge | the id, in the agent's epoch, of the newest segment stored | |
hub_ingest_segments_by_kind_total | counter | kind | segments stored, by what they hold: packets, host_events |
hub_ingest_file_pull_bytes_total | counter | bytes of pulled files stored | |
hub_ingest_file_pull_failures_total | counter | file pulls that failed on the agent or did not match their hash | |
hub_ingest_file_pulls_queued | gauge | file pulls waiting for delivery at the last look | |
hub_ingest_relay_requests_total | counter | container requests the API passed to the agent through the relay | |
hub_ingest_relay_requests | gauge | container requests and streams open through the relay | |
hub_ingest_relay_overflows_total | counter | streams ended because the API did not take their output | |
hub_ingest_relay_refused_total | counter | relay connections refused for a wrong token | |
hub_link_links_by_method_total | counter | method | links written by link, by the rule that proved them: proxy_log, conntrack, lineage, socket_tuple, socket_inheritance, unambiguous_ownership, hook |
hub_ingest_resume_backlog_segments | gauge | segments the agent held beyond what was stored when it last connected | |
hub_ingest_connection_started_seconds | gauge | when the connection being served said hello; 0 while there is none | |
hub_ingest_handshake_failures_total | counter | reason | connections that ended before or at hello: connect, tls, tls_timeout, hello_timeout, not_hello, version, closed |
hub_ingest_connection_ends_total | counter | reason | served connections that ended: closed, dropped, replaced, failed |
hub_ingest_outbound_queue | gauge | frames waiting to be written to the agent, 64 at most | |
hub_ingest_push_poll_seconds | histogram | one look for queued rule pushes, delivery included | |
hub_ingest_pushes_queued | gauge | pushes waiting for delivery at the last look |
assemble:
| metric | type | labels | |
|---|---|---|---|
hub_assemble_batch_seconds | histogram | a batch of up to 32 segments, from reading to the checkpoint | |
hub_assemble_stage_seconds | histogram | stage | its steps: read, assemble (fetching and opening segments, joining rule hits), write, checkpoint |
hub_assemble_batch_segments | histogram | segments per batch | |
hub_assemble_batch_packets | histogram | packets per batch | |
hub_assemble_newest_stored_seq | gauge | the newest seq stored, as of the last checkpoint | |
hub_assemble_buffered_bytes | gauge | payload the assembler holds in open flows' buffers | |
hub_assemble_assembler_flows | gauge | connections the assembler tracks as open | |
hub_assemble_ignored_open_flows | gauge | flows ignored now because they began before the rewind | |
hub_assemble_evicted_flows_total | counter | flows closed early to stay within the flow limit | |
hub_assemble_undecodable_packets_total | counter | packets that did not decode | |
hub_assemble_rule_hit_lookup_seconds | histogram | reading a batch's rule hits, every page | |
hub_assemble_rule_hit_pages_total | counter | pages of rule hits read | |
hub_assemble_rule_hit_rows_total | counter | rows of rule hits read (the first and last per second) | |
hub_assemble_rewinds_total | counter | rewinds on start | |
hub_assemble_rewind_segments_total | counter | segments read again by them | |
hub_assemble_rewinding | gauge | whether one is going on now | |
hub_assemble_rewind_seconds | gauge | how long the last one took | |
hub_assemble_anomaly_seconds | histogram | anomaly detection on one HTTP exchange, request and response | |
hub_assemble_anomaly_exchanges_total | counter | result | exchanges by what anomaly detection did: analyzed, skipped (it is off), failed (the decoder's guard tripped; stored as sent) |
hub_assemble_anomaly_flagged_exchanges_total | counter | exchanges it found anomalies in | |
hub_assemble_anomaly_rules_total | counter | severity | distinct anomaly rules found per exchange: info, notice, warning, high |
hub_assemble_anomaly_bytes_total | counter | body bytes it decoded | |
hub_assemble_anomaly_enabled | gauge | whether anomaly detection is on, as the setting and --anomaly-detection say | |
hub_assemble_db_ops_total | counter | protocol, status | database operations decoded from flows: protocol is postgres, mysql, redis, mongodb, memcached or mssql; status is ok, error, none (no response seen) or skipped (not run after an earlier error in its batch) |
hub_assemble_db_flag_results_total | counter | protocol | database operations whose result held a flag |
hub_assemble_db_flows_total | counter | protocol, state | flows entering a database decoding state: decoded, tls (encryption stopped it), failed (the bytes stopped following the protocol, or some were missing) |
api, each replica its own:
| metric | type | labels | |
|---|---|---|---|
hub_api_request_seconds | histogram | route, method, class | /api requests by route template (/api/flows/{flow}; unmatched for no route) and status class; a stream until its headers |
hub_api_requests_in_flight | gauge | requests being answered now | |
hub_api_jobs_started_total | counter | kind | background jobs: preview, tag_run |
hub_api_jobs_finished_total | counter | kind, result | ended jobs: done, failed, cancelled, unavailable |
hub_api_job_seconds | histogram | kind, result | how long they ran |
hub_api_jobs_running | gauge | kind | jobs running now |
hub_api_preview_evaluate_seconds | histogram | the rule engine's exact evaluation of one batch of a preview's requests | |
hub_api_preview_evaluated_total | counter | stored requests evaluated for previews | |
hub_api_preview_matched_total | counter | of those, ones the rule matched | |
hub_api_robustness_checks_total | counter | rule robustness checks (mutation replays, checkRuleRobustness) run | |
hub_api_tagger_pass_seconds | histogram | one pass of the enabled tag rules over new flows | |
hub_api_tag_rule_applications_total | counter | result | one rule's pass: ok, failed |
hub_api_live_poll_seconds | histogram | one round of the live poller | |
hub_api_live_poll_errors_total | counter | source | failed parts of it: flows, time, pushes, annotations, presence, state |
hub_api_live_replay_events | gauge | events kept to replay to reconnecting tabs | |
hub_api_live_streams_opened_total | counter | streams opened | |
hub_api_live_resumes_total | counter | streams that resumed from a cursor | |
hub_api_live_replayed_events_total | counter | events replayed to them | |
hub_api_live_resets_total | counter | reason | streams told to reload instead, by the reason sent |
hub_api_live_byes_total | counter | streams closed because their user opened more than the cap | |
hub_api_live_events_sent_total | counter | event | events written to streams |
hub_api_presence_writes_total | counter | kind | presence rows written: open, gone, refresh, view |
hub_api_logins_total | counter | result, reason | sign-ins back from the issuer, ok or refused with why: expired, state, issuer_refused, no_code, token_exchange, token_invalid, not_allowed, session, cookie_too_large |
hub_api_jwks_refreshes_total | counter | result | fetches of the issuer's signing keys |
hub_api_scripts_total | counter | language, result | exploit scripts generated |
hub_api_pushes_created_total | counter | op, shadow | rule pushes queued, by change: add_rule, set_enabled, delete_rule, move_rule, promote, revert, replace_file |
The hub's tasks (see Tasks) are ingest.main, ingest.connection, ingest.writer, ingest.pushes, assemble.main, api.main, api.live, api.presence, api.digest, api.tagger, api.capture, api.gauges, and per job or stream api.preview, api.tag_run, api.job_mirror and api.stream (whose _task_running is how many run). /debug/tasks says what each is waiting on: an agent to connect, a frame from it, the agent to read.
Process and runtime
Every binary that serves metrics — vulnboxd, the hub's ingest, assemble and api, and vulnboxd-agent and vulnboxd-pcap (on 127.0.0.1:9331 and 9332 unless agent.metrics and pcap.metrics say otherwise) — also reports on itself: memory, CPU, file descriptors, the allocator, the async runtime, and its long-running tasks. They are for debugging a process that is stuck, slow or growing, and are named <prefix>_<what>, the prefix saying which binary it is:
| binary | prefix |
|---|---|
| vulnboxd | vulnboxd |
| vulnboxd-agent | vulnboxd_agent |
| vulnboxd-pcap | vulnboxd_pcap |
| vulnboxd-hub ingest | hub_ingest |
| vulnboxd-hub assemble | hub_assemble |
| vulnboxd-hub api | hub_api |
So vulnboxd's memory is vulnboxd_process_resident_memory_bytes, and the hub API's tasks hub_api_task_running. They are computed when scraped, so they cost nothing in between.
Process
| metric | type | labels | |
|---|---|---|---|
<prefix>_process_resident_memory_bytes | gauge | memory resident in RAM | |
<prefix>_process_virtual_memory_bytes | gauge | address space mapped, resident or not | |
<prefix>_process_cpu_seconds_total | counter | mode | CPU time used: user in the program, system in the kernel on its behalf |
<prefix>_process_threads | gauge | OS threads | |
<prefix>_process_open_fds | gauge | open file descriptors | |
<prefix>_process_max_fds | gauge | the soft limit on them; absent when unlimited | |
<prefix>_process_start_time_seconds | gauge | when the process started, as a Unix time | |
<prefix>_heap_in_use_bytes | gauge | glibc's heap: allocated and not yet freed | |
<prefix>_heap_free_bytes | gauge | glibc's heap: freed, but kept by the allocator rather than returned to the system | |
<prefix>_heap_mmapped_bytes | gauge | glibc's heap: large allocations mapped on their own | |
<prefix>_heap_arena_bytes | gauge | glibc's heap: taken from the system for its arenas, in use or free |
Resident memory well above heap_in_use_bytes with a large heap_free_bytes is fragmentation, not a leak: memory the program gave back that the allocator keeps. The heap_ metrics are only there in builds against glibc.
Runtime
| metric | type | labels | |
|---|---|---|---|
<prefix>_tokio_workers | gauge | the async runtime's worker threads | |
<prefix>_tokio_alive_tasks | gauge | async tasks spawned and not finished; climbing without end is a task leak | |
<prefix>_tokio_global_queue_depth | gauge | tasks waiting for a worker; staying above 0 means the workers cannot keep up | |
<prefix>_tokio_worker_busy_seconds_total | counter | worker | time the worker spent running tasks; its rate near 1 is a saturated worker |
<prefix>_tokio_worker_park_total | counter | worker | times the worker ran out of work and went to sleep |
<prefix>_tokio_worker_park_unpark_total | counter | worker | times it went to sleep or woke up |
Tasks
The long-running loops of each binary are registered by name, task below:
- vulnboxd:
daemon.main,daemon.metrics,alerts,proxy.accept(one instance per TCP port),proxy.udp(one per UDP port),hits.writer, and one instance per run ofdaemon.poll,daemon.build,daemon.deploy,daemon.rollback,daemon.commit,monitor.portsandmonitor.game— for those,restartscounts runs; - vulnboxd-agent:
agent.main,agent.uplink,agent.capture,agent.capture_reader,agent.spool_writer,agent.collect,agent.rule_hits,agent.pushes; - vulnboxd-pcap:
pcap.main, andpcap.capture, which makes progress whenever packets arrive; - each also has
telemetry.server, which serves the metrics; the hub hasapi.liveand others.
A loop calls itself idle while it waits for work, waiting while blocked on something it names (the hub, a lock, docker, a Git remote), and running otherwise, and reports progress every time round.
| metric | type | labels | |
|---|---|---|---|
<prefix>_task_running | gauge | task | instances of the task alive now, usually 1 or 0 |
<prefix>_task_state | gauge | task, state | 1 for the state the task is in: running, idle, waiting, finished, failed, panicked or cancelled |
<prefix>_task_restarts_total | counter | task | times the task was started again after it had ended |
<prefix>_task_last_progress_seconds | gauge | task | when the task last reported getting something done, or started, as a Unix time |
A task that should run forever at _task_running 0 has stopped; _task_state says how, and time() - <prefix>_task_last_progress_seconds says how long a task that reports progress has been stuck. An idle task waiting for work makes no progress either, so look at that for tasks running or waiting:
(time() - vulnboxd_task_last_progress_seconds)
and on (task) (vulnboxd_task_state{state=~"running|waiting"} == 1) > 60Debug pages
Next to /metrics, the same address serves JSON for a closer look:
/debug/tasks: every task with its state, what it is waiting on, when it started and last made progress, its restarts, and its last error./debug/runtime: the runtime's numbers above, per worker./debug/process: the process's numbers above.
They say as much about the program as the metrics do, so they are exactly as exposed: on localhost for vulnboxd, inside the cluster for the hub.
Useful queries
# Flags that went out in the last tick, per service
sum by (service) (vulnboxd_flags_out_last_tick)
# Flags going out right now, per tick (here 180 s ticks)
sum by (service) (rate(vulnboxd_flags_out_total[1m])) * 180
# Rules firing right now, per minute
sum by (service, rule, action) (rate(vulnboxd_rule_hits_total[1m])) * 60
# Share of 5xx answers per service
sum by (service) (rate(vulnboxd_http_responses_total{class="5xx"}[5m]))
/ sum by (service) (rate(vulnboxd_http_responses_total[5m]))
# Deploys that came close to the window (here 5 s)
vulnboxd_deploy_ms > 4000
# The agent is not connected, or assembly is falling behind
hub_ingest_connected == 0
hub_assemble_behind > 100
# A long-running task of vulnboxd's has stopped
vulnboxd_task_running == 0
# Memory the allocator holds on to without the program using it
vulnboxd_heap_free_bytes / vulnboxd_process_resident_memory_bytes