Skip to content

Commit

Permalink
fix: correct parsing of labels with special characters #131 (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
Loori-R authored May 17, 2024
1 parent 5b8a0ba commit 6b13e53
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## tip

* BUGFIX: fix parsing of label names with special characters for the query builder. See [this issue](https://github.com/VictoriaMetrics/grafana-datasource/issues/131#issuecomment-2105662179).

## [v0.8.1](https://github.com/VictoriaMetrics/grafana-datasource/releases/tag/v0.8.1)

* BUGFIX: fix an issue in the template variable service where accessing the `datasource` property of `undefined` caused a failure. See [this issue](https://github.com/VictoriaMetrics/grafana-datasource/issues/150).
Expand Down
2 changes: 1 addition & 1 deletion packages/lezer-metricsql/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lezer-metricsql",
"version": "0.1.2",
"version": "0.1.3",
"main": "index.cjs",
"type": "module",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/lezer-metricsql/src/metricsql.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ NumberLiteral {
EscapedChar {("\\" AnyEscapesChar) ("\\" AnyEscapesChar)*}
AnyEscapesChar { "-" | "+" | "*" | "/" | "%" | "^" | "=" }
Identifier {(std.asciiLetter | "_" | ":" | "." | EscapedChar) (std.asciiLetter | std.digit | "_" | ":" | "." | "-" | EscapedChar)*}
LabelName { (std.asciiLetter | "_") (std.asciiLetter | std.digit | "_")* }
LabelName {(std.asciiLetter | "_" | ":" | "." | EscapedChar) (std.asciiLetter | std.digit | "_" | ":" | "." | "-" | EscapedChar)*}

// Operator
Sub { "-" }
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6841,7 +6841,7 @@ levn@^0.4.1:
type-check "~0.4.0"

"lezer-metricsql@file:packages/lezer-metricsql":
version "0.1.2"
version "0.1.3"

lines-and-columns@^1.1.6:
version "1.2.4"
Expand Down

0 comments on commit 6b13e53

Please sign in to comment.