Business events from a workflow step¶
MeshFlows already has technical observability (OTel → Tempo, stdout → Loki, run traces). This page is a thin convention so a workflow can emit a business event that you can find in Loki (and count with LogQL). It is not BAM, Invictus, a Grafana pack, or a Dashboard KPI product.
Pickup from YAML: the existing type: log step. No new orchestrator step type
and no extra capability provider.
Demo: flows/workflows/business_event_demo.yaml
(trigger flows/triggers/business-event-demo-http.yaml).
Related: Capability comparison (gaps)
§7 Observability, Observability,
type: log.
Fieldset (default)¶
Reuse fields MeshFlows already uses on the bus and in traces. Do not invent a parallel BAM schema.
| Field | Required | Source in MeshFlows | Meaning |
|---|---|---|---|
domain |
yes | DSAV on meshflows.events |
Business domain (Orders, Finance, …) |
service |
yes | DSAV | Bounded context / publisher |
action |
yes | DSAV | Business action (PlaceOrder, InvoicePosted) |
version |
yes | DSAV | Schema/version of that action (1.0) |
business_id |
yes | — | Entity key (order, invoice, item) |
outcome |
yes | run/step status vocabulary | success / failure / skipped |
request_id |
auto | {request_id} builtin on log |
Technical correlation (X-Request-ID) |
Optional extras belong in values (and in the message if Loki must grep them).
Do not log secrets.
YAML recipe¶
- Tag the step
business-event(reserved). - Put marker
meshflows.business_eventin the message (Promtail scrapes stdout; Pythonextra=is not in the default formatter). - Map the fieldset in
values(path refs afterpayload_format: json).
- id: emit_order_placed
type: log
level: info
tags: [business-event]
message: >-
meshflows.business_event domain={domain} service={service} action={action}
version={version} business_id={business_id} outcome={outcome}
request_id={request_id}
values:
domain: request:json:/domain
service: request:json:/service
action: request:json:/action
version: request:json:/version
business_id: request:json:/business_id
outcome: request:json:/outcome
When the tag is present the orchestrator also emits an OpenTelemetry span event
named meshflows.business_event (Tempo), with the same fieldset as attributes
when they were supplied in values.
Where it lands¶
| Signal | How to find it |
|---|---|
| Loki (primary) | Promtail labels namespace, component=orchestrator. Filter the line. |
| LogQL metric | Count lines; this is the “metrics” path without a Prometheus counter. |
| Tempo | Span event meshflows.business_event on the workflow/step span. |
| Run trace | Dashboard step I/O for the log step (same as any other log). |
Loki (DEV namespace may differ):
{namespace=~"meshflows.*", component="orchestrator"}
|= "meshflows.business_event"
|= "business_id=ORD-1001"
Count as a metric (not a Grafana pack):
sum(
count_over_time(
{namespace=~"meshflows.*", component="orchestrator"}
|= "meshflows.business_event" [5m]
)
)
Correlate with traces via request_id= on the same line / X-Request-ID.
What you do not get¶
- BAM / Invictus-style business KPI dashboards
- A Grafana pack shipped as a product
- A new
type: business_eventstep or a dedicated capability - Automatic publishing onto RabbitMQ
meshflows.events(that is DSAV messaging, a different path)
Operations milestones (type: milestone on a workflow, shown as
context.milestone on the parent row) are a separate Operations-list concept,
not Loki business events.
If you later need a BAM product, start from this line format — do not invent a second schema.