Dashboards (Kibana)
This page is about the Kibana dashboard (
--local kibanaorboth). The built-in, light dashboard that needs no Kibana is described in dash-obskitpy.
The base dashboard
obskitpy init generates the <service>-observability dashboard (a fixed id, so re-importing overwrites instead of duplicating).
All panels filter by resource.attributes.service.name : "<service>".
| Panel | Source | What it shows |
|---|---|---|
| Logs / Errors | logs | Total logs and logs with severity_text: ERROR. |
| Runs (traces) | traces | Root spans (each run, end to end). |
| Runs with errors | traces | Root spans with status.code: Error. It only counts failures that bring down the whole run; handled failures show up under Errors. |
| Logs by severity | logs | Volume over time, by INFO/WARN/ERROR. |
| Spans per operation | traces | Number of spans per name, over time. |
| Span duration | traces | Average, maximum and count per operation (in ns; Kibana formats it as ms/s). |
| Errors by type and origin | logs | error.type × error.origin (file:function:line) with a count. |
| Errors (logs) | logs | A saved search with the errors, body.text, type, origin and trace_id. |
Investigating an error
- In the Errors (logs) panel or in Errors by type and origin, identify the type and the origin.
- Copy the
trace_idfrom the error row. - In Discover, choose the
<service> - Tracesdata view and filter bytrace_id : "<id>": you see every span of that run, with its duration and which one failed.
The spans with status.code: Error show where the failure happened (here, GET → dia.baixar → dia.processar).
4. Open the log document to see error.chain (the call chain) and exception.stacktrace.
Evolving the dashboard
There are two paths. Choose one per project so you do not overwrite the other's work.
A) In Kibana (simplest)
- Open the dashboard → Edit → add or adjust panels (Lens, TSVB, saved searches…) → Save.
- Write it to the repository:
bash obskitpy dashboard export git add observability/dashboard.ndjson && git commit -m "dashboard: new panel X" - On another machine or in CI,
obskitpy up(orobskitpy dashboard apply) recreates the identical dashboard.
export includes the dashboard and everything it references (visualizations, searches, data views).
B) In code (reviewable in a pull request)
Generate dashboard.ndjson from a Python script that starts from the base dashboard. The
news example does exactly that:
from obskitpy.dashboard import build, agg, metric_vis, chart_vis, table_vis, terms, date_histogram, ref, search_source
objects = build("my-service") # obskitpy's base panels
# ... add data views, visualizations and panels, adjusting dashboard.panelsJSON and references
Then: python observability/extend_dashboard.py && obskitpy dashboard apply.
The script regenerates the file from scratch; do not run export on top of it, or the edits made in Kibana will replace the script.
Helpers available in obskitpy.dashboard: agg, terms, date_histogram, metric_vis, chart_vis,
table_vis, search_source, ref, build, to_ndjson.
Mixing in business data
If the robot stores what it extracts in Elasticsearch (as the news example does in noticias-sp), create a data
view for that index and build panels next to the health ones. The result is a single dashboard that answers both
"is the robot healthy?" and "what did it extract?".
Tips
- Time window: the dashboard stores
now-24h; Kibana, however, remembers the last window you used in the browser. For a link with a fixed window:...#/view/<id>?_g=(time:(from:now-7d,to:now)). - Data views:
initcreates<service> - Logsand<service> - Traces(patternslogs-generic.otel-*andtraces-generic.otel-*). For metrics, create ametrics-generic.otel-*data view. - Date fields: panels over business data use the date field of your index
(
date_histogram(2, field="published_at")).