Home / Reference

Dashboards (Kibana)

This page is about the Kibana dashboard (--local kibana or both). 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

  1. In the Errors (logs) panel or in Errors by type and origin, identify the type and the origin.
  2. Copy the trace_id from the error row.
  3. In Discover, choose the <service> - Traces data view and filter by trace_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)

  1. Open the dashboard → Edit → add or adjust panels (Lens, TSVB, saved searches…) → Save.
  2. Write it to the repository: bash obskitpy dashboard export git add observability/dashboard.ndjson && git commit -m "dashboard: new panel X"
  3. On another machine or in CI, obskitpy up (or obskitpy 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

✎ Edit this page on GitHub