Trino query monitoring: CLI, TUI dashboard, and progress library
Project description
trinops
Trino query monitoring from the terminal. CLI commands for listing and inspecting queries, a live TUI dashboard, and a progress-tracking library for use in Python scripts.
Installation
pip install trinops
The default install includes the CLI and TUI dashboard. For tqdm progress bars in library usage:
pip install trinops[tqdm]
Quick Start
Configure your Trino connection:
trinops config init
Or pass the server directly:
trinops queries --server trino.example.com:443
Or set environment variables:
export TRINOPS_SERVER=trino.example.com:443
export TRINOPS_USER=myuser
export TRINOPS_AUTH=basic
CLI Usage
List queries
# Your recent queries
trinops queries
# All users' queries
trinops queries --query-user all
# Filter by state
trinops queries --state RUNNING
# JSON output (pipe to jq, etc.)
trinops queries --json
# Select specific fields
trinops queries --select query_id,state,user,elapsed_time
Inspect a single query
# Rich formatted detail
trinops query <query-id>
# Full REST API response as JSON
trinops query <query-id> --json
# Select specific fields from the raw response
trinops query <query-id> --select queryId,state,queryStats.elapsedTime,queryStats.peakUserMemoryReservation
TUI dashboard
trinops tui
trinops top # alias
The dashboard shows a live-updating table of queries with sorting, detail pane, and configurable refresh interval. Keybindings: r refresh, u toggle user filter, a show all, -/+ adjust refresh rate, q quit.
Configuration
Config file lives at ~/.config/trinops/config.toml:
[default]
server = "trino.example.com:443"
scheme = "https"
user = "myuser"
auth = "none"
query_limit = 50
[profiles.prod]
server = "trino-prod.example.com:443"
auth = "oauth2"
Authentication
Supported methods: none, basic, jwt, oauth2, kerberos.
# Check auth status
trinops auth status
# Run OAuth2 flow
trinops auth login
For basic auth, trinops uses the system keyring to store passwords securely.
Library Usage
Wrap a trino cursor or connection to get live progress display during query execution:
import trino
from trinops import TrinoProgress
conn = trino.dbapi.connect(host="trino.example.com", port=443, user="myuser")
cursor = conn.cursor()
with TrinoProgress(cursor) as tp:
tp.execute("SELECT * FROM catalog.schema.table")
rows = tp.fetchall()
You can also monitor an already-running query by passing a connection and query ID:
with TrinoProgress(conn, query_id="20260310_143549_08022_abc") as tp:
tp.start()
tp.wait()
Requirements
- Python 3.10+
- A running Trino cluster with the REST API accessible
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trinops-0.1.0.tar.gz.
File metadata
- Download URL: trinops-0.1.0.tar.gz
- Upload date:
- Size: 136.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf2876e9292511c959a5d25b004a4f84bffa5ccb19eddac044e0c0c8d4df113a
|
|
| MD5 |
011b194d0305aab0d575836531e69727
|
|
| BLAKE2b-256 |
398803ec69d5c95660605f8bb48439dea7eda4556ba55fe14b05077fcdc85913
|
Provenance
The following attestation bundles were made for trinops-0.1.0.tar.gz:
Publisher:
publish.yml on lokkju/trinops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trinops-0.1.0.tar.gz -
Subject digest:
bf2876e9292511c959a5d25b004a4f84bffa5ccb19eddac044e0c0c8d4df113a - Sigstore transparency entry: 1080324823
- Sigstore integration time:
-
Permalink:
lokkju/trinops@0ea7a6ccf0fea943b3a50f9b403fdda65b8f9558 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lokkju
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0ea7a6ccf0fea943b3a50f9b403fdda65b8f9558 -
Trigger Event:
push
-
Statement type:
File details
Details for the file trinops-0.1.0-py3-none-any.whl.
File metadata
- Download URL: trinops-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56fe316ad7f3753e7b99ae9aad96cf7456f73db147eda938ba3406bc51309a90
|
|
| MD5 |
504433f273021b396dc04a300d4baaf3
|
|
| BLAKE2b-256 |
abd0f09e221291166e68b7740fedf653a606b81fc09cd58a28f58921bb6d9ba9
|
Provenance
The following attestation bundles were made for trinops-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on lokkju/trinops
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trinops-0.1.0-py3-none-any.whl -
Subject digest:
56fe316ad7f3753e7b99ae9aad96cf7456f73db147eda938ba3406bc51309a90 - Sigstore transparency entry: 1080324870
- Sigstore integration time:
-
Permalink:
lokkju/trinops@0ea7a6ccf0fea943b3a50f9b403fdda65b8f9558 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lokkju
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0ea7a6ccf0fea943b3a50f9b403fdda65b8f9558 -
Trigger Event:
push
-
Statement type: