Documentation
¶
Overview ¶
Package logqlsyntax is the root of a partial fork of Grafana Loki's LogQL parser packages, stripped of Loki's runtime dependencies (dskit, etcd, jaeger, queryrange, push, etc.).
Use sub-packages to parse and walk LogQL expressions:
import "github.com/qualithm/logql-syntax/syntax"
expr, err := syntax.ParseExpr(`sum by (job) (rate({app="api"} |= "error" [5m]))`)
if err != nil {
return err
}
expr.Walk(func(e syntax.Expr) bool { return true })
See the README for the relationship to upstream Loki and the sync workflow.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
logfmt
Adapted from https://github.com/go-logfmt/logfmt/ but []byte as parameter instead Original license is MIT.
|
Adapted from https://github.com/go-logfmt/logfmt/ but []byte as parameter instead Original license is MIT. |
|
Package logqlmodel contains the error types and label-name constants used by the LogQL syntax and evaluation packages.
|
Package logqlmodel contains the error types and label-name constants used by the LogQL syntax and evaluation packages. |
|
This file is taken from the golang text/scanner package so `bufLen` can be set to `maxInputSize`.
|
This file is taken from the golang text/scanner package so `bufLen` can be set to `maxInputSize`. |
Click to show internal directories.
Click to hide internal directories.