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.1.1.tar.gz (23.4 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.1.1-py3-none-manylinux_2_34_x86_64.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.34+ x86-64

File details

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

File metadata

  • Download URL: heracles_ql-0.1.1.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.22

File hashes

Hashes for heracles_ql-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0c35503793dadf575de0b521f9c204316c1459084423cea4861816a1215758e7
MD5 1c5bf5f21957ebb351cce661910c6e56
BLAKE2b-256 7729ece61f677b6c6137e35ed6e907bce996c80e96f4a8aa9d0ebc69aa4ef497

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for heracles_ql-0.1.1-py3-none-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 92794c816992db56937326c214eeb022f05121b9b945d82a5584aa98cda43756
MD5 25a4ef08b0e0eb8fd2f2c6540e69a2fc
BLAKE2b-256 19ab07fcf7077e2c2e207120bc6ecde71f505b6023636bd2abfe6c62309254b4

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