Skip to main content

polars-telemetry

See what your Polars queries do: timings and row counts for every node of every query, both plans in a browser viewer, and findings on what slows a query down. Send the same data to OpenTelemetry or DogStatsD when you want it in your observability stack.

Both plans of a TPC-H query, its figures, and a finding on the selected node in the profile viewer

Python 3.10+, Polars 1.44.1 – 1.44.x and 2.x. Not affiliated with Polars: it uses an interface Polars exposes for Polars Cloud, which can change in any Polars release.

Install

pip install polars-telemetry

Quick start

1. Profile a block of code

import polars as pl
import polars_telemetry as pt

orders = pl.LazyFrame({"id": range(200_000), "region": ["EU", "US"] * 100_000})

with pt.profile() as session:
    orders.unique().group_by("region").len().collect()

session.write("profile.jsonl")

2. Open it in the viewer

Drop profile.jsonl on the profile viewer: both plans, every node's counters, and the findings. It runs in your browser and uploads nothing. No profile at hand? The viewer loads the TPC-H queries with one click.

3. Find what slows it down

$ polars-telemetry insights profile.jsonl
profile.jsonl · 01a111e2-ac8d-7fd0-a766-e17ecb2eec7c  (9 ms wall, 32 ms CPU, 9 nodes)
  warn   75% CPU   Deduplication removes no rows  [redundant_aggregation, GroupBy #4294967299]
                   rows_in 200K · rows_removed 0
                   fix: drop the `unique`/`group_by` if keys are unique by construction, or dedup at the source

1 query: 1 warning, 0 information

--fail-on warn exits with 1 on a warning, for CI. Every rule: Insights.

Or watch every query as it runs

import polars as pl
import polars_telemetry as pt
from polars_telemetry.export.console import ConsoleExporter

pt.install(exporter=ConsoleExporter())

orders = pl.LazyFrame({"region": ["EU", "US", "EU"], "amount": [10, 20, 30]})
orders.group_by("region").agg(pl.col("amount").sum()).collect()
polars query 1a8cfdfd ok wall=1.92ms planning=0.47ms cpu=1.57ms parallelism=0.82x nodes=5 rows_out=2
  at report.py:8 in <module>()
  GroupBy               0.89ms  in=           3  out=           2
  InMemorySource        0.52ms  in=           0  out=           3
  SimpleProjection        74us  in=           3  out=           3
  InMemorySink            61us  in=           2  out=           0
  SimpleProjection        23us  in=           2  out=           2

Send it to your observability stack

Exporter Install Sends
OpenTelemetry, the default pip install 'polars-telemetry[otlp]', then set up the SDK a span per query, per-node metrics, findings as span events
DogStatsD pip install 'polars-telemetry[datadog]' the same metrics, tagged, to the Datadog Agent or Telegraf
JSONL file included a profile per query, for the viewer and the CLI
Console included a short summary on standard error

pt.install() without an exporter sends to OpenTelemetry, through the SDK you configured; exporter= takes one exporter or a list. Every span attribute and metric: Spans and metrics.

Label queries

with pt.label("revenue_by_region"):
    report.collect()

Labels name a query in the viewer, the CLI and on spans; nested labels join with /. See Labels.

Configure

pt.install(pt.Config(node_metrics=False))
Option Default Effect
node_metrics True Read per-node counters once at query end
include_plan False Attach the full plan to the span as JSON
call_site True Record the file, line and function that ran the query
describe_fallbacks True Have Polars describe what an in-memory fallback node runs
insights True Find what slows each query down, as it runs
redaction None What to mask before exporters see a query; Redaction() masks literal values

Details: Configuration.

Your data

Plans are exported as written, literal values included, such as col("email") == "...". Config(redaction=Redaction()) masks them; metrics never carry them. URL query strings, which can hold credentials, are masked for every exporter. Details: Data and privacy.

License

Apache-2.0. See LICENSE and NOTICE.

Metadata

Release files for polars-telemetry 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polars-telemetry 0.8.1
File Size Uploaded
polars_telemetry-0.8.1.tar.gz 591.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for polars-telemetry 0.8.1
File Interpreter ABI Platform
polars_telemetry-0.8.1-py3-none-any.whl Python 3 none any Details

Total release size: 680.7 kB

Release files / polars_telemetry-0.8.1.tar.gz

Download URL polars_telemetry-0.8.1.tar.gz
Size 591.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b9dee3428e25dd0bcc32b31cf2549598de22e3c0aba203ee85b6bfb826905a32
BLAKE2b-256 checksum
How to use checksums
61efddc4e840958a35d333cf75ecd813f6e1b1572822c297ae1e6ee65b3173e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / polars_telemetry-0.8.1-py3-none-any.whl

Download URL polars_telemetry-0.8.1-py3-none-any.whl
Size 89.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0a5acdad3af9fdffbe5f96bb2709f3e57786c4c164bb2f2e4bb425cb916d762
BLAKE2b-256 checksum
How to use checksums
3e3c74d1245d915275ef439076dfa6ca50fa1739f4434bc912e12ba95d58d07b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

0.10.0

2 release files

0.9.0

2 release files

0.8.3

2 release files

0.8.2

2 release files

This release

0.8.1 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page