polars.Config.enable_monitoring#

classmethod Config.enable_monitoring(active: bool | None = True) type[Config][source]#

Enable runtime monitoring of query execution.

Query metrics are collected and sent to Polars Cloud, letting you inspect the performance of your queries from the dashboard. This requires:

  • A Polars Cloud account. Sign up at https://cloud.pola.rs/ (calling this method triggers a browser-based login if you are not already authenticated).

  • The polars-cloud package installed in this environment (pip install polars-cloud).

Monitoring is supported by the in-memory and streaming engines, but only the streaming engine collects per-node metrics. Enabling monitoring therefore also sets the engine affinity to "streaming". Disabling it does not restore the previous engine affinity.

engine:Streaming
Parameters:
active

Enable monitoring when True (the default), disable it when False.

Examples

>>> pl.Config.enable_monitoring()  

Enable monitoring temporarily with Config; the previous monitoring state and engine affinity are restored on exit:

>>> with pl.Config(enable_monitoring=True):  
...     lf.collect()