Skip to content

About

Lezer-based LogQL grammar, forked to parse duration placeholders (e.g., $__interval) and variable references (e.g., $env)

Resources

Stars

2 stars

Watchers

1 watching

Forks

 
 

Repository files navigation

lezer-logql

A fork of Grafana's lezer-logql, published as @oxynote/lezer-logql. It adds two things, so an editor does not mark a templated query as broken: duration placeholders ($__auto, $__interval, $__range) parse as durations, and variable references ($env) parse as a VariableReference wherever a label name, a number or a duration goes. A variable inside a quoted value ({app="$app"}) is part of the string, as upstream already parses it. Everything else is upstream's, and NOTICE lists the changes.

LogQL lezer grammar based on https://github.com/grafana/loki/blob/main/pkg/logql/syntax/syntax.y.

Installation

npm install @oxynote/lezer-logql

Development

Building

npm run build

Testing

npm test

Publishing

Bump version in package.json to upstream's version plus this fork's counter (0.4.2-oxynote.2), then push a matching tag (v0.4.2-oxynote.2). The publish workflow builds, runs the tests, checks the tag against the manifest and publishes to npm with provenance.

Syncing with upstream

This repository is a GitHub fork, so upstream's changes come in with a merge:

git remote add upstream https://github.com/grafana/lezer-logql.git
git fetch upstream
git merge upstream/main

Then add any new change of this fork to NOTICE.

About

Lezer-based LogQL grammar, forked to parse duration placeholders (e.g., $__interval) and variable references (e.g., $env)

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages