You are reading the documentation of OpenCTI 7.260309 LTS · 7.260309.0-lts.8, supported until 2027-04.Latest is 7.261119.0 →
Reference

Observability metrics

The Prometheus and OpenTelemetry metrics OpenCTI, OpenAEV and OpenCRQ expose for your own monitoring, how to turn them on in the XTM stack and what each one measures.

OpenCTIOpenAEVOpenCRQFor platform engineers

OpenCTI, OpenAEV and OpenCRQ expose observability metrics for your own monitoring system, such as Prometheus or an OpenTelemetry (OTLP) collector. This page says how to turn them on in the XTM stack, where to scrape them and what the metrics measure. They are all off by default.

PLATFORMSYOUR MONITORINGOpenCTI/metrics on port 14269OpenCTI workersPort 14270OpenAEV/actuator/prometheus, bearer keyOpenCRQ/metrics on port 14269PrometheusScrapes the endpointsOTLP collectorMetrics, traces, logsZipkinTracesPyroscopeCPU and memory profiles
  1. OpenCTI → Prometheus: scraped
  2. OpenCTI workers → Prometheus: scraped
  3. OpenAEV → Prometheus: scraped with key
  4. OpenCRQ → Prometheus: scraped
  5. OpenCRQ → OTLP collector: pushed
  6. OpenCTI → OTLP collector: pushed
  7. OpenCTI → Zipkin: traces
  8. OpenCTI → Pyroscope: profiles
Your Prometheus scrapes the metrics of OpenCTI, its workers, OpenAEV and OpenCRQ, and OpenCTI and OpenCRQ can also push metrics, traces and profiles to your own collectors
Not usage telemetry

These metrics stay in your infrastructure. The anonymous usage data the platforms send to Filigran is something else: see Usage telemetry and privacy, and the usage telemetry of OpenCRQ.

Turn the metrics on

The platform services of xtm-docker take their settings from docker-compose.yml and the files it includes, in modules/. To add a setting without editing these files, put it in docker-compose.override.yml: see Change the stack without editing docker-compose.yml.

OpenCTI

OpenCTI exports its metrics with OpenTelemetry, to a Prometheus endpoint, an OTLP collector or both.

KeyEnvironment variableDefaultWhat it does
app:telemetry:metrics:enabledAPP__TELEMETRY__METRICS__ENABLEDfalseTurns the metrics on
app:telemetry:metrics:exporter_prometheusAPP__TELEMETRY__METRICS__EXPORTER_PROMETHEUS14269Port of the Prometheus endpoint, served at /metrics
app:telemetry:metrics:exporter_otlpAPP__TELEMETRY__METRICS__EXPORTER_OTLPemptyURL of an OTLP collector to push the metrics to every second. Empty: no push
  1. Create docker-compose.override.yml in the xtm-docker folder, or add to it.

    services:
      opencti:
        environment:
          - APP__TELEMETRY__METRICS__ENABLED=true
    
  2. Recreate the platform.

    docker compose up -d opencti
    
    Check that it worked
    docker compose exec opencti wget -qO- http://localhost:14269/metrics | grep '^# TYPE opencti_'
    

    It lists the opencti_ metrics.

The port is not published on the host. Scrape opencti:14269 from a Prometheus on the Docker network of the stack, or publish the port with a ports entry in the override file.

The OpenCTI workers have their own Prometheus endpoint: set WORKER_TELEMETRY_ENABLED=true on the worker service, and each worker serves its metrics on port 14270 (WORKER_PROMETHEUS_TELEMETRY_PORT).

OpenAEV

OpenAEV serves its metrics on its API port, at /actuator/prometheus. The endpoint answers only a request that carries the metrics key as a bearer token, and with no key set, it refuses every request.

KeyEnvironment variableDefaultWhat it does
openaev.metrics.keyOPENAEV_METRICS_KEYemptyThe key Prometheus sends as Authorization: Bearer <key>. Empty: the endpoint answers 401
  1. Generate a key and add it to .env.

    echo "OPENAEV_METRICS_KEY=$(openssl rand -hex 32)" >> .env
    
  2. Pass it to the platform in docker-compose.override.yml.

    services:
      openaev:
        environment:
          - OPENAEV_METRICS_KEY=${OPENAEV_METRICS_KEY}
    
  3. Recreate the platform.

    docker compose up -d openaev
    
    Check that it worked
    set -a; . ./.env; set +a
    curl -fsS -H "Authorization: Bearer $OPENAEV_METRICS_KEY" "http://localhost:8081/actuator/prometheus" | grep '^# TYPE openaev_'
    

    It lists the openaev_ metrics.

In a Prometheus scrape configuration, give the key with authorization: {credentials: <key>}.

OpenCRQ

OpenCRQ serves its metrics to Prometheus, pushes them to an OTLP collector, or both: each transport has its own switch. The Prometheus endpoint of a container gathers the metrics of all its processes.

Environment variableDefaultWhat it does
TELEMETRY__OBSERVABILITY__PROMETHEUS__ENABLEDfalseTurns the Prometheus endpoint on, served at /metrics
TELEMETRY__OBSERVABILITY__PROMETHEUS__PORT14269Port of the endpoint. On the port of the health check, HEALTHCHECK_HTTP_SERVER__PORT (8444 in xtm-docker), the endpoint stays off
TELEMETRY__OBSERVABILITY__PROMETHEUS__HOST0.0.0.0Address the endpoint listens on. 127.0.0.1 keeps it inside the container
TELEMETRY__OBSERVABILITY__OTLP__METRICS__ENABLEDfalseTurns the push to an OTLP collector on
TELEMETRY__OBSERVABILITY__OTLP__METRICS__EXPORTERNoneURL of the collector, over gRPC, such as http://otel-collector:4317. Required when the push is on
  1. Create docker-compose.override.yml in the xtm-docker folder, or add to it.

    services:
      opencrq:
        environment:
          - TELEMETRY__OBSERVABILITY__PROMETHEUS__ENABLED=true
    
  2. Recreate the platform.

    docker compose up -d opencrq
    
    Check that it worked
    docker compose exec opencrq wget -qO- http://localhost:14269/metrics | grep '^# TYPE opencrq_'
    

    It lists the opencrq_ metrics, such as opencrq_pm_processes.

The port is not published on the host, and the endpoint asks for no credentials: keep it on the Docker network of the stack. Anyone who reaches it reads the version of OpenCRQ, the address, port and name of its database, the processes and how many of each run, the SQLSTATE codes and the kinds of SQL operation of its queries, the name of every API procedure (trpc_procedure) and the kinds of background job (job_kind). No table name and no SQL text.

Scrape opencrq:14269 every 15 seconds or more. Within 5 seconds of a collection (TELEMETRY__OBSERVABILITY__PROMETHEUS__MIN_INTERVAL_MS), the endpoint serves the same document again.

scrape_configs:
  - job_name: opencrq
    scrape_interval: 15s
    static_configs:
      - targets: ["opencrq:14269"]

The names of earlier builds, such as TELEMETRY__METRICS__PROMETHEUS__ENABLED, stop the platform at start: see Telemetry.

OpenCTI traces and profiles

Beyond metrics, OpenCTI can send traces and continuous profiles, to follow a slow request through the platform. Both are off by default and cost some CPU: turn them on to investigate, or on one node.

Traces

With tracing on, OpenCTI sends an OpenTelemetry span for each GraphQL operation and for its calls to the databases and to Python, under the service name opencti-platform, with W3C trace context propagation. It sends them to an OTLP collector over HTTP, to Zipkin, or to both. Without an exporter URL, it sends nothing.

KeyEnvironment variableDefaultWhat it does
app:telemetry:tracing:enabledAPP__TELEMETRY__TRACING__ENABLEDfalseTurns tracing on
app:telemetry:tracing:exporter_otlpAPP__TELEMETRY__TRACING__EXPORTER_OTLPemptyFull URL of the OTLP HTTP traces endpoint, such as http://otel-collector:4318/v1/traces
app:telemetry:tracing:exporter_zipkinAPP__TELEMETRY__TRACING__EXPORTER_ZIPKINemptyURL of the Zipkin endpoint, such as http://zipkin:9411/api/v2/spans

Profiles

OpenCTI can send continuous profiling data to a Pyroscope server, to see which functions use the CPU and the memory of the platform.

KeyEnvironment variableDefaultWhat it does
app:telemetry:pyroscope:enabledAPP__TELEMETRY__PYROSCOPE__ENABLEDfalseTurns profiling on, at start
app:telemetry:pyroscope:exporterAPP__TELEMETRY__PYROSCOPE__EXPORTERemptyURL of the Pyroscope server
app:telemetry:pyroscope:identifierAPP__TELEMETRY__PYROSCOPE__IDENTIFIEROpenCTIApplication name of this platform in Pyroscope
ExampleTrace and profile a slow platform

Example CERT investigates slow searches on its OpenCTI. It sends traces to the OpenTelemetry collector of its monitoring stack and profiles to its Pyroscope server, under a name that tells this platform apart:

services:
  opencti:
    environment:
      - APP__TELEMETRY__TRACING__ENABLED=true
      - APP__TELEMETRY__TRACING__EXPORTER_OTLP=http://otel-collector.example.com:4318/v1/traces
      - APP__TELEMETRY__PYROSCOPE__ENABLED=true
      - APP__TELEMETRY__PYROSCOPE__EXPORTER=http://pyroscope.example.com:4040
      - APP__TELEMETRY__PYROSCOPE__IDENTIFIER=opencti-example-cert

After docker compose up -d opencti, docker compose logs opencti | grep Pyroscope shows Pyroscope plugin successfully loaded., and the traces of the opencti-platform service reach the collector.

OpenCTI metrics

app:schema_metrics is not an observability setting: it declares custom metrics on entities, data of the knowledge graph. See Functional customization.

The OpenCTI metrics reference lists every metric your version exports, with its kind, unit and attributes. They count GraphQL requests and errors (opencti_api_requests, opencti_api_errors), time each request (opencti_api_latency, in milliseconds), and measure emails sent and ingestion bulks.

Prometheus adds _total to the name of a counter and _bucket, _sum and _count to a histogram.

Attributes of the request metrics

opencti_api_requests, opencti_api_errors and opencti_api_latency carry these attributes:

AttributeValue
operationquery, mutation or subscription
nameName of the GraphQL operation, Unspecified when it has none
statusSUCCESS or ERROR
typeError type, such as FUNCTIONAL_ERROR, VALIDATION_ERROR or DATABASE_ERROR, on errors only
user_agentUser agent of the client, Unspecified when it sends none

Authentication and permission errors (AUTH_REQUIRED, AUTH_FAILURE, FORBIDDEN_ACCESS) are not counted as errors: the request goes to opencti_api_requests with the status SUCCESS.

Attributes of the email and bulk metrics

MetricAttributeValue
opencti_sent_emailcategoryWhy the email was sent: notification, user-notification, dissemination, password-reset, password-change or hub-registration
opencti_sent_emailidentifierID of what the email comes from: the user (user-<id> for user-notification), the dissemination list or the triggers of the notification. None for hub-registration
opencti_api_direct_bulk, opencti_api_side_bulktypeEntity type of the indexed elements, such as Report, History or Activity

opencti_api_direct_bulk records the size of each bulk request that writes elements to Elasticsearch. opencti_api_side_bulk records the size of the bulk request that then updates the entities at both ends of the relationships it wrote. Both count the lines of the request: two for each document.

Node.js runtime metrics

OpenCTI also exports the standard Node.js metrics of its process: CPU, memory, heap, event loop lag and garbage collection, such as process_resident_memory_bytes and nodejs_eventloop_lag_seconds.

OpenAEV metrics

MetricTypeWhat it measures
openaev_dependency_upGauge1 when the last check of a dependency succeeded, 0 when it failed. Attribute dependency: postgresql, rabbitmq, s3 or engine (Elasticsearch)
openaev_dependency_probe_duration_secondsGaugeDuration of the last check of each dependency
openaev_storage_used_bytesGaugeSize used in each store. Attribute storage: postgresql, engine or s3

OpenAEV checks its dependencies every openaev.healthcheck.connectivity-probe-interval (default PT10S, ten seconds) and measures the storage every openaev.healthcheck.storage-probe-interval (default PT4H). The endpoint also serves the standard Spring Boot and Java virtual machine metrics.

OpenCRQ traces, logs and profiles

OpenCRQ can also send traces and logs to an OTLP collector, and continuous profiles to Pyroscope. Each is off by default and has its own switch. Every process of the container sends its own data.

Environment variableDefaultWhat it does
TELEMETRY__OBSERVABILITY__SERVICE_NAMEopencrq-platformService name of the traces, logs and metrics, and application name in Pyroscope
TELEMETRY__OBSERVABILITY__OTLP__TRACES__ENABLEDfalseSends traces, such as a span for each HTTP request and each PostgreSQL query
TELEMETRY__OBSERVABILITY__OTLP__TRACES__EXPORTERNoneURL of the collector, over gRPC, such as http://otel-collector:4317. Required when traces are on
TELEMETRY__OBSERVABILITY__OTLP__LOGS__ENABLEDfalseSends the logs to the collector too. The container keeps writing them
TELEMETRY__OBSERVABILITY__OTLP__LOGS__EXPORTERNoneURL of the collector, over gRPC. Required when logs are on
TELEMETRY__OBSERVABILITY__PYROSCOPE__ENABLEDfalseSends memory and CPU profiles to Pyroscope
TELEMETRY__OBSERVABILITY__PYROSCOPE__SERVER_ADDRESSNoneURL of the Pyroscope server, such as http://pyroscope:4040. Required when profiling is on

A switch on without its URL stops the platform at start. With a switch off, OpenCRQ does not check the other settings of that transport, so an empty URL beside it is fine.

The data of each process carries its name in process.name: http, worker or pm, the process manager that supervises the other two. Pyroscope tags each profile with the same name and the process ID. When the OTLP collector does not answer, OpenCRQ logs the error once every 5 minutes, with the number of failures since.

ExampleSend the traces and logs of OpenCRQ to the collector

Example CERT sends the traces and logs of its OpenCRQ to the OpenTelemetry collector of its monitoring stack, under a name that tells this platform apart:

services:
  opencrq:
    environment:
      - TELEMETRY__OBSERVABILITY__SERVICE_NAME=opencrq-example-cert
      - TELEMETRY__OBSERVABILITY__OTLP__TRACES__ENABLED=true
      - TELEMETRY__OBSERVABILITY__OTLP__TRACES__EXPORTER=http://otel-collector.example.com:4317
      - TELEMETRY__OBSERVABILITY__OTLP__LOGS__ENABLED=true
      - TELEMETRY__OBSERVABILITY__OTLP__LOGS__EXPORTER=http://otel-collector.example.com:4317

After docker compose up -d opencrq, the collector receives the traces and the logs of the opencrq-example-cert service, with one process.name for each process.

Find OpenCTI's settings in OpenCRQ

OpenCRQ's observability settings do the work of OpenCTI's under other names, with three differences on purpose:

  • One root, TELEMETRY__: TELEMETRY__OBSERVABILITY__* for your monitoring and TELEMETRY__USAGE__* for the usage telemetry (Telemetry), where OpenCTI has APP__TELEMETRY__* and TELEMETRY_MANAGER__*.
  • One ENABLED switch for each transport of the metrics, the Prometheus endpoint and the OTLP push. OpenCTI has one switch for both, and turns each on by its port or its URL.
  • A log export to the OTLP collector, which OpenCTI does not have.
OpenCRQOpenCTIWhat differs
TELEMETRY__OBSERVABILITY__PROMETHEUS__ENABLEDAPP__TELEMETRY__METRICS__ENABLEDOpenCTI's switch turns both transports on
TELEMETRY__OBSERVABILITY__PROMETHEUS__PORTAPP__TELEMETRY__METRICS__EXPORTER_PROMETHEUSNothing: same default, 14269
TELEMETRY__OBSERVABILITY__PROMETHEUS__HOSTAPP__TELEMETRY__METRICS__EXPORTER_PROMETHEUS_HOST, from OpenCTI 7.261119Nothing: same default, 0.0.0.0
TELEMETRY__OBSERVABILITY__PROMETHEUS__COLLECT_TIMEOUT_MS, TELEMETRY__OBSERVABILITY__PROMETHEUS__ROUND_DEADLINE_MS, TELEMETRY__OBSERVABILITY__PROMETHEUS__MIN_INTERVAL_MS, TELEMETRY__OBSERVABILITY__PROMETHEUS__MAX_REPLY_BYTES, TELEMETRY__OBSERVABILITY__PROMETHEUS__PUBLIC_PORTNoneOpenCTI serves the metrics of its own process, with nothing to collect from others
TELEMETRY__OBSERVABILITY__OTLP__METRICS__ENABLEDAPP__TELEMETRY__METRICS__ENABLEDOpenCTI's switch turns both transports on
TELEMETRY__OBSERVABILITY__OTLP__METRICS__EXPORTERAPP__TELEMETRY__METRICS__EXPORTER_OTLPOpenCRQ pushes over gRPC every 60 seconds, OpenCTI over HTTP every second
TELEMETRY__OBSERVABILITY__OTLP__TRACES__ENABLEDAPP__TELEMETRY__TRACING__ENABLEDNothing
TELEMETRY__OBSERVABILITY__OTLP__TRACES__EXPORTERAPP__TELEMETRY__TRACING__EXPORTER_OTLPOpenCRQ sends over gRPC, to an address such as http://otel-collector:4317; OpenCTI over HTTP, to the full URL ending in /v1/traces. OpenCRQ has no Zipkin export
TELEMETRY__OBSERVABILITY__OTLP__LOGS__ENABLED, TELEMETRY__OBSERVABILITY__OTLP__LOGS__EXPORTERNoneOpenCTI does not export its logs
TELEMETRY__OBSERVABILITY__PYROSCOPE__ENABLEDAPP__TELEMETRY__PYROSCOPE__ENABLEDNothing
TELEMETRY__OBSERVABILITY__PYROSCOPE__SERVER_ADDRESSAPP__TELEMETRY__PYROSCOPE__EXPORTERNothing
TELEMETRY__OBSERVABILITY__SERVICE_NAMEAPP__TELEMETRY__PYROSCOPE__IDENTIFIER, for PyroscopeOpenCRQ's name also goes on its traces, logs and metrics. OpenCTI's traces always carry opencti-platform

OpenCRQ metrics

Every series carries the labels process_name, service_name and service_version. With the default split profile, process_name is http, worker or pm, the process manager, which sends the supervision metrics and the Node.js metrics of its own process. With the monolith profile, it is main or pm, and main sends what http and worker send.

The endpoint names a family after its OpenTelemetry name, with _ for each dot and _total after a counter; it never adds the unit, which the table gives. The OTLP push sends the dotted names, such as db.client.connection.count, every 60 seconds, with one more attribute, service.instance.id: the name and the process ID of the process, such as worker-412, new at every restart. The scraped series never carry it.

To read a container as a whole, add up a counter or a count across its processes, with sum by (instance), and keep instance in the grouping when Prometheus scrapes several containers, or their series are added together. Never add up a ratio or a delay, such as nodejs_eventloop_utilization or nodejs_eventloop_delay_mean: take its max or its avg. A percentile, such as nodejs_eventloop_delay_p99, cannot be combined across processes: take the worst one, with max.

MetricsTypeProcessesWhat they measure
opencrq_pm_processesGaugepmSupervised processes in each state of their lifecycle, attribute state: FORKING, BOOTING, STARTING, RUNNING, STOPPING, STOPPED, EXITED or ERROR
opencrq_pm_collection_ok, opencrq_pm_collection_duration, opencrq_pm_collection_failures_totalGauge, histogram, counterpmFor each process the endpoint collects (supervised_process, pm included): whether its last collection succeeded (1) or not (0), how long it took, in seconds, and its failures by reason: timeout, error, not_connected, not_running, oversized, invalid, empty or send_error. Only while the Prometheus endpoint runs: see How the endpoint collects the processes
db_client_connection_count, db_client_connection_limit, db_client_connection_pending_requestsGaugehttp, workerThe connections of each database pool, used or idle (attribute db_client_connection_state), the limit of the pool and the callers waiting for one
db_client_connection_wait_time, db_client_connection_use_time, db_client_connection_timeouts_totalHistogram, counterhttp, workerThe time to get a connection and the time it was held, in seconds, and the requests that timed out
opencrq_db_client_connection_reconnection_attempts_totalCounterhttp, workerAttempts to connect to the database again after an error of the pool
db_client_operation_durationHistogramhttp, workerDuration of the database queries, in seconds, by db_operation_name: SELECT, INSERT, UPDATE, DELETE or _OTHER. Also by server_address, server_port, db_namespace (the database), db_system_name and, when the PostgreSQL instrumentation reports it, error_type: a SQLSTATE of the classes 08, 22, 23, 25, 28, 3D, 40, 42, 53, 55, 57, 58 or XX, any other as _OTHER
opencrq_trpc_server_durationHistogramhttpDuration of the API calls, in seconds, by trpc_type (query or mutation) and error_type (a tRPC error code, such as NOT_FOUND, or _OTHER). No procedure, on purpose: it is on the counter below. Subscriptions are not measured
opencrq_trpc_server_calls_totalCounterhttpThe API calls, by procedure (trpc_procedure), trpc_type and error_type
opencrq_recompute_asks_totalCounterhttp, workerRequests to run a background job again, by job_kind, path, already_existed (true when the request joined a job already queued) and reason. The path is dispatcher (the dispatcher of background jobs), followup (asked by the platform after its own work), manual (asked from the interface) or sweep (a backfill). On the dispatcher path only, reason says why: change (the job's data changed), reconnect (catching up after a reconnection), daily (the daily run) or followup (its data changed during its last run). manual asks and some followup asks come from http
opencrq_recompute_unattributed_reads_totalCounterworkerRuns of a background job whose reads could not be tied to tables, so that any change of data asks for it again, by job_kind. An engineering signal
opencrq_recompute_feeding_cycles_totalCounterworkerKinds of background job whose reads and writes feed each other, by job_kind and cycle (the kinds joined by ->). They still run, and the log says Recompute jobs feed each other: their reads and writes form a cycle. An engineering signal
opencrq_opencti_mirror_rebuild_actors_totalCounterworkerThreats of the OpenCTI stream that a rebuild settled, by outcome: rebuilt, retracted (deleted in OpenCTI) or failed
opencrq_events_doorbells_total, opencrq_events_doorbell_proceduresCounter, histogramhttpThe data changes that make the open screens reload, by resolution (named, the queries it makes stale are known, or all), and how many queries each named one makes stale
opencrq_events_query_index_explains_total, opencrq_events_query_index_proceduresCounter, gaugehttpThe EXPLAIN statements run to learn which tables each query reads, by outcome (ok or refused), and the queries the index knows, by state: observed, declared, widened or without_reads. An engineering signal
nodejs_eventloop_utilization, nodejs_eventloop_delay_max, nodejs_eventloop_delay_mean, nodejs_eventloop_delay_p99GaugeEvery processLoad of the event loop, a ratio, and its delay, in seconds
nodejs_eventloop_time_totalCounterEvery processTime the event loop spent active or idle (attribute nodejs_eventloop_state), in seconds
v8js_gc_duration, v8js_memory_heap_usedHistogram, gaugeEvery processGarbage collection time, in seconds, every kind of collection in one series, and the heap used, in bytes, one series for each heap space (v8js_heap_space_name): add them up
process_cpu_time_total, process_cpu_utilization, process_memory_usageCounter, gaugeEvery processCPU time, in seconds, and share of the CPU, by cpu_mode (user or system), and memory of each process, in bytes

The series of a pool carry its name, db_client_connection_pool_name: host:port/database, such as pgsql:5432/opencrq in xtm-docker. Each of http and worker has two pools: the main one, of POSTGRES__POOL_MAX connections, and the one of the background jobs' leases, pgsql:5432/opencrq#control, of 5 connections.

A family appears only once it has something to report: a family that counts failures after the first one, such as db_client_connection_timeouts_total, and the wait and use times of a pool after its first connection. Write the panels and alerts so that a missing series counts as zero. or vector(0) gives a series without labels: it fills a total, not a series by process or by instance.

Histogram buckets

A panel or a histogram_quantile on le reads these bounds. A quantile never goes above the highest one.

HistogramBounds
db_client_operation_duration, db_client_connection_wait_time0.005, 0.025, 0.1, 0.5, 2, 10 and 60 seconds
db_client_connection_use_timeThe same, then 300 and 1800 seconds
opencrq_trpc_server_duration0.05, 0.25, 1, 5, 30 and 120 seconds
v8js_gc_duration0.001, 0.01, 0.1, 1, 5 and 10 seconds
opencrq_pm_collection_duration0.05, 0.25, 1, 2.5 and 4.5 seconds
opencrq_events_doorbell_procedures0, 1, 2, 5, 10, 20, 50 and 100 queries

Left out on purpose

OpenCRQ drops these families before either transport, so do not look for them:

  • The event loop delays other than the maximum, the mean and the p99: nodejs.eventloop.delay.min, nodejs.eventloop.delay.stddev, nodejs.eventloop.delay.p50 and nodejs.eventloop.delay.p90.
  • v8js.memory.heap.space.*, three families on the heap spaces v8js_memory_heap_used already reports, and v8js.resource.active, whose series would grow with what the process holds.
  • The HTTP and system metrics of the instrumentations: http.server.*, http.client.* and system.*.
  • The pool metrics of the PostgreSQL instrumentation, db.client.connection.*, including db.client.connection.max, the former name of the limit: OpenCRQ measures its pools itself, under the names of the table.

v8js.memory.heap.limit is never sent. OpenCRQ ships no dashboard and no alert rule.

Show OpenCRQ on OpenCTI's runtime dashboards

OpenCTI exports its Node.js metrics with the package opentelemetry-node-metrics 3.0.0, under other names than OpenCRQ's. These recording rules write OpenCRQ's under OpenCTI's names, so that a panel built on OpenCTI's Node.js metrics shows OpenCRQ unchanged, as long as it selects no job of its own: the recorded series keep job="opencrq". OpenCTI has no pool, query or supervision metrics, so only the Node.js metrics need a rule.

OpenCRQOpenCTIRule
nodejs_eventloop_delay_max, nodejs_eventloop_delay_mean, nodejs_eventloop_delay_p99nodejs_eventloop_lag_max_seconds, nodejs_eventloop_lag_mean_seconds, nodejs_eventloop_lag_p99_secondsRename. The p99 is the worst process's, not a percentile of the container
v8js_gc_durationnodejs_gc_duration_secondsRename. No kind label: the four kinds of collection are one series. OpenCTI's bounds are 0.001, 0.01, 0.1, 1, 2 and 5 seconds, so a panel on le="2" stays empty
v8js_memory_heap_usednodejs_heap_space_size_used_bytesRename of the metric and of its label, space, whose values lose their _space suffix
v8js_memory_heap_used, added up over the spacesnodejs_heap_size_used_bytesClose, not equal: OpenCTI's is the heap used that Node.js reports for the whole process
process_memory_usageprocess_resident_memory_bytesRename
process_cpu_time_total, user, system or bothprocess_cpu_user_seconds_total, process_cpu_system_seconds_total, process_cpu_seconds_totalRename, and a sum for the total
nodejs_eventloop_utilizationNone: a ratio, where OpenCTI measures a lagPoint the panel at nodejs_eventloop_lag_mean_seconds
process_cpu_utilizationNonePoint the panel at rate(process_cpu_seconds_total[5m])
nodejs_eventloop_time_totalNoneQuery it under its own name

Every rule selects job="opencrq". OpenCTI serves process_cpu_seconds_total, process_cpu_user_seconds_total, process_cpu_system_seconds_total and process_resident_memory_bytes too, and without the selector the series of both modules would be added together. Change it when your job has another name; never remove it.

groups:
  - name: opencrq-opencti-runtime
    rules:
      - record: nodejs_eventloop_lag_max_seconds
        expr: max without (process_name) (nodejs_eventloop_delay_max{job="opencrq"})
      - record: nodejs_eventloop_lag_mean_seconds
        expr: avg without (process_name) (nodejs_eventloop_delay_mean{job="opencrq"})
      - record: nodejs_eventloop_lag_p99_seconds
        expr: max without (process_name) (nodejs_eventloop_delay_p99{job="opencrq"})
      - record: process_resident_memory_bytes
        expr: sum without (process_name) (process_memory_usage{job="opencrq"})
      - record: nodejs_heap_size_used_bytes
        expr: sum without (process_name, v8js_heap_space_name) (v8js_memory_heap_used{job="opencrq"})
      - record: nodejs_heap_space_size_used_bytes
        expr: sum without (process_name, v8js_heap_space_name) (label_replace(v8js_memory_heap_used{job="opencrq"}, "space", "$1", "v8js_heap_space_name", "(.*)_space"))
      - record: process_cpu_user_seconds_total
        expr: sum without (process_name, cpu_mode) (process_cpu_time_total{job="opencrq", cpu_mode="user"})
      - record: process_cpu_system_seconds_total
        expr: sum without (process_name, cpu_mode) (process_cpu_time_total{job="opencrq", cpu_mode="system"})
      - record: process_cpu_seconds_total
        expr: sum without (process_name, cpu_mode) (process_cpu_time_total{job="opencrq"})
      - record: nodejs_gc_duration_seconds_bucket
        expr: sum without (process_name) (v8js_gc_duration_bucket{job="opencrq"})
      - record: nodejs_gc_duration_seconds_sum
        expr: sum without (process_name) (v8js_gc_duration_sum{job="opencrq"})
      - record: nodejs_gc_duration_seconds_count
        expr: sum without (process_name) (v8js_gc_duration_count{job="opencrq"})

The mean is exact only when every process measured as many delays. The heap space rule gives a space label to the spaces whose name ends in _space, which V8 gives all of them today. A panel on another runtime metric of OpenCTI, such as nodejs_eventloop_lag_seconds, stays empty.

Alerts worth setting

The pool of a process is saturated when all its connections are in use and callers wait for one, across several scrapes:

(
  db_client_connection_count{db_client_connection_state="used"}
    >= ignoring (db_client_connection_state) db_client_connection_limit
)
and ignoring (db_client_connection_state) (
  db_client_connection_pending_requests > 0
)

On the main pool, raise POSTGRES__POOL_MAX, and max_connections on PostgreSQL with it: see Database. The alert can also fire on the #control pool, at its limit of 5, which POSTGRES__POOL_MAX does not change.

A threat that fails its rebuild fails again at every run, and the run still succeeds. Alert when increase(opencrq_opencti_mirror_rebuild_actors_total{outcome="failed"}[1h]) > 0 stays true over several hours. The log line OpenCTI actor rebuild failed, its rows stay marked gives the STIX ID of the threat.

How the endpoint collects the processes

At each scrape, the process manager asks every process for its metrics and merges them into one document. A process that answers too late, or sends too much, is left out of that document and counted in opencrq_pm_collection_failures_total. The scrape is neither delayed nor broken: it gets the metrics of the processes that answered in time.

Environment variableDefaultWhat it sets
TELEMETRY__OBSERVABILITY__PROMETHEUS__COLLECT_TIMEOUT_MS2500How long the endpoint waits for each process, in milliseconds
TELEMETRY__OBSERVABILITY__PROMETHEUS__ROUND_DEADLINE_MS4500How long a whole collection may take. Must be above COLLECT_TIMEOUT_MS, or OpenCRQ stops at start
TELEMETRY__OBSERVABILITY__PROMETHEUS__MIN_INTERVAL_MS5000Within this time after a collection starts, a scrape gets the same document again, failures included
TELEMETRY__OBSERVABILITY__PROMETHEUS__MAX_REPLY_BYTES2097152The largest share of one process, in bytes. A larger one is refused, with the reason oversized
TELEMETRY__OBSERVABILITY__PROMETHEUS__PUBLIC_PORTNoneThe port the endpoint is published on, when it differs. Written in the logs only

The process manager records the outcome of a collection after it has taken its own metrics, so the collection families show each outcome one scrape late, and are missing from the first scrape after a start. They exist only while the Prometheus endpoint runs; with the OTLP push on too, the process manager pushes them as well.

The endpoint stays off, with an error in the logs, when it cannot start, when its port is the port of the health check (Metrics scrape port is already the healthcheck port; metrics endpoint disabled), or when a process of the profile takes the process manager's own name (Process profile names a child after the process manager's own reserved name; metrics endpoint disabled). The rest of the platform keeps running. When Prometheus cannot connect, look for these lines first.

What's next

NextScale: workers, platforms and clusters
Deploy
Install, configure, secure, scale and upgrade the platform.

Published

Overview
Run the XTM platform locally
OverviewDeploy with an AI agent