Observability
Every service in the platform emits metrics, structured logs and distributed traces in open formats. You can read them in the console's built-in dashboards, scrape them with Prometheus, receive them over OpenTelemetry, or forward them to the tools your operations team already watches. The same signals drive the service level objectives agreed for each implementation, and the alerts that page us and you
In the platform today
- The platform service exposes Prometheus metrics at
GET /metricsandGET /api/v2/observability/metrics - It writes structured JSON logs with request, trace and span ids
- It sends OpenTelemetry traces when
OTEL_EXPORTER_OTLP_ENDPOINTis set, over OTLP/HTTP by default or gRPC withOTEL_EXPORTER_OTLP_PROTOCOL=grpc(orOTEL_EXPORTER_OTLP_TRACES_PROTOCOL), joining an incomingtraceparent - Every response carries
X-Request-Id - Administrators and groups in
observability.viewersread metrics, the last 500 log records and a summary in Admin, then Observability - The built metric names and spans are listed in each section below
- Alerts on the platform's own runs are built as monitors: rules under
monitors.rulesover pipeline builds, syncs, automations, agent runs, AI function runs, writeback by system, webhook deliveries, edge heartbeats and dataset health, with checks such asconsecutiveFailures,failureRate,p95AboveandquietFor, evaluated every minute, routed by severity to email, Slack, Teams, a signed webhook or the inbox, and resolved on their own
- The metric catalogue by service, redaction in a telemetry pipeline, sampling, console dashboards, service level objectives, alert rules and exports to other tools
Signals at a glance
Observability data describes how the platform is behaving, not what your operation is doing. A metric tells you that the sync service is 40 seconds behind on Raw milk silo; it never contains a silo's level. That separation is deliberate. It means observability data can be sent to third-party tools without carrying business data, access labels or personal information, and it means the people who run the platform do not need access to the data in it
| Signal | Format | Export |
|---|---|---|
| Metrics | Prometheus exposition; OTLP metrics on request | Prometheus scrape; other tools on request |
| Logs | JSON lines; OTLP logs on request | On request |
| Traces | OTLP traces, W3C trace context | OTLP over HTTP or gRPC |
| Audit | Hash-chained JSON entries | See audit |
Metrics
Metric names follow ms_<service>_<quantity>_<unit>, with units in the name as Prometheus recommends: _seconds, _bytes, _total for counters and _ratio for fractions. Latencies are histograms with fixed buckets from 5 ms to 60 s, so quantiles can be aggregated across instances correctly. Labels are bounded: tenant, ontology, object_type, action_type, operation and status are allowed. Primary keys, user ids and free text never appear as labels
The metrics built today come from two places. Request and function metrics are counted per worker, so sum them across workers. The rest are read from the operational tables at scrape time, the same on every worker, so take max() across workers. Each table is read again only when its Delta version moves
| Area | Built metrics |
|---|---|
| HTTP | ms_http_requests_total{method,route,status}, ms_http_request_duration_seconds{method,route} (histogram, 5 ms to 60 s), ms_http_requests_in_flight. route is the route template, never the raw path |
| Functions | ms_function_executions_total{function,status}, ms_function_duration_seconds{function} |
| Actions and writeback | ms_action_applies_total{action_type,client_app}, ms_writeback_outbox{system,status} |
| Agents and models | ms_agent_runs_total{agent,status,mode}, ms_agent_cost_cad_total, ms_agent_steps_total, ms_agent_run_seconds_total, ms_model_requests_total{provider,model,tier,outcome}, ms_model_tokens_total{provider,model,kind}, ms_model_cost_cad_total, ms_model_request_duration_seconds_sum and _count, ms_aifunction_runs_total |
| Pipelines and sync | ms_pipeline_runs_total{pipeline,status}, ms_pipeline_run_seconds_total, ms_pipeline_last_success_timestamp_seconds, ms_sync_runs_total{object_type,status}, ms_sync_rows_upserted_total, ms_sync_last_success_timestamp_seconds |
| Audit and webhooks | ms_audit_entries_total, ms_webhook_deliveries{destination,channel,status}, ms_webhook_attempts_total{destination,outcome}, ms_webhook_dead_letters_open{destination} |
| Process | ms_stream_subscribers, ms_stream_buffered_events, ms_process_start_time_seconds, ms_build_info{ontology,revision}, ms_scrape_errors_total{collector} |
On request, every service publishes its own metrics, such as index lag, sync freshness per object type and edge buffer age
Reading metrics
A scrape authenticates like any request, as an administrator or a member of a group in observability.viewers, or with Authorization: Bearer <token> when a metrics token is set for the service, which is what a Prometheus job uses
scrape_configs:
- job_name: markland-ontology
metrics_path: /metrics
authorization: { credentials_file: /etc/prometheus/mso-metrics-token }
scheme: https
static_configs: [{ targets: ['ontology.example.com'] }]
On request, managed cloud tenants read their metrics from a federation endpoint scoped to the tenant, authenticated with an OAuth client that holds the observability:read scope. Self-managed deployments expose /metrics on every pod, and the Helm chart creates ServiceMonitor resources for clusters that run the Prometheus operator
# p99 latency per route, over 5 minutes, summed across workers
histogram_quantile(0.99,
sum by (le, route) (
rate(ms_http_request_duration_seconds_bucket[5m])))
# Object types whose last successful sync is more than an hour old
time() - max by (object_type) (ms_sync_last_success_timestamp_seconds) > 3600
# Action applies per action type, over 15 minutes
sum by (action_type) (increase(ms_action_applies_total[15m]))
Logs
Every service writes one JSON object per line with a fixed envelope. The platform's loggers write to stderr, and the level is a service setting. The envelope carries the trace and span ids, so any log line can be opened next to its trace, and the request id returned to API clients in X-Request-Id, so a support ticket that quotes it leads straight to the lines that matter
{
"ts": "2026-10-24T13:42:07.318Z",
"level": "info",
"service": "platform",
"ontology": "aircraft",
"logger": "http",
"event": "http.request",
"msg": "POST /api/v2/actions/{cmd} 200 47ms",
"requestId": "req_01JB2Q8M4T7N0XK5",
"traceId": "4bf92f3577b34da6a3ce929d0e0e4736",
"spanId": "00f067aa0ba902b7",
"attrs": { "method": "POST", "route": "/api/v2/actions/{cmd}", "status": 200, "ms": 47 }
}
An incoming X-Request-Id of up to 64 letters, digits, dots, dashes and underscores is kept, otherwise a new req_… id is made; it is also in problem details as requestId. GET /api/v2/observability/logs?requestId=&level= returns recent records. On request, the envelope adds version and tenant, and an event per service such as writeback.attempt.failed with its attributes
What logs never contain
- Property values, action parameter values or function arguments. Logs name the property or parameter, never its content
- Anything from an object, property or dataset that carries an access label, including its primary key. Keys of labelled objects are replaced by a salted hash that is stable within the tenant, so lines can still be correlated
- Prompts, completions or tool outputs from agent runs. Those belong in reasoning traces, which are governed data with their own permissions
- Access tokens, secrets or connection strings. On request, the telemetry pipeline also scans for common credential shapes and drops any line that matches, counting the drop in
ms_telemetry_redactions_total
On request, managed cloud runs every service at info. An administrator can raise one service to debug for up to one hour from the console; the change and its expiry are recorded in the audit log. Self-managed deployments set levels in Helm values, and the same redaction rules apply at every level
Traces
The platform propagates W3C trace context end to end. If your application sends a traceparent header, the platform's spans join your trace, so a slow page in your own app can be followed through the object query service, into the index and back. Requests without one start a new trace, and the response carries the trace id in traceparent so you can look it up
The platform service sends these spans today. The exporter reads the standard OTEL_EXPORTER_OTLP_*, OTEL_SERVICE_NAME and OTEL_TRACES_SAMPLER variables
| Span | Attributes |
|---|---|
HTTP <METHOD> <route> | A server span per request, with http.request.method, http.route, http.response.status_code and ms.request_id |
function.execute | ms.function |
action.apply | ms.action_type, ms.dry_run |
agent.run | ms.agent, ms.agent.mode |
model.call | ms.tier, ms.purpose, ms.model, ms.tokens_in, ms.tokens_out, ms.cache_hit |
pipeline.build | ms.pipeline |
sync.run | ms.object_type |
On request, further spans cover the query service, the search index, writeback and sync batches, and sampling keeps every error, slow request, action apply and agent run
An OpenTelemetry trace records timing: which service did what, and how long it took. A reasoning trace records content: what an agent read, what it concluded and which actions it proposed. The two are joined by ms.agent.run_id, so you can go from a slow step in one to the step's content in the other, with the reasoning trace's permissions still applied
Dashboards
Built: Admin, then Observability, shows requests, model calls, agents, pipelines, logs and traces from the summary at GET /api/v2/observability. On request: the console ships a set of dashboards in Admin, built on the same metrics you can export and exportable to Grafana, so your team can start from them rather than from a blank page
| Dashboard | Answers |
|---|---|
| Platform health | Is anything broken right now? SLO status per service, open alerts, current error budget |
| Query performance | Which object types and query shapes are slow, how often scans fall back from the index, the busiest clients |
| Sync freshness | How far behind each object type is, per source commit, with the pipeline build that produced it |
| Actions and writeback | Applies and failures by action type, validation reasons, writeback queue depth and dead letters by connector |
| Functions | Executions, durations, cold starts, timeouts and memory by function version |
| Agents and model gateway | Runs by outcome, steps per run, guardrail blocks, tokens and cost by route, cache hit ratio |
| Edge fleet | Every edge agent by site: state, version, buffer age and size, uplink throughput, certificate expiry |
| Audit and export | Entries per minute, chain verification results, export lag to your bucket |
Service level objectives
On request, each service has indicators and objectives agreed per implementation, and alerts fire on how fast the error budget is burning rather than on raw error rates. The service levels in a client's agreement take precedence
Alerting
Built: monitors open, escalate and resolve alerts on pipeline, sync, automation, agent, AI function, writeback, webhook, edge and dataset runs, and send them by severity to email, Slack, Teams, a signed webhook (monitor.alert.opened, .escalated, .resolved) or the inbox, with snoozes that need a reason and an end time
On request, a starter set of alert rules covers the conditions operators most often need to know about, such as stale syncs, writeback dead letters and disconnected edge agents, kept as YAML so teams can hold them in version control
Export to your tools
Built: traces go to any OpenTelemetry collector over OTLP/HTTP or gRPC, and Prometheus scrapes /metrics. On request, metrics, logs and traces export after redaction to your own collector, Grafana, Datadog, Splunk or a bucket, with each destination choosing the signals it receives
Because the platform honours incoming traceparent headers, exporting platform traces to the collector your own services use gives you single traces that run from a button press in your app to a row written in the ERP. That is usually the fastest way to answer "why was this slow"
Limitations
- The metrics in the platform today are listed above. The full metric catalogue and OTLP metrics and logs are delivered on request
- Signals describe the platform, not your operation. They never carry property values, prompts or keys of labelled objects, so business questions belong in the Ontology, not in a log search
- Metric labels are limited to a fixed set. You cannot break a metric down by primary key, user or any other high-cardinality value
- On request, successful requests are sampled. Errors, slow requests, action applies and agent runs are always kept; other individual requests may have no trace
- Debug logging in managed cloud is limited to one service for up to one hour at a time
- Exports run after redaction and sampling. A destination receives the same filtered signals as the console, never more
- Service level objectives are agreed per implementation, and none is a contractual service level unless an agreement says so