Back to Daft

Telemetry

docs/observability/telemetry.md

0.7.103.7 KB
Original Source

Telemetry

Daft exports OpenTelemetry (OTLP) metrics for query execution. Export is off by default and is enabled by setting an OTLP endpoint environment variable. Metrics can be sent to any OTLP-compatible backend, such as Prometheus with OTLP receiver enabled.

Configuration

Set OTLP environment variables to configure telemetry. Daft enables OpenTelemetry when any OTLP endpoint is set.

Examples

Configure telemetry with environment variables:

bash
# 1) Set an OTLP endpoint (enables telemetry)
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317

# 2) Run your Daft pipeline
python my-daft-script.py

For metrics-only export to Prometheus (with the OTLP receiver enabled):

bash
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=http://localhost:9090/api/v1/otlp/v1/metrics
python my-daft-script.py

Configuration details

VariableDescriptionDefaultAllowed values
OTEL_EXPORTER_OTLP_ENDPOINTBase OTLP endpoint used for metrics/logs/traces unless signal-specific endpoints are set.UnsetOTLP endpoint URL, for example http://localhost:4317
OTEL_EXPORTER_OTLP_METRICS_ENDPOINTMetrics-only OTLP endpoint. Overrides OTEL_EXPORTER_OTLP_ENDPOINT for metrics.UnsetOTLP endpoint URL
OTEL_EXPORTER_OTLP_LOGS_ENDPOINTLogs-only OTLP endpoint. Overrides OTEL_EXPORTER_OTLP_ENDPOINT for logs.UnsetOTLP endpoint URL
OTEL_EXPORTER_OTLP_TRACES_ENDPOINTTraces-only OTLP endpoint. Overrides OTEL_EXPORTER_OTLP_ENDPOINT for traces.UnsetOTLP endpoint URL
OTEL_EXPORTER_OTLP_PROTOCOLOTLP exporter protocol.grpcgrpc, http/protobuf, http/json
OTEL_METRIC_EXPORT_INTERVALMetrics export interval in milliseconds.500Positive integer (milliseconds)
DAFT_DEV_OTEL_EXPORTER_OTLP_ENDPOINTDeprecated alias for OTEL_EXPORTER_OTLP_ENDPOINT.UnsetOTLP endpoint URL

!!! info OTEL_EXPORTER_OTLP_METRICS_ENDPOINT, OTEL_EXPORTER_OTLP_LOGS_ENDPOINT, and OTEL_EXPORTER_OTLP_TRACES_ENDPOINT take precedence over OTEL_EXPORTER_OTLP_ENDPOINT for their respective signal.

!!! warning For metrics, http/protobuf is supported and http/json is not currently supported. For logs and traces, Daft currently exports via gRPC. Use HTTP-style endpoint URLs (http:// or https://) for OTLP exporters; protocol is controlled by OTEL_EXPORTER_OTLP_PROTOCOL.

Metrics

Daft exports the following metrics.

MetricTypeLabelsDescription
daft.bytes.readCounternode.id, node.typeTotal bytes read by source/scan operators.
daft.bytes.writtenCounternode.id, node.typeTotal bytes written by write sinks.
daft.durationCounternode.id, node.typeAccumulated operator CPU time in microseconds.
daft.rows.inCounternode.id, node.typeTotal rows consumed by an operator.
daft.rows.outCounternode.id, node.typeTotal rows emitted by an operator.
daft.rows.writtenCounternode.id, node.typeTotal rows written by write sinks.
daft.task.activeUpDownCounternode.id, node.typeNumber of currently active tasks.
daft.task.cancelledCounternode.id, node.typeTotal cancelled tasks.
daft.task.completedCounternode.id, node.typeTotal completed tasks.
daft.task.failedCounternode.id, node.typeTotal failed tasks.

!!! info The following metrics are emitted only in distributed (Ray) execution: daft.bytes.read, daft.task.active, daft.task.cancelled, daft.task.completed, daft.task.failed.