Logging
Set up distributed logging using the OpenTelemetry logging protocol
Overview
Tilebox workflows are designed for distributed execution, making it essential to set up logging to a centralized system. Tilebox supports OpenTelemetry logging, which simplifies sending log messages from your tasks to a chosen backend. Collecting and visualizing logs from a distributed cluster of task runners in a tool like Axiom can look like this:
Configure logging
The Tilebox workflow SDKs include support for exporting OpenTelemetry logs. To enable logging, call the appropriate configuration functions during the startup of yourtask runner. Then, use the provided logger
to send log messages from your tasks.
To configure logging with Axiom, you first need to create a Axiom Dataset to export your workflow logs to. You will also need an Axiom API key with the necessary write permissions for your Axiom dataset.
Setting the environment variables AXIOM_API_KEY
and AXIOM_LOGS_DATASET
allows you to omit these arguments in the configure_otel_logging_axiom
function.
Emitting log messages
Use the logger provided by the Tilebox SDK to emit log messages from your tasks. You can then use it to send log messages to the configured logging backend.
Log messages emitted within a task’s execute
method are also automatically recorded as span events for the current job trace.
Logging task runner internals
Tilebox task runners also internally use a logger. By default, it’s set to the WARNING level, but you can change it by explicitly configuring a logger for the workflows client when constructing the task runner.
Was this page helpful?