Skip to content

PromQL (the Prometheus Query Language) on top of SQL Databases to query them like a time-series database

License

Notifications You must be signed in to change notification settings

IvanTheFirst/promql_to_sql

 
 

Repository files navigation

PromSQL: PromQL on top of SQL

This project implements the PromQL lamguage on top of SQL databases in order to query them with a timeseries query language. This way, we can query already existing data in SQL databases as if they are stored in a timeseries database like Prometheus.

Tasks:

  • Implement the PromQL grammar in LARK
  • Implement fetching data from the SQL database using sqlalchemy
  • Implement all nodes
  • Implement config manager

How to use?

First run the docker-compose file:

docker-compose up

Then push some data in the QuestDB database using

pip install -r requirements.txt
pip install -e .
promsql-cli.py

Then in the opened command prompt, enter the following:

promsql > telemetry[5m]

This will get all the telemety metric values since the last 5 minitues.

How to change the configs

Right now, the only way to change the configs is changing the values in the promsql/constants.py file.

About

PromQL (the Prometheus Query Language) on top of SQL Databases to query them like a time-series database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%