How The Run Pages Fit Together
The Run pages show the same running platform from different sides, and several of them rest on the others. File flows and process runs keep their state in the Operative Data Layer (the ODL). The ODL and the logs are stored in OpenSearch. And everything in between, ODL requests, log events and the status of runs, travels on the broker as topics. Knowing what rests on what tells you where to look when something is wrong, and why each part exists.
The Layers
| Layer | What it is | Where you see it |
|---|---|---|
| The broker | Every message: the routes' business data, their log events, ODL requests and answers, and the status events of long-running tasks | Broker |
| OpenSearch | Where the ODL is stored, one index per tenant and type (klok-odl-<tenant>-<type>), and the logs: every log event and every transaction for 30 days (klok-logs-<tenant>-event-*, -trans-*), and the console lines of every pod (klok-logs-<namespace>-console-*) |
Through the pages above it, and in OpenSearch Dashboards |
| Platform services | klok-api-odl and klok-api-tasks (the tenant's REST APIs), klok-egress-opensearch (the only service that talks to OpenSearch), klok-file-transfer (runs the file flows) |
Their routes under Integration projects, their deployments under Repositories |
| The Run pages | Operative data, Logs, File flows and Process runs read through those services, with your own login | This chapter |
What Each Page Rests On
Operative data is the tenant's ODL: the objects integrations keep between runs, such as the
current batch of employments, a file flow's configuration or a run's state. klok.dev sends every search and edit, with
your own login, to the tenant's ODL API; the API reaches the ODL over the broker, and klok-egress-opensearch stores
the objects in OpenSearch. klok.dev keeps none of it.
Logs rests on the log events. Every Klok route publishes one event per status of each invocation
(START, any PROGRESS, then FINISHED or FAILED) as KlokLogEventV4 on the tenant's common namespace. Two readers
follow them: klok-egress-opensearch writes each event, and one transaction per correlation id, to OpenSearch; and
klok.dev counts the transactions in its own database for Live and Problems (seven days). Kloker analyses the
failed ones, and the analysis settings are kept in tenant klok's ODL.
File flows rests on both. A flow is a KlokFileFlowV1 record in the tenant's ODL; its secrets
are sealed in klok.dev's server with the public key of the tenant's klok-file-transfer service, which alone can open
them. The service runs one route per enabled flow, and every transfer logs through the ordinary log events, so a file
can be found in Logs and in OpenSearch Dashboards by its name, flow or checksum. The flow's revisions in klok.dev
come from those log events.
Process runs rests on the ODL. A long-running task reports its status as events on the broker;
KLK002E8_TaskStateMaterializer keeps each task as a KlokTaskV1 object in the ODL, KLK002I2_TaskStaleDetector flags
the stale and overdue ones every minute, and the tenant's task API (klok-api-tasks) serves them to klok.dev. What a
process is, its steps and expected duration, is a KlokProcessDefinitionV1 object in the same ODL.
Broker shows the topics all of the above use, live, with their subscriptions named after the routes that read them; Repositories and Documentation show the Git side: the last pipeline and what is deployed from each repository, and the documentation every build publishes.
Document AI rests on none of the above. It is klok.dev's window on Kloker Document in
klok-api-ai and klok-egress-ai, which keep the texts and results in Klok's own storage. Its extraction
configurations are records in tenant klok's ODL, for every tenant.
Going Deeper: OpenSearch Dashboards
Run → Logs keeps the last days of the tenant's transactions. For anything older, for the events of every route and for what a pod printed to its console, the same data is in OpenSearch Dashboards, where the OpenSearch Dashboards button on every Logs page leads. The console lines matter most when the broker itself is the problem: a service that has lost its broker connection cannot send log events, but what it prints still reaches OpenSearch, which is why broker connection failures are alerted from the console logs. You sign in to Dashboards with your Klok account; Finding And Searching Logs In OpenSearch Dashboards says what you see there and how to search it.
One failed schedule export, followed down: the transaction, searched by its correlation id in the
klok-logs-<tenant>-trans-* index, shows that one leg finished and one failed, so its status is PARTIAL_FINISHED.
The same failure in the pod's console, in klok-logs-<namespace>-console-*, searched by the pod's app label: the line
the route logged when it gave up, and the cause further down the stack trace.
The pictures come from a local OpenSearch Dashboards with the same indexes as Klok's, filled with example data.
Everything Ends In Topics And Access
Whatever a project does, its legs read and write topics. A new leg needs its topics in the tenant's Pulsar file in
klok/environment/klok-environment-setup and a grant for each topic it reads or writes. A project's Broker setup
under Integration projects lists the topics its routes need and where each one stands. After every build on main,
klok.dev asks the owners for whatever is missing; Request it asks yourself. A request waits under Broker →
Requests until the topic's owner approves it, and klok.dev then writes it to the Pulsar file and applies it. The
framework checks the topics and grants a service needs at startup and logs what is missing, with a link to request it;
until they exist, from klok-quarkus-extension 3.14.0 the routes that need them are held while the rest of the service
runs, and an older extension version does not start at all. Topics are never created by the broker itself.
Why It Is Built This Way
- One way in and out of OpenSearch. Only
klok-egress-opensearchwrites to OpenSearch, and the other services reach the ODL over the broker, so storage, retention and access per tenant are decided in one place. - The broker as the only path. Every service talks to the others through topics, so the tenant follows from the topic, every message can be retried or end up as a dead letter, and a reader can be added without touching the writer.
- Your own login, all the way. klok.dev reads the ODL and the task API as you, so it shows what you may see and nothing more.
- State in the ODL, not in each service. File flows, runs and integrations keep their state as datamodel objects in the ODL instead of in databases of their own, so it can be searched, shown and edited in one place.