{"id":28493166,"url":"https://github.com/greptimeteam/promql-parser","last_synced_at":"2026-02-26T07:00:52.805Z","repository":{"id":64957750,"uuid":"570076073","full_name":"GreptimeTeam/promql-parser","owner":"GreptimeTeam","description":"PromQL Rust parser","archived":false,"fork":false,"pushed_at":"2025-07-07T21:46:10.000Z","size":292,"stargazers_count":77,"open_issues_count":8,"forks_count":22,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-07-08T01:17:12.194Z","etag":null,"topics":["parser","prometheus","promql"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GreptimeTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-11-24T09:31:50.000Z","updated_at":"2025-06-26T08:21:40.000Z","dependencies_parsed_at":"2023-01-13T14:59:07.650Z","dependency_job_id":"db6f7566-7efa-4042-8de6-2dc6d2d31fe5","html_url":"https://github.com/GreptimeTeam/promql-parser","commit_stats":{"total_commits":59,"total_committers":3,"mean_commits":"19.666666666666668","dds":"0.22033898305084743","last_synced_commit":"ceeba3cba5e8fdd5da895bc064df4c64a4522dd3"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/GreptimeTeam/promql-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreptimeTeam%2Fpromql-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreptimeTeam%2Fpromql-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreptimeTeam%2Fpromql-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreptimeTeam%2Fpromql-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GreptimeTeam","download_url":"https://codeload.github.com/GreptimeTeam/promql-parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreptimeTeam%2Fpromql-parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264200705,"owners_count":23571825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parser","prometheus","promql"],"created_at":"2025-06-08T09:07:51.140Z","updated_at":"2026-01-16T19:39:00.794Z","avatar_url":"https://github.com/GreptimeTeam.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/GreptimeTeam/promql-parser/blob/main/LICENSE)\n[![Build Status](https://github.com/greptimeteam/promql-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/GreptimeTeam/promql-parser/blob/main/.github/workflows/ci.yml)\n[![Version](https://img.shields.io/crates/v/promql-parser?label=promql-parser)](https://crates.io/crates/promql-parser)\n[![codecov](https://codecov.io/gh/GreptimeTeam/promql-parser/branch/main/graph/badge.svg?token=4GEPVMJYNG)](https://app.codecov.io/gh/GreptimeTeam/promql-parser/tree/main)\n\n\n# PromQL Lexer and Parser\n\nThe goal of this project is to build a PromQL lexer and parser capable of\nparsing PromQL that conforms with [Prometheus Query][querying-prometheus].\n\n## Example\n\nTo parse a simple instant vector selector expression:\n\n``` rust\nuse promql_parser::parser;\n\nlet promql = r#\"\n    http_requests_total{\n        environment=~\"staging|testing|development\",\n        method!=\"GET\"\n    } offset 5m\n\"#;\n\nmatch parser::parse(promql) {\n    Ok(expr) =\u003e {\n        println!(\"Prettify:\\n{}\\n\", expr.prettify());\n        println!(\"AST:\\n{expr:?}\");\n    }\n    Err(info) =\u003e println!(\"Err: {info:?}\"),\n}\n```\n\nor you can directly run examples under this repo:\n\n``` shell\ncargo run --example parser\n```\n\nThis outputs:\n\n```rust\nPrettify:\nhttp_requests_total{environment=~\"staging|testing|development\",method!=\"GET\"} offset 5m\n\nAST:\nVectorSelector(VectorSelector { name: Some(\"http_requests_total\"), matchers: Matchers { matchers: [Matcher { op: Re(staging|testing|development), name: \"environment\", value: \"staging|testing|development\" }, Matcher { op: NotEqual, name: \"method\", value: \"GET\" }] }, offset: Some(Pos(300s)), at: None })\n```\n\n## PromQL compliance\n\nThis crate declares compatible with [prometheus v3.8][prom-v3.8], which is\nreleased at 2025-11-28. Any revision on PromQL after this commit is not guaranteed.\n\n## Community Extensions\n\nThere are a number of community projects that extend promql-parser or\nprovide integrations with other systems.\n\n### Language Bindings\n\n- [py-promql-parser](https://github.com/messense/py-promql-parser) Python.\n- [lua-promql-parser](https://github.com/mtrbpr/lua-promql-parser) Lua.\n\n## Known Uses\n\nHere are some of the projects known to use promql-parser:\n\n- [GreptimeDB](https://github.com/GreptimeTeam/greptimedb) Open Source \u0026 Cloud Native Distributed Time Series Database\n- [OpenObserve](https://github.com/openobserve/openobserve) High performance, petabyte scale Elasticsearch/Splunk/Datadog alternative for (logs, metrics, traces, RUM, Error tracking, Session replay)\n\nIf your project is using promql-parser, feel free to make a PR to add it to this list.\n\n## Contributing\n\nContributions are highly encouraged!\n\nPull requests that add support for or fix a bug in a feature in the PromQL will\nlikely be accepted after review.\n\n## Licensing\n\nAll code in this repository is licensed under the [Apache License 2.0](LICENSE).\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\nlicensed as above, without any additional terms or conditions.\n\n[prom-v3.8]: https://github.com/prometheus/prometheus/tree/v3.8.0/promql/parser\n[querying-prometheus]: https://prometheus.io/docs/prometheus/latest/querying/basics/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreptimeteam%2Fpromql-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreptimeteam%2Fpromql-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreptimeteam%2Fpromql-parser/lists"}