Skip to main content

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

heracles_ql-0.2.1.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

heracles_ql-0.2.1-py3-none-manylinux_2_34_x86_64.whl (18.0 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

File details

Details for the file heracles_ql-0.2.1.tar.gz.

File metadata

  • Download URL: heracles_ql-0.2.1.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","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

Hashes for heracles_ql-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c36779b2d9c0141e1162e9f7f105aee49d428489f79e840bbbabaaa133bcbdc0
MD5 1310cafb768887e36aff2d6500e44f9f
BLAKE2b-256 c6b964a9a12c3fa593b908eaa748da2be83d1584bf50d2eeb296e1298b4b6e09

See more details on using hashes here.

File details

Details for the file heracles_ql-0.2.1-py3-none-manylinux_2_34_x86_64.whl.

File metadata

  • Download URL: heracles_ql-0.2.1-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.11.11 {"installer":{"name":"uv","version":"0.11.11","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

Hashes for heracles_ql-0.2.1-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cae03817dc18a697c0c2f1c069b33468a50ca16262040cc34f3eaf26417c6552
MD5 d304be380c257fdda0b2f0863f0c469b
BLAKE2b-256 ecbf2df6a187d43c453a71bcc698d5d7ccc5a682df9343f0f3a0e01dc119dd48

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page