Skip to content

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 ​

metrictypelabels
vulnboxd_connections_totalcounterservice, portclient connections accepted
vulnboxd_connections_opengaugeservice, portclient connections currently open
vulnboxd_bytes_totalcounterservice, port, directionpayload bytes forwarded; direction is in or out
vulnboxd_http_responses_totalcounterservice, port, classresponses by status class: 2xx, 4xx, 5xx, ...
vulnboxd_upstream_errors_totalcounterservice, portfailures to reach the service at all

Flags ​

metrictypelabels
vulnboxd_flags_out_totalcounterservice, portflags in responses sent to clients
vulnboxd_flags_out_last_tickgaugeservice, portflags 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 ​

metrictypelabels
vulnboxd_rule_hits_totalcounterservice, port, rule, actiontimes a rule fired; action is blocked, stalled, rewritten or matched
vulnboxd_rule_hits_dropped_totalcounterrule 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_stalledgaugeservice, portconnections held open by a stall rule, out of limits.stalled; at the limit, further stalls block instead
vulnboxd_bypassed_totalcounterservice, portrequests that skipped every rule with a bypass header
vulnboxd_mirror_totalcounterservice, port, rule, resultmirrored 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_totalcounterservice, porttcp 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 ​

metrictypelabels
vulnboxd_port_upgaugeservice, portwhether the port answered its last check, 1 or 0
vulnboxd_sla_upgaugeservicewhether the game's checker found the service working in the latest tick, 1 or 0; needs a game mode

Deploys ​

metrictypelabels
vulnboxd_deploys_totalcounterservice, resultdeploys, ok or failed
vulnboxd_unproxied_bindingsgaugeserviceports 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_servicesgaugeservicecompose 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_msgaugeservicehow long the last deploy took, in milliseconds
vulnboxd_builds_totalcounterservice, resultbuilds of a new version, ok or failed
vulnboxd_git_polls_totalcounterresultgit fetches, ok, failed, or skipped while vulnboxd-agent held the checkout longer than 5 s
vulnboxd_git_background_pushes_totalcounterresultpushes 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_totalcounterservice, triggerrollbacks vulnboxd made, health or sla
vulnboxd_crashed_after_deploy_totalcounterservice, outcomeversions 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_totalcounterservice, triggerbisects 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_runninggaugeservice1 while a bisect of the service runs
vulnboxd_bisect_results_totalcounterservice, resultbisects that ended: done (culprits reverted, the rest works) or fell_back (gave up and put back the newest version found working)
vulnboxd_bisect_culprits_totalcounterservicecommits a bisect found and reverted
vulnboxd_servicesgaugeservices being managed
vulnboxd_tickgaugethe tick it is now, counted from the start time; follows the gameserver's timing when it gives one
vulnboxd_game_tickgaugethe latest tick the gameserver has verdicts for
vulnboxd_gameserver_upgaugewhether the gameserver answered the last time it was asked, 1 or 0
vulnboxd_infogaugeversionbuild 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 ​

metrictypelabels
vulnboxd_proxy_buffered_bytesgaugeservice, portbytes of HTTP bodies held in memory whole for rules that need the whole body
vulnboxd_proxy_buffered_total_bytesgaugebytes held against limits.buffered_total: every held HTTP body and partial gRPC message, all ports together
vulnboxd_proxy_buffer_budget_exhausted_totalcounterdirbodies 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_totalcounterservice, port, dir, reasonmessages the rules could not decide on, by reason (too_large, budget_full, rpc_framing, content_encoding, websocket_too_large, ...)
vulnboxd_proxy_upstream_connect_secondshistogramservice, portgetting a connection to the service, waiting out a deploy included; successful ones only
vulnboxd_proxy_rule_eval_secondshistogramservice, port, stagetime 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_secondshistogramservice, port, partdecoding 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_totalcounterservice, portparts the decoder failed on; they counted as decoding to nothing, and the message went on
vulnboxd_proxy_decode_truncated_totalcounterservice, portparts whose decoding stopped at its limits (64 KiB of decoded text, 512 values)
vulnboxd_proxy_decode_skipped_totalcounterservice, port, reasonbodies 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_connectionsgaugeservice, portidle HTTP connections to the service kept for reuse
vulnboxd_proxy_pool_connections_totalcounterservice, port, resultupstream HTTP connections, reused from the pool or new
vulnboxd_proxy_pool_evictions_totalcounterservice, port, reasonpooled 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_totalcounterservice, portrequests 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_depthgaugerule hits waiting for the writer of rule-hits.jsonl
vulnboxd_rule_hits_written_totalcounterrule hits written to it
vulnboxd_rule_hits_rotations_totalcountertimes it was moved aside for being full
vulnboxd_rule_hits_write_secondshistogramwriting and flushing one batch of rule hits
vulnboxd_request_log_written_totalcounterlines written to the request log, requests.jsonl
vulnboxd_request_log_dropped_totalcounterrequests 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_depthgaugelines waiting for its writer
vulnboxd_request_log_rotations_totalcountertimes it was moved aside to requests.jsonl.1 for being full (64 MiB)
vulnboxd_request_log_write_secondshistogramwriting and flushing one batch of lines
vulnboxd_request_log_nat_lookups_totalcounterresultconntrack 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.

metrictypelabels
vulnboxd_git_op_secondshistogramophow long Git operations took: fetch, push, fast_forward, rebase, commit, restore, and pull, the daemon's whole poll of one repository
vulnboxd_git_ops_totalcounterop, resultthe same, ok, failed, or busy when the checkout lock was held too long by the other process
vulnboxd_git_checkout_lock_wait_secondshistogramwaiting for the checkout lock, got or not
vulnboxd_git_checkout_lock_timeouts_totalcountertimes the lock was given up on
vulnboxd_git_checkout_lock_held_secondshistogramhow long the lock was held

Deploys and docker ​

metrictypelabels
vulnboxd_deploy_step_secondshistogramservice, stepeach 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_totalcounterservice, tochanges of a service's deploy state, by the state it went into: live, building, waiting, deploying, failed, rolled_back
vulnboxd_service_stategaugeservice, state1 for the state the service is in, 0 for the others
vulnboxd_compose_command_secondshistogramcommanddocker compose commands: up, build, pull, ps, down, stop, restart, other
vulnboxd_compose_commands_totalcountercommand, resultthe 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_totalcounterresultrefreshes of the container inventory, ok or failed (a docker call failed or timed out)
vulnboxd_inventory_refresh_secondshistogramone refresh: the containers of each service, their docker inspect, /proc
vulnboxd_inventory_event_refreshes_totalcounterrefreshes asked for by Docker's events (a container started, died or changed health), besides the interval's
vulnboxd_docker_api_requests_totalcountercall, resultrequests 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_secondshistogramcallone request, its answer read
vulnboxd_docker_api_fallbacks_totalcountercalltimes the CLI was run because the API could not answer: compose_ps, inspect, network_inspect
vulnboxd_docker_events_totalcounteractioncontainer events from Docker's event stream: create, start, restart, die, oom, destroy, health_status, other
vulnboxd_inventory_writes_totalcountertimes inventory.json was rewritten because something in it changed (or it was due)
vulnboxd_inventory_containersgaugecontainers in it
vulnboxd_inventory_docker_proxy_portsgaugeproxied 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 ​

metrictypelabels
vulnboxd_main_loop_secondshistogrambranchthe main loop handling one wakeup, by what woke it: window, reload, poll, monitor, game, event
vulnboxd_loop_secondshistogramloopone run of a periodic job: poll (Git), monitor (port checks), game (the gameserver's report)
vulnboxd_loop_lag_secondshistogramloophow late a periodic job started against its schedule, reload too; for the others this includes waiting for the run before
vulnboxd_game_request_secondshistogramkindquestions to the gameserver: report, flag_ids, vulnbox; the agent's are vulnboxd_agent_game_*
vulnboxd_game_requests_totalcounterkind, resultthe same, ok or failed
vulnboxd_alerts_totalcounterresultwebhook 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_secondshistogramsending one alert, waiting out the webhook's rate limit included
vulnboxd_alerts_queue_depthgaugealerts waiting to be sent
vulnboxd_handovers_totalcountermode, resultupgrades 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_secondshistogramfrom starting the new build to handing everything over
vulnboxd_handover_sockets_inheritedgaugelistening sockets taken over from the daemon before
vulnboxd_handover_sockets_passedgaugelistening sockets passed on at the last handover
vulnboxd_drain_secondshistogramfinishing open connections after handing over
vulnboxd_drain_abandoned_connectionsgaugeconnections still open when the drain ran out of time
vulnboxd_manager_lock_wait_secondshistogramwaiting at start for the daemon before to stop managing the services
vulnboxd_manager_heldgaugewhether 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.

metrictypelabels
vulnboxd_agent_uplink_connectedgaugewhether a session with the hub is up, 1 or 0
vulnboxd_agent_uplink_sessions_totalcountersessions that got as far as the hub's Welcome
vulnboxd_agent_uplink_disconnects_totalcounterreasonconnections that ended or never started: connect (TCP), handshake (TLS), timeout (the hub stopped answering, reading or acknowledging), closed, protocol, io
vulnboxd_agent_uplink_frames_totalcounterdirection, typeframes 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_totalcounterframes left out because they were too large for the hub to read
vulnboxd_agent_uplink_bytes_totalcounterdirectionbytes sent and received on the connection, before TLS
vulnboxd_agent_uplink_send_secondshistogramwriting one frame; a hub that reads slowly shows here first
vulnboxd_agent_uplink_ack_secondshistogramfrom sending a segment to the hub acknowledging it
vulnboxd_agent_uplink_segments_in_flightgaugesegments sent and not acknowledged yet
vulnboxd_agent_uplink_windowgaugehow many segments the hub lets be in flight
vulnboxd_agent_uplink_mailbox_lettersgaugekindframes 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 ​

metrictypelabels
vulnboxd_agent_spool_segmentsgaugeplacesegments held for the hub, on disk or in memory
vulnboxd_agent_spool_bytesgaugeplacebytes held: allocated blocks on disk, compressed payload in memory
vulnboxd_agent_spool_budget_bytesgaugewhat the spool may use on disk, as of its last look
vulnboxd_agent_spool_disk_free_bytesgaugefree space on its filesystem, as of its last look
vulnboxd_agent_spool_memory_onlygauge1 while capture is kept in memory only (no room, a failing disk, or max_size: 0)
vulnboxd_agent_spool_gaps_pendinggaugegaps (capture given up) the hub has not been told about yet
vulnboxd_agent_spool_oldest_unacked_age_secondsgaugehow old the oldest capture not acknowledged yet is; 0 when the hub has everything
vulnboxd_agent_spool_writer_queuegaugesegments cut and waiting for the spool's writer; at 16 the capture starts losing them
vulnboxd_agent_spool_store_secondshistogramthe writer's work for one segment: compressing and storing it
vulnboxd_agent_spool_write_secondshistogramwriting one segment file, fsync included
vulnboxd_agent_spool_fsync_secondshistogramthe fsync alone
vulnboxd_agent_spool_delete_secondshistogramdeleting one segment file
vulnboxd_agent_spool_budget_recomputations_totalcountertimes the spool looked at the filesystem and worked its budget out again
vulnboxd_agent_spool_disk_fallbacks_totalcounterreasontimes it went to memory only for a while: no_room or write_failed
vulnboxd_agent_spool_acked_segments_totalcountersegments the hub acknowledged
vulnboxd_agent_spool_stored_segments_totalcounterkindsegments the writer stored, on disk or in memory: packets or host_events
vulnboxd_agent_spool_dropped_segments_totalcounterreasonsegments 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_totalcounterreasonthe 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 ​

metrictypelabels
vulnboxd_agent_capture_connectedgaugewhether the agent is reading the broker, 1 or 0
vulnboxd_agent_capture_reconnects_totalcountertimes the connection to the broker was lost or could not be made
vulnboxd_agent_capture_packets_totalcounterpackets read from the broker
vulnboxd_agent_capture_bytes_totalcountercaptured bytes of those packets
vulnboxd_agent_capture_backloggaugepackets read and not yet cut into segments; near 4096 the reader waits, and the broker may drop the agent
vulnboxd_agent_capture_segments_totalcounterresultsegments cut: queued for the writer, or lost because it was behind
vulnboxd_agent_capture_segment_age_secondshistogramhow long a segment had been collecting when it was cut; about 1 s when quiet, less when busy

Host events ​

metrictypelabels
vulnboxd_agent_sensor_connectedgaugewhether vulnboxd-sensor is connected and said hello, 1 or 0
vulnboxd_agent_sensor_connections_totalcounterconnections from the sensor accepted
vulnboxd_agent_sensor_replaced_totalcounterconnections closed because a newer one arrived
vulnboxd_agent_sensor_rejected_totalcounterreasonconnections refused: peer (another user), version, no_hello
vulnboxd_agent_sensor_decode_errors_totalcounterconnections closed because a frame did not read
vulnboxd_agent_host_events_totalcounterhost events taken from the sensor
vulnboxd_agent_host_events_dropped_totalcounterreasonhost events the agent dropped: channel_full (the cutter was behind) or writer_behind (the spool's writer was)
vulnboxd_agent_host_events_sensor_lost_totalcounterhost events the sensor reported it lost itself
vulnboxd_agent_host_events_backloggaugeevents taken and not yet cut into segments; at 65536 the agent drops them
vulnboxd_agent_host_event_segments_totalcounterresultsegments cut: queued for the writer, or lost because it was behind

File pulls and the inventory ​

metrictypelabels
vulnboxd_agent_file_pulls_totalcounteroutcomefiles 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_totalcounterbytes of files pulled
vulnboxd_agent_file_pull_secondshistogramone pull, from taking it up to having the result
vulnboxd_agent_inventory_reads_totalcounterresultreads of inventory.json after it changed, parsed or failed

Containers and shells ​

metrictypelabels
vulnboxd_agent_container_requests_totalcounterop, outcomecontainer requests from the hub (overview, inspect, restart, logs, exec): ok, failed, refused, busy
vulnboxd_agent_shell_sessionsgaugeshells open now
vulnboxd_agent_container_streamsgaugelog streams open now
vulnboxd_agent_container_stream_output_bytes_totalcountershell output and log bytes sent to the hub
vulnboxd_agent_shell_input_bytes_totalcountershell input written into containers
vulnboxd_agent_shell_processes_killed_totalcounterprocesses a shell left behind, killed when it ended
vulnboxd_agent_container_outbox_full_totalcountercontainer frames dropped because the outbox to the hub was full (32 MiB; never in normal use)
vulnboxd_agent_inventory_updates_totalcounterinventories handed to the uplink because they changed or were due a refresh
vulnboxd_agent_bisect_requests_totalcounterresultbisect start and stop requests from the hub, left for vulnboxd or refused (agent.bisect off, or no such service)

Rule pushes ​

metrictypelabels
vulnboxd_agent_rules_step_secondshistogramstepeach step of applying a rule push: current (reading the file), validate, write, load (waiting for vulnboxd), commit, push
vulnboxd_agent_rules_results_totalcounterstepsteps reported to the hub: validated, rejected, conflict, refused, live, committed, pushed, push_failed
vulnboxd_agent_rules_unpushedgaugeservices 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 ​

metrictypelabels
vulnboxd_agent_collect_secondshistogramwhatasking for vulnboxd's state (every second), or putting the manifest together (every 10 s)
vulnboxd_agent_collect_changes_totalcounterwhattimes the state or manifest was handed to the uplink because it changed or was due
vulnboxd_agent_state_step_secondshistogramstepputting the state together: scrape (vulnboxd's metrics), build (state directory, compose files, Git)
vulnboxd_agent_state_scrapes_totalcounterresultscrapes of vulnboxd's metrics, ok or failed
vulnboxd_agent_rule_hits_behind_bytesgaugehow far vulnboxd's rule-hit log has grown past what the agent has read
vulnboxd_agent_rule_hits_read_totalcounterrule hits read from the log
vulnboxd_agent_rule_hits_read_secondshistogramone read of the log
vulnboxd_agent_rule_hits_dropped_lines_totalcounterlines skipped as too long or not a hit
vulnboxd_agent_rule_hits_rotations_lost_totalcountertimes 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_totalthe 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.

metrictypelabels
vulnboxd_sensor_events_totalcounterkind, ophost events seen, before roll-up
vulnboxd_sensor_events_sent_totalcounterevents handed on after roll-up (a rolled-up event counts once)
vulnboxd_sensor_records_totalcounterring buffer records read
vulnboxd_sensor_userspace_seconds_totalcountertime spent turning records into events; divided by records, the cost of one
vulnboxd_sensor_kernel_dropped_totalcounterkindrecords the programs dropped because the ring buffer was full
vulnboxd_sensor_rate_limited_totalcounterkindrecords dropped because their cgroup was over sensor.rate_limit
vulnboxd_sensor_kernel_errors_totalcounterreasonpending_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_totalcounterexecutable-memory events not recorded for a JIT runtime
vulnboxd_sensor_ringbuf_pending_bytesgaugebytes waiting in the ring buffer when last looked at
vulnboxd_sensor_ringbuf_size_bytesgaugeits size
vulnboxd_sensor_program_loadedgaugeprogramwhether the eBPF program loaded, 1 or 0
vulnboxd_sensor_program_attachmentsgaugeprogramplaces it is attached to
vulnboxd_sensor_attach_failures_totalcounterprogramloads and attachments that failed; the sensor carries on without them
vulnboxd_sensor_program_runs_totalcounterprogramtimes the program ran
vulnboxd_sensor_program_run_seconds_totalcounterprogramtime spent in it; divided by runs, its cost per event
vulnboxd_sensor_rollup_keysgaugeevent shapes the roll-up tracks
vulnboxd_sensor_rolled_up_totalcounteroccurrences counted into a repeat instead of sent
vulnboxd_sensor_rollup_evicted_totalcountershapes forgotten early for room
vulnboxd_sensor_cgroupsgaugecgroups watched
vulnboxd_sensor_processesgaugeprocesses tracked
vulnboxd_sensor_usdt_probes_attachedgaugeUSDT probe sites attached (once per file)
vulnboxd_sensor_usdt_filesgaugefiles with attached probes
vulnboxd_sensor_usdt_processesgaugeprocesses scanned for probes
vulnboxd_sensor_usdt_attach_failures_totalcounterprobes found but not attached or not understood
vulnboxd_sensor_usdt_semaphores_raised_totalcounterprobe 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_totalcountermapped 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_totalcounterprobe 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_totalcounterprobe 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_budgetgaugethe 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_knowngaugeprobe descriptions held; forgotten when no attached site uses them any more
vulnboxd_sensor_usdt_requests_dropped_totalcounterscan requests dropped because the scanner thread was busy
vulnboxd_sensor_kernel_offsets_missinggaugekernel struct members this kernel's BTF lacks
vulnboxd_sensor_agent_connectedgaugewhether it is connected to the agent, 1 or 0
vulnboxd_sensor_agent_connects_totalcounterconnections made to the agent
vulnboxd_sensor_agent_frames_total, …_bytes_total, …_events_totalcounterwhat was written to the agent
vulnboxd_sensor_agent_dropped_events_totalcounterreasonevents dropped rather than wait: queue_full or disconnected; the agent hears of them as a lost event
vulnboxd_sensor_agent_queued_eventsgaugeevents 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.

metrictypelabels
vulnboxd_pcap_capturinggaugewhether the capture command (tcpdump) is running, 1 or 0
vulnboxd_pcap_captures_started_totalcountertimes the capture command was started in this process
vulnboxd_pcap_capture_packets_totalcounterpackets read from the capture
vulnboxd_pcap_capture_bytes_totalcounterbytes of packet records read from it, record headers included
vulnboxd_pcap_clientsgaugePCAP-over-IP readers connected now, the agent among them
vulnboxd_pcap_clients_accepted_totalcounterreaders that connected and were sent the header
vulnboxd_pcap_clients_dropped_totalcounterreaders disconnected for falling more than pcap.buffer_mb behind
vulnboxd_pcap_relayed_packets_totalcounterpackets handed to readers, once per reader
vulnboxd_pcap_relayed_bytes_totalcounterbytes written to readers' sockets
vulnboxd_pcap_backlog_bytesgaugebytes handed to readers and not written yet, all of them together
vulnboxd_pcap_max_client_backlog_bytesgaugethe most any one reader had waiting, as of the last packet; at pcap.buffer_mb it is dropped
vulnboxd_pcap_interfacesgaugewith 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_totalcounterwith pcap.interfaces: interface captures that ended and were started again (with a growing pause, up to 30s)
vulnboxd_pcap_unconvertible_packets_totalcounterwith 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 ​

metrictype
hub_ingest_connectedgaugewhether the agent is connected now, 1 or 0
hub_ingest_connections_totalcounteragent connections that got as far as saying hello
hub_ingest_dropped_connections_totalcounterconnections ended by an error or a protocol violation
hub_ingest_frames_totalcounterframes received from the agent
hub_ingest_segments_totalcountersegments stored and acknowledged
hub_ingest_segment_bytes_totalcountercompressed bytes of segments stored
hub_ingest_duplicate_segments_totalcountersegments received again after they were stored; acknowledged and ignored
hub_ingest_last_seqgaugethe seq of the newest stored segment
hub_ingest_rule_hits_totalcounterrule hits stored
hub_ingest_rule_hits_lost_totalcounterrule hits received that could not be stored. The agent counts them delivered, so they are not sent again
hub_ingest_pushes_sent_totalcounterrule pushes delivered to the agent
hub_ingest_rule_results_totalcounterrule push steps the agent reported
hub_agent_rule_hits_dropped_totalcounterlines 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_totalcountertimes the rule-hit log rotated twice before the agent read on, losing hits, as it last reported
hub_ingest_newest_capture_secondsgaugecapture time of the newest packet stored, as a Unix time; time() - it is how far the hub is behind the vulnbox
hub_ingest_gaps_totalcountergaps the agent reported (segments it dropped before sending them) that lost something not stored
hub_ingest_gap_segments_totalcountersegments lost in those gaps
hub_ingest_gap_bytes_totalcountercompressed bytes lost in those gaps
hub_ingest_pushes_refused_totalcounterrule pushes refused for their author's rate limit
hub_agent_last_heartbeat_secondsgaugewhen the agent's last heartbeat arrived, by the hub's clock
hub_agent_capture_connectedgaugewhether the agent reaches the capture broker on the vulnbox, 1 or 0
hub_agent_memory_onlygaugewhether the agent has no usable disk and holds segments in memory only
hub_agent_spool_bytesgaugebytes the agent's spool holds
hub_agent_spool_budget_bytesgaugebytes the spool may hold now
hub_agent_disk_free_bytesgaugefree space on the spool's filesystem
hub_agent_segments_pendinggaugesegments the agent holds that the hub has not acknowledged
hub_agent_oldest_unacked_secondsgaugehow long the oldest of them has waited
hub_agent_dropped_bytes_totalcountercapture the agent dropped because its spool budget ran out
hub_agent_broker_reconnects_totalcountertimes the agent reconnected to the capture broker
hub_ingest_host_segments_totalcounterhost-event segments stored and acknowledged
hub_ingest_host_events_totalcounterhost events in them
hub_ingest_proxy_requests_totalcounterlines of vulnboxd's proxy request log stored
hub_ingest_proxy_requests_lost_totalcounterrequest log lines received that could not be stored
hub_ingest_inventories_totalcounterversions of vulnboxd's inventory stored (only ones that changed)
hub_ingest_file_pulls_sent_totalcounterfile pulls delivered to the agent
hub_ingest_file_results_totalcounterfile pull results the agent sent back
hub_agent_sensor_connectedgaugewhether vulnboxd-sensor is connected to the agent, 1 or 0
hub_agent_host_events_totalcounterhost events the agent took from the sensor
hub_agent_host_events_dropped_totalcounterhost events the agent dropped because it could not keep up
hub_agent_host_events_sensor_lost_totalcounterhost events the sensor reported lost (its ring buffer was full)
hub_agent_proxy_log_dropped_totalcounterlines of the request log the agent skipped because they were not requests
hub_agent_proxy_log_rotations_lost_totalcountertimes the request log rotated twice before the agent read on
hub_agent_file_pulls_failed_totalcounterfile 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 ​

metrictype
hub_assemble_behindgaugesegments stored but not assembled yet
hub_assemble_checkpointgaugethe seq of the last segment assembled
hub_assemble_segments_totalcountersegments assembled
hub_assemble_bad_segments_totalcountersegments skipped because their object was missing or did not open
hub_assemble_packets_totalcounterpackets fed to the assembler
hub_assemble_flow_rows_totalcounterflow rows written
hub_assemble_chunk_rows_totalcounterchunk rows written
hub_assemble_http_rows_totalcounterHTTP exchange rows written
hub_assemble_db_op_rows_totalcounterdatabase operation rows written
hub_assemble_open_flowsgaugeflows the assembler holds open
hub_assemble_ignored_flows_totalcounterflows ignored after a rewind because they began before it
hub_assemble_orphan_outputsgaugechunks and exchanges for flows the hub never saw, which should not happen
hub_assemble_rebuilds_totalcountertimes the assembler was rebuilt because the manifest changed what it needs to know
hub_assemble_newest_capture_secondsgaugecapture 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_flowsgaugeended flows held back a minute for rule hits that may still arrive
metrictype
hub_link_host_segments_totalcounterhost-event segments read and stored
hub_link_host_events_totalcounterhost events stored
hub_link_bad_host_events_totalcounterlines of host-event segments that did not read
hub_link_bad_segments_totalcounterhost-event segments skipped because their object was missing or did not open
hub_link_host_checkpointgaugethe seq of the last host-event segment read
hub_link_host_behindgaugehost-event segments stored but not read yet
hub_link_process_rows_totalcounterprocess rows written (on fork, exec, exit)
hub_link_live_processesgaugeprocesses the linker knows to be running
hub_link_links_totalcounterlinks written
hub_link_unmatched_totalcounterjoins that found nothing to link to
hub_link_ambiguous_totalcounterjoins that found more than one candidate, which link nothing
hub_link_join_lag_secondsgaugehow far the join pass's checkpoint is behind the hub's clock
hub_link_summaries_totalcounterflow host summaries written again (what host filters read)
hub_link_summaries_pendinggaugeflows queued for their host summary (500 are written per pass, oldest first; the rest wait for the next passes)
hub_link_summaries_dropped_totalcounterflows not queued for a summary because 200 000 were waiting already
hub_link_tags_totalcounterbuilt-in host tags given

alert ​

The alert worker: baselines learned, alerts raised, webhooks posted to.

metrictype
hub_alert_passes_totalcounterpasses over a window of event time
hub_alert_observations_totalcounterobservations judged: HTTP exchanges, database operations, host events, proxy connections
hub_alert_truncated_totalcountersources 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_totalcounteralerts raised
hub_alert_recurrences_totalcounteroccurrences counted on an alert raised before (deduplicated)
hub_alert_muted_totalcounteralerts raised muted by a mute rule
hub_alert_baseline_itemsgaugebaseline items known, in a baseline or not
hub_alert_unusual_itemsgaugeitems seen outside the baseline and not learned or accepted since
hub_alert_checkpoint_secondsgaugethe event time passes have covered, as a Unix time
hub_alert_lag_secondsgaugehow far the checkpoint is behind the hub's clock: alerts come at least this late
hub_alert_webhook_held_back_totalcounterwebhook messages held back by a webhook's limit a minute (summed up in one message later)

With labels:

metrictypelabels
hub_alert_raised_by_kind_totalcounterkind, severityalerts raised, by kind and severity
hub_alert_suppressed_totalcounterkindnew alerts past the per-pass limit, counted on a flood alert instead
hub_alert_items_learned_totalcounterkind, originitems taken into a baseline by the alert worker, by item kind and warmup (accepted items are not counted here)
hub_alert_webhook_messages_totalcounterformat, resultwebhook messages by discord, slack, generic, and sent, failed or dropped (the queue of 1000 was full)
hub_alert_webhook_send_secondshistogramhow long posting one message took, waits for a rate limit included
hub_alert_pass_secondshistogramhow 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.

metrictype
hub_api_responses_2xx_totalcounter/api requests answered with a 2xx status, by a signed-in user
hub_api_responses_3xx_totalcounter/api requests answered with a 3xx status
hub_api_responses_4xx_totalcounter/api requests answered with a 4xx status: refused input, conflicts, rate limits
hub_api_responses_5xx_totalcounter/api requests answered with a 5xx status: ClickHouse unreachable, a query past its time limit, a bug
hub_api_live_streamsgaugelive-update streams (browser tabs) open on this replica
hub_api_previews_totalcounterrule previews (what a draft rule would have matched) started on this replica
hub_api_previews_runninggaugerule previews running on this replica
hub_api_tag_rule_runs_totalcountertag rule runs over past flows started on this replica
hub_api_tag_rule_runs_runninggaugetag rule runs over past flows running on this replica
hub_api_users_onlinegaugepeople 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_secondsgaugethe 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:

metrictypelabels
hub_clickhouse_query_secondshistogramcomponent, op, tablehow 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_totalcountercomponent, op, table, classfailed statements; class is timeout, oom, unavailable or other
hub_clickhouse_queries_in_flightgaugecomponent, opstatements running now
hub_clickhouse_inserted_rows_totalcountercomponent, tablerows written
hub_clickhouse_inserted_bytes_totalcountercomponent, tablebytes written, as RowBinary
hub_clickhouse_insert_rowshistogramcomponent, tablerows per insert
hub_clickhouse_read_rows_totalcountercomponent, tablerows read
hub_clickhouse_read_bytes_totalcountercomponent, tablebytes of results received (the API's queries)
hub_store_secondshistogramcomponent, backend, opsegment store operations; backend is file or s3, op is put, get or head
hub_store_bytes_totalcountercomponent, backend, opbytes written and read
hub_store_errors_totalcountercomponent, backend, opfailed operations, a missing object read among them

ingest:

metrictypelabels
hub_ingest_frames_by_type_totalcountertypeframes received, by type: segment, heartbeat, events, ...
hub_ingest_frame_bytes_totalcountertypetheir bytes on the wire (inside TLS)
hub_ingest_segment_stage_secondshistogramstagetaking in a segment: verify (sizes, checksum), store (its object), row (its seq and row)
hub_ingest_ack_secondshistogramfrom a segment's frame being read to its acknowledgement being queued
hub_ingest_last_segment_idgaugethe id, in the agent's epoch, of the newest segment stored
hub_ingest_segments_by_kind_totalcounterkindsegments stored, by what they hold: packets, host_events
hub_ingest_file_pull_bytes_totalcounterbytes of pulled files stored
hub_ingest_file_pull_failures_totalcounterfile pulls that failed on the agent or did not match their hash
hub_ingest_file_pulls_queuedgaugefile pulls waiting for delivery at the last look
hub_ingest_relay_requests_totalcountercontainer requests the API passed to the agent through the relay
hub_ingest_relay_requestsgaugecontainer requests and streams open through the relay
hub_ingest_relay_overflows_totalcounterstreams ended because the API did not take their output
hub_ingest_relay_refused_totalcounterrelay connections refused for a wrong token
hub_link_links_by_method_totalcountermethodlinks written by link, by the rule that proved them: proxy_log, conntrack, lineage, socket_tuple, socket_inheritance, unambiguous_ownership, hook
hub_ingest_resume_backlog_segmentsgaugesegments the agent held beyond what was stored when it last connected
hub_ingest_connection_started_secondsgaugewhen the connection being served said hello; 0 while there is none
hub_ingest_handshake_failures_totalcounterreasonconnections that ended before or at hello: connect, tls, tls_timeout, hello_timeout, not_hello, version, closed
hub_ingest_connection_ends_totalcounterreasonserved connections that ended: closed, dropped, replaced, failed
hub_ingest_outbound_queuegaugeframes waiting to be written to the agent, 64 at most
hub_ingest_push_poll_secondshistogramone look for queued rule pushes, delivery included
hub_ingest_pushes_queuedgaugepushes waiting for delivery at the last look

assemble:

metrictypelabels
hub_assemble_batch_secondshistograma batch of up to 32 segments, from reading to the checkpoint
hub_assemble_stage_secondshistogramstageits steps: read, assemble (fetching and opening segments, joining rule hits), write, checkpoint
hub_assemble_batch_segmentshistogramsegments per batch
hub_assemble_batch_packetshistogrampackets per batch
hub_assemble_newest_stored_seqgaugethe newest seq stored, as of the last checkpoint
hub_assemble_buffered_bytesgaugepayload the assembler holds in open flows' buffers
hub_assemble_assembler_flowsgaugeconnections the assembler tracks as open
hub_assemble_ignored_open_flowsgaugeflows ignored now because they began before the rewind
hub_assemble_evicted_flows_totalcounterflows closed early to stay within the flow limit
hub_assemble_undecodable_packets_totalcounterpackets that did not decode
hub_assemble_rule_hit_lookup_secondshistogramreading a batch's rule hits, every page
hub_assemble_rule_hit_pages_totalcounterpages of rule hits read
hub_assemble_rule_hit_rows_totalcounterrows of rule hits read (the first and last per second)
hub_assemble_rewinds_totalcounterrewinds on start
hub_assemble_rewind_segments_totalcountersegments read again by them
hub_assemble_rewindinggaugewhether one is going on now
hub_assemble_rewind_secondsgaugehow long the last one took
hub_assemble_anomaly_secondshistogramanomaly detection on one HTTP exchange, request and response
hub_assemble_anomaly_exchanges_totalcounterresultexchanges by what anomaly detection did: analyzed, skipped (it is off), failed (the decoder's guard tripped; stored as sent)
hub_assemble_anomaly_flagged_exchanges_totalcounterexchanges it found anomalies in
hub_assemble_anomaly_rules_totalcounterseveritydistinct anomaly rules found per exchange: info, notice, warning, high
hub_assemble_anomaly_bytes_totalcounterbody bytes it decoded
hub_assemble_anomaly_enabledgaugewhether anomaly detection is on, as the setting and --anomaly-detection say
hub_assemble_db_ops_totalcounterprotocol, statusdatabase 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_totalcounterprotocoldatabase operations whose result held a flag
hub_assemble_db_flows_totalcounterprotocol, stateflows 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:

metrictypelabels
hub_api_request_secondshistogramroute, 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_flightgaugerequests being answered now
hub_api_jobs_started_totalcounterkindbackground jobs: preview, tag_run
hub_api_jobs_finished_totalcounterkind, resultended jobs: done, failed, cancelled, unavailable
hub_api_job_secondshistogramkind, resulthow long they ran
hub_api_jobs_runninggaugekindjobs running now
hub_api_preview_evaluate_secondshistogramthe rule engine's exact evaluation of one batch of a preview's requests
hub_api_preview_evaluated_totalcounterstored requests evaluated for previews
hub_api_preview_matched_totalcounterof those, ones the rule matched
hub_api_robustness_checks_totalcounterrule robustness checks (mutation replays, checkRuleRobustness) run
hub_api_tagger_pass_secondshistogramone pass of the enabled tag rules over new flows
hub_api_tag_rule_applications_totalcounterresultone rule's pass: ok, failed
hub_api_live_poll_secondshistogramone round of the live poller
hub_api_live_poll_errors_totalcountersourcefailed parts of it: flows, time, pushes, annotations, presence, state
hub_api_live_replay_eventsgaugeevents kept to replay to reconnecting tabs
hub_api_live_streams_opened_totalcounterstreams opened
hub_api_live_resumes_totalcounterstreams that resumed from a cursor
hub_api_live_replayed_events_totalcounterevents replayed to them
hub_api_live_resets_totalcounterreasonstreams told to reload instead, by the reason sent
hub_api_live_byes_totalcounterstreams closed because their user opened more than the cap
hub_api_live_events_sent_totalcountereventevents written to streams
hub_api_presence_writes_totalcounterkindpresence rows written: open, gone, refresh, view
hub_api_logins_totalcounterresult, reasonsign-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_totalcounterresultfetches of the issuer's signing keys
hub_api_scripts_totalcounterlanguage, resultexploit scripts generated
hub_api_pushes_created_totalcounterop, shadowrule 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:

binaryprefix
vulnboxdvulnboxd
vulnboxd-agentvulnboxd_agent
vulnboxd-pcapvulnboxd_pcap
vulnboxd-hub ingesthub_ingest
vulnboxd-hub assemblehub_assemble
vulnboxd-hub apihub_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 ​

metrictypelabels
<prefix>_process_resident_memory_bytesgaugememory resident in RAM
<prefix>_process_virtual_memory_bytesgaugeaddress space mapped, resident or not
<prefix>_process_cpu_seconds_totalcountermodeCPU time used: user in the program, system in the kernel on its behalf
<prefix>_process_threadsgaugeOS threads
<prefix>_process_open_fdsgaugeopen file descriptors
<prefix>_process_max_fdsgaugethe soft limit on them; absent when unlimited
<prefix>_process_start_time_secondsgaugewhen the process started, as a Unix time
<prefix>_heap_in_use_bytesgaugeglibc's heap: allocated and not yet freed
<prefix>_heap_free_bytesgaugeglibc's heap: freed, but kept by the allocator rather than returned to the system
<prefix>_heap_mmapped_bytesgaugeglibc's heap: large allocations mapped on their own
<prefix>_heap_arena_bytesgaugeglibc'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 ​

metrictypelabels
<prefix>_tokio_workersgaugethe async runtime's worker threads
<prefix>_tokio_alive_tasksgaugeasync tasks spawned and not finished; climbing without end is a task leak
<prefix>_tokio_global_queue_depthgaugetasks waiting for a worker; staying above 0 means the workers cannot keep up
<prefix>_tokio_worker_busy_seconds_totalcounterworkertime the worker spent running tasks; its rate near 1 is a saturated worker
<prefix>_tokio_worker_park_totalcounterworkertimes the worker ran out of work and went to sleep
<prefix>_tokio_worker_park_unpark_totalcounterworkertimes 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 of daemon.poll, daemon.build, daemon.deploy, daemon.rollback, daemon.commit, monitor.ports and monitor.game — for those, restarts counts 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, and pcap.capture, which makes progress whenever packets arrive;
  • each also has telemetry.server, which serves the metrics; the hub has api.live and 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.

metrictypelabels
<prefix>_task_runninggaugetaskinstances of the task alive now, usually 1 or 0
<prefix>_task_stategaugetask, state1 for the state the task is in: running, idle, waiting, finished, failed, panicked or cancelled
<prefix>_task_restarts_totalcountertasktimes the task was started again after it had ended
<prefix>_task_last_progress_secondsgaugetaskwhen 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:

txt
(time() - vulnboxd_task_last_progress_seconds)
  and on (task) (vulnboxd_task_state{state=~"running|waiting"} == 1) > 60

Debug 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 ​

txt
# 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