Skip to content

Query telemetry

Query workflow logs and spans for a job from Python or Go.

Tilebox stores logs and spans for each workflow job. Use the jobs client to query that telemetry from notebooks, scripts, or automated diagnostics.

query_logs() returns a LogRecords list. Pagination is handled automatically.

from tilebox.workflows import Client
client = Client()
job = client.jobs().find("019e07b1-916b-0630-f3ba-f1c33235d174")
logs = client.jobs().query_logs(job)
for record in logs:
print(record.time, record.severity_text, record.body)
print(record.attributes)

Each log record includes:

  • time
  • severity_number and severity_text
  • body
  • trace_id and span_id
  • attributes
  • runner_attributes

Use to_pandas() to convert log records to a pandas DataFrame.

Python
logs_df = client.jobs().query_logs(job).to_pandas()
logs_df[["time", "severity_text", "body"]]
Job Logs as Pandas DataFrame

query_spans() returns a Spans list. Pagination is handled automatically.

spans = client.jobs().query_spans(job.id)
for span in spans:
print(span.name, span.status_code, span.duration)
print(span.attributes)

Each span includes:

  • start_time and end_time
  • duration
  • trace_id, span_id, and parent_span_id
  • name
  • status_code and status_message
  • attributes
  • runner_attributes
  • events

Use to_pandas() to convert spans to a pandas DataFrame.

Python
spans_df = client.jobs().query_spans(job).to_pandas()
slow_spans = spans_df.sort_values("duration", ascending=False).head(10)
slow_spans[["name", "duration", "start_time"]]
Job Traces as Pandas DataFrame

Nested attributes, runner_attributes, and events stay as Python objects in DataFrame columns. Span DataFrames include a computed duration column.