Collected Metrics¶
Upgrading from a previous version?
If you are updating dashboards or alerts after an upgrade, see Upgrading for migration steps and examples.
We expose a large number of JVM and application metrics via the DropWizard Metrics library.
They can be exported by periodically writing as CSV files, logging, to InfluxDB, and/or via JMX. By default only the JMX reporter is enabled. See the comments on the metrics-reporters setting in the Config Ref Manual for how to enable / configure the reporters - i.e. the part on one of [jmx, csv, influxdb, slf4j]. The HTTP endpoint Metrics: GET /api/v2/system/metrics returns the counters, timers, and gauges as JSON, but not the meters or histograms.
Available Metrics¶
Each metric reports the standard statistics for its type:
| Type | Reports |
|---|---|
| Counter | A running Count. |
| Gauge | A single instantaneous value. |
| Meter | A Count, a mean rate, and 1-, 5-, and 15-minute rates (the one-minute rate is m1_rate in the CSV reporter's output and OneMinuteRate in JMX). |
| Histogram | Min, mean, max, standard deviation, and percentiles: the 50th, 75th, 95th, 98th, 99th, and 99.9th. |
| Timer | The percentiles of a histogram (as durations) plus the rates of a meter. |
For example, the 95th-percentile latency of persistor.persist-event and the one-minute ingest rate of quine.ingest.{name}.count are both available through JMX and the metrics reporters.
The REST endpoint reports a different set of statistics for each timer: min, max, mean, median, the quartiles q1 and q3, and the 10th, 20th, 80th, 90th, and 99th percentiles, in milliseconds, plus its one-minute rate as oneMinuteRate.
The metrics that we explicitly measure in our code are as follows.
- quine
- shard.shard-{n}
- sleep-counters: Counters that track the sleep cycle (in aggregate) of nodes on the shard
- removed
- slept-failure
- slept-success
- woken
- sleep-timers: Timers that measure the duration of sleep and wake operations on nodes
- slept
- woken
- nodes-evicted: Meter tracking node evictions from memory (only emitted when
quine.metrics.enable-debug-metricsis set) - unlikely: Counters that track occurrences of supposedly unlikely (and generally bad) code paths
- wake-up-failed: Despite repeated attempts, we cannot wakeup the requested node.
- wake-up-error: An unexpected error was encountered when attempting to wake up a node; will retry.
- hard-limit-reached: A node was blocked from being woken up because the hard limit for number of active nodes has been hit; will retry.
- actor-name-reserved
- incomplete-shutdown: A shard did not complete shutdown cleanly.
- sleep-counters: Counters that track the sleep cycle (in aggregate) of nodes on the shard
- node
- edge-counts: A counter for the numbers of edges on nodes, split into buckets
- 1-7
- 8-127
- 128-2047
- 2048-16383
- 16384-infinity
- property-counts: A counter for the numbers of properties on nodes, split into buckets
- 1-7
- 8-127
- 128-2047
- 2048-16383
- 16384-infinity
- property-sizes: A histogram of property sizes (in bytes) observed since startup
- mailbox-backlog.{node-id}: Gauge of the deepest this node's mailbox got during the last sample interval. Published only while the node is among the hottest on the host - see Hot node metrics.
- message-rate.{node-id}: Gauge of the messages per second this node received over that interval. Published for the same nodes as
mailbox-backlog.
- edge-counts: A counter for the numbers of edges on nodes, split into buckets
- ingest.{ingest-name}
- count: Number of records ingested
- bytes: Number of bytes ingested (aggregate data payload size)
- query: Timer measuring the duration of ingest query executions
- deserialization: Timer measuring the duration of ingest record deserialization. Only ingests that decode their records (a file ingest, for example) have it; a NumberIterator ingest does not.
- standing-queries
- results.{standing-query-name}: Meter of results that were produced for a named standing query on this member
- dropped.{standing-query-name}: Counter of results that were dropped for a named standing query on this member due to an excess of messages already in-flight when the standing query backpressures. This should be zero.
- states.{standing-query-id}: Histogram of the size (in bytes) of persistent standing query states.
- queue-time.{standing-query-name}: Timer measuring how long SQ results spend in the result queue before being accepted for processing
- shard.shard-{n}
- persistor: All are timers, except snapshot-sizes, which is a histogram.
- get-journal: Measures how long it takes to query a node's journal from the persistor
- get-latest-snapshot: Measures how long it takes to retrieve a node's snapshot from the persistor
- persist-event: Measures how long it takes to persist a change to a node's state.
- persist-snapshot: Measures how long it takes to persist a node's snapshot.
- set-standing-query-state: Measures how long it takes to persist standing query state.
- get-standing-query-states: Measures how long it takes to retrieve standing query states.
- snapshot-sizes: A histogram that measures the serialized size (in bytes) of a node's persisted snapshot.
- shard.shard-{n}
- delivery-relay-deduplicated: Counter of deduplicated message deliveries on this shard.
- shared
- valve.ingest: A gauge of how many standing queries are currently pausing ingest on this host because their result queues have reached the backpressure threshold. All ingest streams on the host share it;
0means ingest is not being held back.
- valve.ingest: A gauge of how many standing queries are currently pausing ingest on this host because their result queues have reached the backpressure threshold. All ingest streams on the host share it;
- node
- mailbox-sizes: A counter for the sizes of message mailboxes on nodes, split into buckets
- 1-7
- 8-127
- 128-2047
- 2048-16383
- 16384-infinity
- messages-received: Monotonic counter of messages received by node actors on this host, excluding re-deliveries of paused messages. A metrics backend derives exact and average message rates from it.
- mailbox-sizes: A counter for the sizes of message mailboxes on nodes, split into buckets
- dgn-reg
- count: Gauge measuring the number of in-memory registered DomainGraphNodes.
- llm.{profile}: Metrics reported per configured LLM profile, named by profile.
- requests: Calls made to the profile
- attempts: Attempts to send a request, counting retries, including attempts that a full queue or a stopped pool refused
- failures: Calls that failed after any retries
- latency: Timer over the full call, including queue wait and retries
- input-tokens, output-tokens: Token usage that the model endpoint reports on successful responses, read from the token fields of the profile's api type
Hot node metrics¶
node.mailbox-sizes counts how many mailboxes are deep. These name which nodes they are.
Every sample-interval, Quine scans the node mailboxes on the host and ranks them three ways: by mailbox backlog (the deepest queues), by message rate (the nodes taking the most traffic), and by estimated wait (the nodes falling furthest behind for their traffic). Every node selected by any of the three rankings gets two gauges:
| Gauge | Reports |
|---|---|
quine.node.mailbox-backlog.{node-id} |
the deepest the mailbox got during the interval |
quine.node.message-rate.{node-id} |
messages per second received over the interval |
{node-id} is what strId(n) returns for the node, with every character outside A-Za-z0-9_- replaced by _. A node read at a historical moment carries an -at-{millis} suffix.
Backlog is the peak over the interval rather than the depth at the moment of sampling: a hot node's queue fills in a burst and drains within milliseconds, so an instantaneous reading misses it as often as not. Message rate excludes re-deliveries of paused messages, so a message stashed once is counted once.
Estimated wait is not published as a gauge. It is Little's law over the two that are: peak backlog divided by message rate, which gives the seconds a message spends in the mailbox. That is what separates a node falling behind at a modest rate from a hub that is busy but keeping up. A node holding messages while receiving none is stalled, and ranks first.
Gauges are removed as nodes leave the rankings, so at most top-n × 3 nodes are published at once: 30 nodes, 60 gauges, by default.
These are configured under quine.metrics.hot-nodes (see Configuration):
| Setting | Default | Effect |
|---|---|---|
enabled |
yes |
whether to publish these gauges at all |
top-n |
10 |
how many nodes each ranking reports |
min-backlog |
10 |
peak depth a mailbox must reach to be ranked by backlog |
min-message-rate |
100.0 |
messages per second a node must receive to be ranked by rate |
min-wait-seconds |
1.0 |
estimated wait a node must reach to be ranked by wait |
sample-interval |
10 s |
how often the rankings are recomputed |
Unlike the debug metrics, these are published by default and are not gated behind enable-debug-metrics.
JVM Metrics¶
In addition to the application metrics above, standard JVM metrics are exported. These are not prefixed by the graph name.
- memory: JVM memory usage gauges
- heap.used, heap.max, heap.committed, heap.usage (
heap.usageis used divided by max) - non-heap.used, non-heap.committed (and the other
non-heap.*gauges) - total.used, total.max (combined heap + non-heap)
- heap.used, heap.max, heap.committed, heap.usage (
- gc: Garbage-collector metrics, per collector (e.g.
count,time) - buffers: Direct and mapped buffer-pool usage
Other libraries we use also export metrics via this mechanism. When the persistor is Cassandra, the Cassandra driver reports s{n}.cql-requests (a timer), s{n}.bytes-sent, and s{n}.bytes-received for its session, and s{n}.nodes.{host:port}.pool.available-streams and .pool.in-flight for each Cassandra node, with no configuration; {n} is the driver session's number. Other driver metrics can be enabled in your config file: https://docs.datastax.com/en/developer/java-driver/4.17/manual/core/metrics/#enabling-specific-driver-metrics.