Skip to main content

Operations

This page covers running an Enterprise deployment day-to-day. For initial setup see Deployment, for what's tunable see Configuration.

Observability​

Set ENABLE_OTEL=true to enable Prometheus metrics. They're served from a separate HTTP server on REST_METRICS_PORT (default 9464) - not the same port as the public API. Bind that server to a private interface with REST_METRICS_ADDR or firewall the port, it has no authentication. The Helm chart sets ENABLE_OTEL=true when backend.metrics.enabled is on, which is the default.

Metrics​

The BPMN engine runs inside the backend, partitioned across replicas: each replica leases a share of the partitions and steps the instances on them. One step applies the events waiting in an instance's inbox, such as a completed job or a delivered message, fires its due timers, and commits the result. Events for other instances leave through an outbox, which a relay moves to their inboxes. The partitions live on one or more shard databases. The app database is shard quantumbpm-1, and the shard label names the shard a value belongs to.

Engine throughput and latency

MetricTypeLabelsWhat it covers
bpmn_engine_step_duration_secondsHistogramshard, resultTime one step took to load, advance and commit. result is ok or error.
bpmn_engine_step_eventsHistogram-Inbox events one step applied.
bpmn_engine_event_wait_secondsHistogram-Time an inbox event waited before a step applied it. The first sign of an engine that falls behind.
bpmn_engine_relay_lag_secondsHistogramshardTime an outbox row waited for the relay. Delays call activities, messages and signals.
bpmn_engine_relay_rows_totalCountershardOutbox rows relayed.
bpmn_engine_timer_lateness_secondsHistogram-Time between a timer falling due and the step that fired it.
bpmn_engine_instances_started_totalCounterproject, process_idInstances started.
bpmn_engine_instances_ended_totalCounterproject, process_id, statusInstances that ended, by COMPLETED, FAILED, CANCELED or TERMINATED.
bpmn_engine_instance_duration_secondsHistogramproject, process_id, statusTime from an instance's start to its end, in buckets from 10 milliseconds to 30 days.
bpmn_engine_incidents_raised_totalCounterproject, error_typeIncidents raised.

External jobs

MetricTypeLabelsWhat it covers
bpmn_engine_jobs_created_totalCounterproject, task_typeJobs created.
bpmn_engine_jobs_activated_totalCounterproject, task_typeJobs handed to a worker by a poll.
bpmn_engine_job_activation_wait_secondsHistogramproject, task_typeTime from a job's creation to a worker activating it, retry delays included. Rises when there are too few workers.
bpmn_engine_jobs_reported_totalCounterproject, outcomeWorker reports: completed, error (a BPMN error), failed or retried.
bpmn_engine_job_locks_expired_totalCounteroutcomeWorker locks that ran out, requeued with a retry left or ending in an incident. A worker that dies or stops heartbeating shows here, and so does a job held past ENGINE_JOB_MAX_HOLD. Such an incident has the error type JobLockLost.
bpmn_worker_activeGaugeproject, task_type, client_id1 for each worker polling this replica: while a poll is open, and for its poll timeout (at least 30 seconds) after the last one ended. A worker whose polls reach several replicas shows on each, so count distinct client_id: count by (project, task_type) (max by (project, task_type, client_id) (bpmn_worker_active)).

Engine internals

MetricTypeLabelsWhat it covers
bpmn_engine_queue_depthGaugequeueWork waiting for a worker on this replica: steps, relays, correlations.
bpmn_engine_wakes_dropped_totalCounterqueueWakes a full queue dropped. The poll picks the work up within ENGINE_POLL_INTERVAL.
bpmn_engine_poll_wakes_totalCounter-Instances the poll woke: due timers, plus work no in-process wake announced.
bpmn_engine_partitions_ownedGauge-Partitions this replica leases. Each replica holds about its share.
bpmn_engine_step_workersGauge-Step workers on this replica (ENGINE_STEP_WORKERS). sum without (shard, result) (rate(bpmn_engine_step_duration_seconds_sum[5m])) / bpmn_engine_step_workers is the share of their time spent stepping.
bpmn_engine_shard_upGaugeshard1 when the shard answered this replica's last ping within 2.5 seconds, 0 otherwise. A pool too busy to hand out a connection in time counts as 0 too. Replicas ping every 5 seconds.
bpmn_engine_retention_purged_totalCounterproject, kindWhat retention deleted: instance counts each instance, call-activity children included, evaluation each decision evaluation no instance owned, and draft each draft document no instance ran on any more.
bpmn_engine_retention_duration_secondsHistogram-Time one retention pass took on this replica.
bpmn_engine_history_packed_totalCounter-Ended instances whose history entries were packed into compressed chunks.
bpmn_engine_errors_totalCounteroperation, shardFailed engine operations: step, relay, correlation, poll, lease, sweep, timer_start, sample, retention, pack, and activate, a shard that a job poll skipped because it failed or did not answer within 2 seconds. Only activate carries shard. The poll still hands out the jobs of the other shards. The backend log has each error.

Sampled from the database every 30 seconds by the one replica that leases partition 0, so a cluster reports each value once:

MetricTypeLabelsWhat it covers
bpmn_engine_instances_runningGaugeprojectRunning instances.
bpmn_engine_jobs_pendingGaugeproject, task_typeOpen jobs: waiting for a worker, held by one, or waiting out a retry delay.
bpmn_engine_incidents_openGaugeprojectOpen incidents.
bpmn_engine_backlog_rowsGaugeshard, queueRows waiting in inbox, outbox, correlation_inbox, and buffered messages. All but messages stay near zero while the engine keeps up.
bpmn_engine_table_size_bytesGaugeshard, tableSize of each engine table with its indexes and TOAST, named like engine.history. The catalog tables (engine_catalog.*) report under shard="catalog". The way to watch data growth.

Platform

MetricWhat it covers
http_requests_total / http_request_duration_secondsREST API requests and latency, labelled method, path (the route pattern) and status. The job poll and complete routes show worker traffic.
pgxpool_*The PostgreSQL pools, labelled shard: connections in use, acquires, acquire waits. quantumbpm-1 is the app database pool the API and the engine share, and each further shard has its own.
Go runtime (go_*, process_*)Memory, goroutines, GC.

Diagnosing with the metrics​

  • Instances progress slowly. Look at bpmn_engine_event_wait_seconds. When it rises, steps fall behind: compare bpmn_engine_step_duration_seconds. Slow steps point at the database (also check rate(pgxpool_empty_acquire_count_total[5m]), the acquires that waited for a free connection).
  • Step workers are the limit. Their busy share (see bpmn_engine_step_workers) above about 70% caps throughput, well before event waits look long. Raise ENGINE_STEP_WORKERS or add replicas, keeping the workers well under DB_MAX_CONNS. When steps slow down as workers rise, the database is the limit instead.
  • Jobs wait. A high bpmn_engine_job_activation_wait_seconds with a growing bpmn_engine_jobs_pending means workers can't keep up. Add workers or poll larger batches. Pending jobs of a task type with no bpmn_worker_active series means no worker polls for it at all.
  • Workers die. bpmn_engine_job_locks_expired_total counts locks that ran out. outcome="incident" means a job used its last retry that way.
  • Call activities, messages and signals lag. Check bpmn_engine_relay_lag_seconds and the outbox and correlation_inbox rows of bpmn_engine_backlog_rows.
  • Timers fire late. bpmn_engine_timer_lateness_seconds should stay below ENGINE_POLL_INTERVAL plus the step backlog.
  • Data grows. bpmn_engine_table_size_bytes per table. Instances, history, user tasks, incidents and decision evaluations grow with every instance run until retention deletes them, so those tables level off at about one ENGINE_RETENTION_MAX_AGE of data. A job row is deleted when its instance ends, so engine.jobs follows the running instances. Running instances are never deleted, and neither are the ended instances of a project whose max age is 0s.
  • A shard is down. Alert on max_over_time(bpmn_engine_shard_up[1m]) == 0. Instances on its partitions stop until it answers again. Instances on the other shards keep stepping, though their deliveries can wait in the outbox behind one for the shard that is down. The readiness probe checks only the app database, so replicas stay in service.
  • Something fails. Alert on rate(bpmn_engine_errors_total[5m]) > 0 and on bpmn_engine_incidents_raised_total.

Distributed tracing (optional)​

Tracing needs ENABLE_OTEL=true and OTLP_ENDPOINT set to an OTLP gRPC collector (Jaeger, Tempo, otel-collector). Metrics need only ENABLE_OTEL, so an empty OTLP_ENDPOINT keeps everything above working with no collector. OTLP_INSECURE and OTLP_SAMPLE_RATIO tune the connection and head sampling (see Configuration → Observability). In the Helm chart, config.otel.enabled and config.otel.endpoint set them.

What you get when it's on:

  • Inbound HTTP spans - each REST request is rooted as a span (the external-job poll/complete endpoints included).
  • Step spans - a bpmn.step span for every step of an instance, and a bpmn.external-task span for every job a step creates. They carry bpmn.process_instance_id, bpmn.process_id, bpmn.process_version and, when the instance has one, bpmn.business_id. Job spans add bpmn.task_type, bpmn.node_id, bpmn.element_type and bpmn.execution_key. Filter on bpmn.process_instance_id or bpmn.business_id to find every trace of one instance.
  • Worker spans - a polled job carries traceContext, the trace of the step that created it. The SDK workers continue it, so a worker's own spans join the instance's trace.
  • Trace IDs in logs - a log line the server writes while it handles a request, or while an instance starts, carries trace_id and span_id fields in both log formats. Point your log backend's trace link at trace_id to go from a line to its trace.

How traces connect:

  • A call that changes an instance (a start, a user task completion, a publish, a resolve, a modification, a variable update) continues the caller's trace through the steps it causes and the jobs those steps create, until the instance waits.
  • A job's completion, error or retry continues the job's trace, linked to the report's own trace when it carries one, so a chain of automated tasks is one trace.
  • A call-activity child starts a new trace linked to the parent's call activity, and the parent resumes in the trace that started the call.
  • A timer that fires, or a message buffered and taken later, starts a new trace linked to the step that armed the timer or to the publish.

It's an inspector, not an analytics store. Traces are sampled and short-retention. Don't build counts or percentiles off them - that's what the metrics above are for.

Performance tuning​

The settings that most often need attention:

Database connections​

DB_MAX_CONNS (default 200, 80 per pod in the Helm chart) - the pgxpool max. Every engine step, BPMN poll, job completion, process start, and DMN evaluation grabs a connection. Pool exhaustion shows up as request queue-up. Watch the pgxpool_* metrics, raise the cap if you see acquire waits climbing.

Each extra shard has its own pool per replica, capped by ENGINE_SHARD_MAX_CONNS (default ENGINE_STEP_WORKERS + 16). Its pgxpool_* series carry the shard's ID in the shard label.

Write-ahead log​

The WAL grows with the database. The first change to a page after a checkpoint writes the whole page to the WAL, and in a database that holds months of history most changes land on a page for the first time since the last checkpoint. Fewer checkpoints and compressed page images keep the WAL and the archive small:

  • max_wal_size of 16GB or more, so that checkpoint_timeout starts the checkpoints rather than the WAL size
  • checkpoint_timeout of 15min
  • wal_compression set to lz4

With CloudNativePG:

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
spec:
postgresql:
parameters:
max_wal_size: 16GB
checkpoint_timeout: 15min
wal_compression: lz4

pg_stat_checkpointer shows whether checkpoints come on time (num_timed) or because the WAL filled up (num_requested), and pg_stat_wal how much WAL the database writes, which sizes the WAL archive.

Engine step workers​

ENGINE_STEP_WORKERS (default 8) is how many instances one replica steps at once. Each holds one pool connection while it steps, so keep it well under DB_MAX_CONNS. Raise it, or add replicas, when the step workers are the limit (see Diagnosing with the metrics). Engine describes how replicas share the work, and Scaling the engine how to size step workers with shards.

Memory and replicas​

GOMEMLIMIT is the Go runtime's soft memory limit. Near it the garbage collector runs more often, which costs CPU instead of memory. The Helm chart sets it to 90% of backend.resources.limits.memory when that is given in Mi or Gi, and backend.env.GOMEMLIMIT overrides it. Outside the chart, set it to about 90% of the container's memory limit, for example GOMEMLIMIT=900MiB for a 1 GiB limit.

The chart also sets GODEBUG=disablethp=1, which keeps the Go heap off transparent huge pages. On a node with transparent huge pages set to always, the memory Go hands back after a peak otherwise stays charged to the container, so the pod's reported memory stays near its peak. Set it outside the chart too, and keep disablethp=1 when you set backend.env.GODEBUG for another reason.

The Helm chart's HPA (backend.autoscaling) adds replicas on CPU, memory or both, and the replicas share the engine partitions. Its memory target is a percentage of backend.resources.requests.memory, not of the limit, so set the request near the backend's working size. Every replica opens up to DB_MAX_CONNS connections, so keep maxReplicas times DB_MAX_CONNS under the database's max_connections. A replica that cannot connect fails to start, and the running ones fail requests when their pools try to grow. With extra shards, also keep maxReplicas times ENGINE_SHARD_MAX_CONNS under each shard server's max_connections. Once the databases are the limit, more replicas add no throughput, and another shard does. A burst that arrives faster than a new replica starts needs the memory limit of one replica, so size that limit for your peak.

FEEL evaluation caps​

FEEL_MAX_DEPTH, FEEL_MAX_ITERATIONS, and FEEL_DEFAULT_TIMEOUT cap what a single FEEL expression can do. The platform aborts any expression that exceeds them. Defaults protect against pathological or hostile input - normal expressions don't come close.

Access cache​

The access cache is a thin read-through cache of the provisioned projects - given a project UUID from the URL, it confirms a project with that UUID exists. Role and membership are read from the JWT on every request and are not cached.

What this means in practice:

  • The cache only saves a single PostgreSQL lookup per project per cache window. Projects are added when a backend starts with a provisioning file that lists them.
  • ACCESS_CACHE_TTL is a pure performance knob - raising it reduces DB load with no functional downside. Lowering it costs DB queries with no benefit.
  • There is no in-platform role revocation to wait on. If you need to revoke a user's access, do it at your IdP (stop issuing the project claim) and wait for their existing token to expire.

The image's 300s TTL is fine for most deployments. To cut the cold-miss lookups further, raise ACCESS_CACHE_TTL to something well above your typical request cadence.

License monitoring​

Three things happen automatically:

WhenWhat
StartupLicense signature, issuer, and expiry are verified. Invalid or expired → backend exits non-zero.
Every 24 hoursThe backend checks the expiry date it read at startup. Past it, the replica shuts down gracefully.
Fewer than 60 days until expiryThe backend logs the warning License is expiring soon, with days_left and expiry_date, at startup and on every daily check. Set up an alert on this log line.

Graceful shutdown on expiry: the backend logs LICENSE EXPIRED! Initiating graceful shutdown. → readiness probe goes false → the replica keeps serving for REST_SHUTDOWN_DRAIN_DELAY → parked job polls are answered and in-flight requests drain → the engine stops stepping and hands its partitions to the other replicas, which run any step it had in flight again → process exits with code 1.

The backend reads LICENSE_KEY at startup, so a renewed key applies to a replica when it restarts with the new key.

Backups​

All durable state lives in PostgreSQL - the Enterprise binary writes no state files to disk. Back up Postgres with the tooling you already use, such as pg_dump, or base backups with WAL archiving for point-in-time recovery. With CloudNativePG, those are its backups with WAL archiving to an object store.

The BPMN engine keeps its instances, jobs, history and deployed definitions in the same database, so one consistent backup covers the application and every running process. Restoring it to a point in time restores every instance to its state at that point, and jobs that workers finished after it are open again, so that work runs again.

With extra shards, the engine's runtime data spreads over several databases, and they have to be backed up and restored to the same point. See Backups with shards.

The license itself is held in an environment variable, there's nothing to back up on the platform side. Store it wherever you manage secrets.

Upgrades​

QuantumBPM follows semantic versioning. Read the release notes' Upgrade notes before every upgrade.

Minor and patch releases​

Schema migrations apply automatically on startup, with no separate migration step. Within a MAJOR line the previous MINOR keeps working on the migrated schema, and the old and the new version each continue the instances the other stepped. Replicas of both versions can run side by side during the upgrade.

The Helm chart upgrades as a rolling update. Kubernetes replaces the pods a few at a time, and a new pod takes traffic once /readyz passes, after any pending migrations ran. A stopping pod reports not ready, keeps serving for REST_SHUTDOWN_DRAIN_DELAY, drains its requests and hands its partitions to the running pods. Instances on the partitions that move pause for a few seconds. With one replica, the new pod starts before the old one stops, so a single-replica release upgrades without downtime too.

Outside Kubernetes, start the new replica before stopping the old one, and route traffic by /readyz. A deployment that stops the old binary first is down while the new one starts and runs any pending migrations, which take longer the more data they migrate.

An upgrade that adds a shard stops every replica, see Adding a shard.

Upgrading from 1.x to 2.0​

2.0 runs on a new database. A 1.x database fails its migrations. The 1.x data moves over with a migration script that support supplies, ask for it at support@quantumbpm.com.

  1. Stop the 1.x replicas, so nothing changes the 1.x database while it is migrated.
  2. Create a new database and start 2.0 on it. Remove the Temporal and worker settings from its configuration and rename the engine settings (see the 2.0.0 release notes).
  3. Run the migration script, which moves the 1.x data into the new database.
  4. Retire the 1.x database and its Temporal cluster.

Logs​

The backend writes structured logs to stdout, as text or, with LOG_FORMAT=json, as JSON lines. LOG_LEVEL sets the level. Pipe them into your log pipeline, such as Loki or Elasticsearch.

Healthchecks​

The backend serves /readyz for readiness and /healthz for liveness, see Health endpoints. /readyz reports not ready from the start of a graceful shutdown. Wire your orchestrator's readiness probe to it so traffic stops being routed before connections drain.

When to call support​

You don't need to debug all of this alone. Reasonable reasons to reach out:

  • The <60-day license warning is firing and you need a renewed key.
  • You see Postgres pool exhaustion and want a sizing recommendation for your workload.
  • You're moving to Kubernetes / HA and want the supported pattern.
  • You see a metric or behavior that this page doesn't describe.

Contact: support@quantumbpm.com.