https://github.com/influxdata/promql
https://github.com/influxdata/promql
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/influxdata/promql
- Owner: influxdata
- License: apache-2.0
- Created: 2019-09-12T01:57:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-06-01T20:56:16.000Z (about 3 years ago)
- Last Synced: 2025-03-24T22:42:03.292Z (2 months ago)
- Language: Go
- Size: 111 KB
- Stars: 11
- Watchers: 51
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PromQL Module
[](http://godoc.org/github.com/influxdata/promql)
The PromQL module in this package is a pruned version of the native Prometheus [promql](https://github.com/prometheus/prometheus/tree/master/promql) package, but extracted into a single module with fewer dependencies.
This module removes the promql engine and keeps anything related to lexing and parsing the PromQL language.
Each version of this module matches with the equivalent Prometheus version.
## Example
The PromQL module can be used to parse an expression.
```go
package mainimport (
"fmt""github.com/influxdata/promql/v2"
)var myExpression = `http_requests_total{job="prometheus"}[5m]`
func main() {
expr, err := promql.ParseExpr(myExpression)
if err != nil {
panic(err)
}fmt.Println(promql.Tree(expr))
}
```## Contributing
Any changes to PromQL should not be made to this module as it is a pruned mirror of the original prometheus package. Changes should be submitted to the upstream [Prometheus](https://github.com/prometheus/prometheus) project and they will find their way into this repository when a new release happens.
The only changes that will be accepted into this repository are ones that fix a problem in the mirroring process, deviations from the upstream Prometheus, or operational changes to fulfill the primary purpose of this repository as a mirror of the promql package.