heralces-ql VictoriaMetrics DSL
Project description
HeraclesQL - A Python DSL for writing VictoriaMetrics Queries
🚧 HeraclesQL is available now, but this repo is still under construction! 🚧
HeraclesQL is a Python package which provides a type-safe embedded domain specific language for writing VictoriaMetrics MetricsQL queries.
Highlights include:
- MetricsQL-like syntax - HeraclesQL will be immediately familiar to anyone who's written MetricsQL or PromQL!
- Custom Functions and Parameterizable Expressions - No more copy and pasting behavior between alerts!
- Static Type Safety - MyPy and your editor will catch common problems before they occur!
- Variables - Complicated alerts can be expressed imperatively!
- Meta-alerts - Generate alerts about your alerts to avoid common pitfalls!
Installation
HeraclesQL is available on PyPi. Just pip install heracles-ql
HeraclesQL depends on native code in a few places. Right now, we provide binaries for manylinux_2_34_x86_64.
Otherwise, we provide an sdist that includes the native source code. In order to build the sdist, you'll need a modern Go compiler.
Example
HeraclesQL lets you write MetricsQL queries as Python. For example,
from heracles import ql
v = ql.Selector()
my_query = ql.rate(v.my_interesting_metric(useful="label")[5 * ql.Minute])
print(ql.format(my_query.render()))
# rate(my_interesting_metric{useful="label"}[5m])
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 heracles_ql-0.2.0.tar.gz.
File metadata
- Download URL: heracles_ql-0.2.0.tar.gz
- Upload date:
- Size: 33.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f7b54fdf4ca3db49964eaffde720daee41ec42f5efe6798c17d2b29477541ed
|
|
| MD5 |
705bc4f61bb9b0ebe973663d8b1a77e7
|
|
| BLAKE2b-256 |
955ef9a5ea8670e1e3d88befe50ab580ed073c9d3d7f239a6a18bddd79128e94
|
File details
Details for the file heracles_ql-0.2.0-py3-none-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: heracles_ql-0.2.0-py3-none-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 18.0 MB
- Tags: Python 3, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
348fffbb95a886ed44e7c52b4758fbc7eac1c4083083481ae2339b78c2bee05d
|
|
| MD5 |
b18ec79c8aa3652dcce9d1b5264b91dc
|
|
| BLAKE2b-256 |
9755cd832c55e5f3b0cc8492bee2fe1b1fe05c8289f2892d16bfd8a6b91e5241
|