Monitoring and Observability
Start with health and diagnostic APIs when investigating a backlog. Use Micrometer to inspect capacity and errors, and lifecycle events or logs to trace an individual call. These are configured separately. Node metrics describe one process; records in the shared database can describe work across nodes.
| Surface | Owner | Configuration |
|---|---|---|
| Engine lifecycle events | Each ProcessEngine |
Declare listeners in the standard Extension service file; set dispatch behavior through ProcessObservabilityConfig |
| Micrometer metrics | Engine, Deploy, and Durable Spring integrations | MeterRegistry, exporter, and standard meter filters |
| Health and diagnostics | Durable/Deploy integrations and Workbench Server | Spring Actuator and documented diagnostic endpoints |
Health and Diagnostics
Section titled “Health and Diagnostics”An engine bean’s existence shows only that an object was created. It says nothing about process code, capacity, or external dependencies, so the starter does not offer a health indicator based only on bean existence. An EMBEDDED or DISTRIBUTED control plane with routing delivery provides a deployment-pipeline indicator based on persisted Outbox state. AUTHORITY and worker-only hosts do not register it.
compileflow-workbench-server supplies liveness and readiness probes and hides health components and details by default. Expose only the Actuator endpoints needed by the deployment platform. Use diagnostic APIs to query current runtime state; configuration describes the intended settings.
In Workbench Server’s PROCESS execution mode, GET /api/deployment-control/health combines shared Outbox counts with the local dispatcher’s state:
UP: the Store is readable, the dispatcher is running, and bothfailedCount(dead letters) andexpiredClaimCountare zero.DEGRADED: the Store is readable and the dispatcher is running, but a dead letter or an expired processing claim exists.DOWN: Outbox state cannot be read, or the dispatcher is stopped.
Check outboxStateAvailable first. When it is false, the returned zero counts mean the state is unknown, not that the queue is empty.
failedCount counts dead letters. A failed delivery that is still waiting for a retry does not necessarily make the status DEGRADED.
An UP pipeline can also have pending work. Use changes in pendingCount and the actual workload to set alerts; see the operations playbook for response steps.
In the same execution mode, GET /api/monitoring/async-invocations separates shared persisted queue counts from the responding Server’s workerId, localRunningCount, and dispatchedCount. A degraded result means a dead letter or expired running lease exists. healthy does not guarantee latency or throughput targets: inspect readyQueuedCount and oldestReadyAgeMs together to see whether due requests are waiting longer. A failed database query returns an error, not zero counts that look like an empty queue. Both health endpoints collect counts with separate queries. During concurrent updates, the counts need not describe a single database snapshot; use the resource queries to inspect an individual record. See Async invocation health for actions based on these fields.
Workbench Operate dashboards read the shared persisted execution log. Metrics, trends, top flows, grouped errors, and effective-version distribution all use the selected window: 1h, 6h, 24h, 7d, or 30d, defaulting to 24h. Servers sharing a database read the same retained records. Log retention and explicit deletion determine how far back those records remain available.
Workbench records the returned invocation results of published root calls submitted through PublishedProcessExecutionService, including each completed asynchronous attempt. Internal child calls, preview executions, and calls made directly to an engine do not produce independent Workbench samples. Canary decisions use these root-call samples and their actual selected version, Alias, and route revision.
The application attempts to persist each returned result before responding. Persistence RuntimeExceptions are logged and isolated; Errors propagate. Engine events.async settings do not control this application write. A call that fails before an engine result exists does not create a fabricated execution record. These operational records cannot serve as an exactly-once audit ledger.
For Durable worker, lease-renewal, and Effect-capacity diagnostics, see the Durable operations runbook.
Workbench’s GET /api/monitoring/deploy-runtime describes only the node answering the request: target and ready routes, retained runtimes, retries, and capacity. Their scope differs from the shared execution dashboard. Do not combine them in one aggregate or present a node’s state as shared database state.
Micrometer
Section titled “Micrometer”The standard Spring starter registers an engine metrics binder when Micrometer is on the classpath and a ProcessEngine bean exists. The binder can be registered before MeterRegistry; Spring Boot later binds it to the configured registries. Each registry and exporter determine how metrics are collected and exposed.
Capacity gauges use the configuration of the selected CompileFlow engine, including one created by the application. They do not infer it from an unrelated ProcessEngineConfig bean. Custom engine implementations provide their own metrics integration; the JVM-wide dropped-event counter remains available.
The Durable starter registers its own binder when Micrometer is on the classpath and the selected Durable engine is the built-in CompileFlow implementation. It also supports registering before binding. A custom Durable engine owns its observability; the default binder will not read another engine instead.
Spring Boot’s management.metrics.enable.* settings use standard meter filters. They can deny a meter at registration, but do not decide whether the binder bean is created.
For ProcessEngine metrics, filters must preserve the names and resource.domain tags of metrics they retain. Give independent ProcessEngine instances distinct, stable resource domains when they share a registry. The binder rejects a duplicate domain or a filter that changes these identities.
Built-in binders export counters and aggregate gauges for the current node. ProcessEngine executor metrics and Durable metrics include a stable resource.domain tag, defaulting to default. CompileFlow adds no engine-domain tag to the JVM-wide dropped-event counter. In the table below, <pool> is runtime.load, action.timeout, parallel.coordinator, or event.delivery.
Configuration keys and metric names have different spelling. For example, compileflow.engine.executor.runtime-load.max-concurrency configures the value reported by compileflow.engine.executor.runtime.load.max.concurrency; the action-timeout configuration group corresponds to action.timeout metrics. Keep hyphens in application configuration and use dotted names in Micrometer filters.
For Deploy metrics, “desired” means the target Alias routes known to this node. “Local-ready” means routes prepared and executable on this node.
Engine capacity and events
Section titled “Engine capacity and events”| Micrometer name | Meaning |
|---|---|
compileflow.engine.executor.runtime.load.max.concurrency |
Configured runtime-load concurrency limit |
compileflow.engine.executor.runtime.load.max.pending |
Maximum additional pending runtime loads |
compileflow.engine.executor.action.timeout.max.concurrency |
Configured timeout-enforced action concurrency limit |
compileflow.engine.executor.action.timeout.max.pending |
Maximum additional pending timeout-enforced action attempts |
compileflow.engine.executor.parallel.coordinator.max.concurrency |
Configured independent parallel coordination limit |
compileflow.engine.executor.parallel.coordinator.max.pending |
Maximum additional pending parallel coordination groups |
compileflow.engine.executor.event.delivery.max.concurrency |
Configured event-delivery concurrency limit |
compileflow.engine.executor.event.delivery.max.pending |
Maximum additional pending event deliveries |
compileflow.engine.executor.<pool>.active |
Work currently executing in the selected engine-owned pool |
compileflow.engine.executor.<pool>.pending |
Work waiting for admission or execution in the selected engine-owned pool |
compileflow.engine.executor.<pool>.rejected |
Cumulative rejected submissions for the selected pool, including saturation and shutdown |
compileflow.engine.events.dropped |
JVM-wide cumulative count of asynchronous event-delivery rejections and application-context propagation failures across all engines |
Deployment and routing
Section titled “Deployment and routing”| Micrometer name | Meaning |
|---|---|
compileflow.deploy.runtime.install.attempts |
Runtime installation attempts, grouped by final outcome and bounded reason values |
compileflow.deploy.alias.convergence |
Attempts to prepare a target Alias route for execution on this node, grouped by final outcome and bounded reason values |
compileflow.deploy.authority.poll.attempts |
Completed AUTHORITY route polling passes on this node, grouped by outcome=success or failure |
compileflow.deploy.authority.poll.last.success |
Unix timestamp in seconds of the last successful polling pass; zero before the first success |
compileflow.deploy.alias.desired.count |
Active target Aliases known to this node |
compileflow.deploy.alias.local_ready.count |
Active Aliases currently executable on this node |
compileflow.deploy.alias.pending.count |
Target Aliases still being prepared on this node |
compileflow.deploy.runtime.retained.count |
Exact version runtimes currently retained by the deployment runtime |
compileflow.deploy.errors |
Deployment errors, tagged by stable error.code |
compileflow.deploy.operations |
Control-plane mutations; operation is one of publish, create_rollout, rollback, retire, update_canary, promote, or abort, and outcome is success or failure |
compileflow.deploy.reconciliation.runs |
Completed control-plane projection-reconciliation cycles |
compileflow.deploy.reconciliation.routing.mismatches |
Alias routes in Deploy Store that differ from their projections |
compileflow.deploy.reconciliation.routing.repairs |
Route projection repairs queued through the Outbox |
compileflow.deploy.reconciliation.artifact.checks |
Artifact checks across each active Alias’s stable/candidate dependency closure in PROJECTION_STORE mode; deduplicated within each Alias |
compileflow.deploy.reconciliation.artifact.missing |
Missing artifact projections detected for active versions |
compileflow.deploy.reconciliation.artifact.repairs |
Missing active artifact projections recreated with create-if-absent CAS |
compileflow.deploy.reconciliation.artifact.conflicts |
Conflicting or corrupt active artifact projections detected and left unchanged |
compileflow.deploy.reconciliation.artifact.failures |
Active artifact projection reconciliation failures, including conflicts |
compileflow.deploy.reconciliation.artifact.capacity.exceeded |
Alias artifact traversals stopped by a working-set limit; each is incomplete |
Durable runtimes
Section titled “Durable runtimes”| Micrometer name | Meaning |
|---|---|
compileflow.durable.operations |
Durable runtime operations grouped by bounded operation and outcome values |
compileflow.durable.loaded.runtimes |
Durable process runtimes loaded on this node; these can be rebuilt from persisted definitions |
After an Effect dispatch or reconciliation reports a result, its outcome records the Store receipt:
outcome |
Meaning |
|---|---|
result_accepted |
The Store accepted the result, including an identical repeated report |
result_retained |
Original attempt evidence was retained; this receipt does not establish a canonical result |
result_different |
Evidence differs from the canonical result or a recorded non-execution proof |
result_conflict |
The same attempt reported output inconsistent with its retained first result |
result_rejected |
The Store rejected the evidence; this does not imply lease loss |
These counters record receipts observed by this runtime instance. They do not determine business state or count
unique business completions. result_retained does not mean the Effect completed; result_different and
result_conflict do not mean a review gate was set. review_required counts operations that successfully set
a review gate, not the current review backlog. Counters reset when the runtime instance is recreated.
Use Durable query and operator APIs to inspect current state, canonical results, and original attempt evidence.
Exporters may transform these names for their backend. Use the names in this table for Micrometer filters and the exporter’s names when querying the monitoring backend.
Default deployment metrics omit namespace, process code, Alias, Version, digest, routing key, invocation ID, and node ID tags. Query runtime diagnostics, structured logs, or traces when you need these details.
An application listener collects execution latency, outcomes, and business metrics. The application chooses their tags and retention. Use tags with a limited set of values, such as model type or a defined process family. Invocation IDs, user IDs, URLs, and raw variables produce too many distinct values for metric tags.
Interpret capacity metrics together
Section titled “Interpret capacity metrics together”Compare data from the same resource domain and observation window before changing configuration:
- If
rejectedkeeps increasing, first check whether the executor is shutting down. It counts rejection from both saturation and shutdown. - If
activestays near its concurrency limit whilependinggrows, measure task duration and incoming load before reducing caller concurrency or adding processing capacity. - If Deploy’s
pending.countdoes not fall, inspect runtime diagnostics for the specific Alias, desired revision, and installation failure. An aggregate count cannot identify the failed route. - A rising
events.droppedcount signals rejected asynchronous deliveries or failed application-context propagation. Check executor capacity, listener duration, and context capture, binding, or restoration diagnostics. A restoration failure can occur after listeners ran, so this counter does not measure the exact number of missing samples.
See Executor rejection for configuration and further checks. These counts help locate problems; alert thresholds still depend on the application’s workload.
Engine Events
Section titled “Engine Events”Event types and ProcessEventListener live in compileflow-api. A listener must be a public class with a public no-argument constructor, annotated with @ExtensionRealization.
List its name in the standard Extension service file. The framework creates the instances and calls listeners in descending priority order, then ascending binary class name. Declaring a listener as a Spring bean does not register it with the engine.
See the extension guide for complete examples.
compileflow: engine: observability: events: async: true mdc-propagation-enabled: falseWith events.async=true, lifecycle events use the bounded event executor. Different events may run concurrently or arrive out of order. Executor rejection drops the event and increments events.dropped; rejection diagnostics are logged at DEBUG. Application-context capture or binding failure also prevents delivery, and restoration failure is counted even when listeners already ran. Context-propagation failures produce warnings. Listener order within one event remains deterministic.
Synchronous listeners run on the execution caller’s thread and should perform only short, bounded work. Listener RuntimeExceptions are logged without affecting engine execution or other listeners. Errors interrupt delivery and can propagate to the synchronous caller. mdc-propagation-enabled copies MDC between engine-owned executors only; the application’s thread pools need their own context propagation.
For reliable audit, billing, or external delivery, use application-managed transactions or an Outbox with ProcessEngine, and the Journal and Outbox with Durable. Lifecycle events can be lost and cannot determine execution correctness or serve these reliable-delivery roles.
ProcessEvent contains a fixed set of immutable records for execution and trigger lifecycles. Start events include namespace, process code, and invocation ID; trigger-start events also include the requested ProcessTrigger. Completion and failure events carry the engine’s returned ProcessExecution and additional ExecutionAttribution; failures also carry a typed ProcessError. Every event has an event time and a trace-ID accessor; the start-event records also permit a null trace ID when constructed directly. Events do not carry routing keys, variables, source content, arbitrary metadata, or raw exception objects. This does not make every event safe to export unchanged: identifiers and custom ProcessError messages can contain application-supplied data. Use opaque correlation IDs and export only the fields needed by the monitoring system; see Error Handling.
Implement TraceIdProvider and declare it with @ExtensionRealization to read an ID from the application’s tracing context.
Use a public class with a public no-argument constructor and list its name in the standard Extension service file. The engine selects the unique highest-priority provider; a tie fails assembly. Declaring a Spring bean alone does not register this provider.
It supplies a correlation ID only. Creating spans and propagating context remain the tracing system’s responsibility,
without a tracing SDK dependency in Core.
The engine first reuses a valid trace ID in the current execution context, then tries TraceIdProvider, then MDC’s traceId. A null or invalid provider value or a provider RuntimeException falls through to MDC; an Error propagates. IDs allow up to 128 Unicode code points and reject surrounding whitespace, control characters, and Unicode format characters. Invalid IDs are not truncated or rewritten. If no valid upstream ID is available, the engine generates a local 32-character hexadecimal ID.
Production Rules
Section titled “Production Rules”- Send logs and metrics through application-owned sinks; set timeouts and capacity limits for I/O performed during execution.
- Make alert thresholds deployment-specific. The library cannot choose an acceptable latency or failure rate for a business process.
- Correlate logs with trace/invocation IDs, but never use those high-cardinality values as metric tags.
- Test listener ordering, failure isolation, and asynchronous behavior when observability is part of the application contract.
- Keep health details and debug compilation artifacts disabled or access-controlled in production.