Skip to content

Commit

Permalink
update to River v0.2.0 for raw strings (#5557)
Browse files Browse the repository at this point in the history
* update to River v0.2.0 for raw strings

Signed-off-by: erikbaranowski <[email protected]>

* Update docs/sources/flow/config-language/expressions/types_and_values.md

Co-authored-by: Robert Fratto <[email protected]>

---------

Signed-off-by: erikbaranowski <[email protected]>
Co-authored-by: Robert Fratto <[email protected]>
  • Loading branch information
erikbaranowski and rfratto authored Oct 23, 2023
1 parent be47c3a commit 554f0bf
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Main (unreleased)
- Added a new `stage.eventlogmessage` stage to `loki.process` component which
allows to extract data from Windows Event Log. (@thampiotr)

- Update version of River to support raw strings in flow using a backtick. (@erikbaranowski)

### Bugfixes

- Fixed an issue where `loki.process` validation for stage `metric.counter` was
Expand Down
27 changes: 27 additions & 0 deletions docs/sources/flow/config-language/expressions/types_and_values.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,33 @@ The supported escape sequences are as follows:
| `\uNNNN` | A Unicode character from the basic multilingual plane (NNNN is four hexadecimal digits) |
| `\UNNNNNNNN` | A Unicode character from supplementary planes (NNNNNNNN is eight hexadecimal digits) |

## Raw strings

Raw strings are represented by sequences of Unicode characters surrounded by backticks ``` `` ```.
Raw strings do not support any escape sequences:

```river
`Hello, "world"!`
```

Within the backticks, any character may appear except a backtick. A backtick
can be included by concatenating a double quoted string that contains a
backtick using `+`.

A multiline raw string will be interpretted exactly as written:

```river
`Hello,
"world"!`
```

is interpretted as a string with the value:

```string
Hello,
"world"!
```

## Bools

Bools are represented by the symbols `true` and `false`.
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ require (
github.com/grafana/pyroscope/api v0.2.0
github.com/grafana/pyroscope/ebpf v0.2.3
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db
github.com/grafana/river v0.1.2-0.20231003183959-75f893ffa7df
github.com/grafana/river v0.2.0
github.com/grafana/snowflake-prometheus-exporter v0.0.0-20221213150626-862cad8e9538
github.com/grafana/tail v0.0.0-20230510142333-77b18831edf0
github.com/grafana/vmware_exporter v0.0.4-beta
Expand Down Expand Up @@ -96,7 +96,7 @@ require (
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
github.com/ncabatoff/process-exporter v0.7.10
github.com/nerdswords/yet-another-cloudwatch-exporter v0.54.0
github.com/ohler55/ojg v1.19.3 // indirect
github.com/ohler55/ojg v1.20.0 // indirect
github.com/oklog/run v1.1.0
github.com/olekukonko/tablewriter v0.0.5
github.com/oliver006/redis_exporter v1.54.0
Expand Down Expand Up @@ -469,7 +469,7 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-xmlrpc v0.0.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,8 @@ github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db h1:7aN5cccjIqCLTzed
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
github.com/grafana/river v0.1.2-0.20231003183959-75f893ffa7df h1:jgguNFI2lCCOD49W1WS+TYHhN5KL5aTXTbn2N14tQVs=
github.com/grafana/river v0.1.2-0.20231003183959-75f893ffa7df/go.mod h1:icSidCSHYXJUYy6TjGAi/D+X7FsP7Gc7cxvBUIwYMmY=
github.com/grafana/river v0.2.0 h1:VgBe/+DdYviJ1cYGUCcA8Og0FhSTjN7jdHCe/+OIFV0=
github.com/grafana/river v0.2.0/go.mod h1:icSidCSHYXJUYy6TjGAi/D+X7FsP7Gc7cxvBUIwYMmY=
github.com/grafana/smimesign v0.2.1-0.20220408144937-2a5adf3481d3 h1:UPkAxuhlAcRmJT3/qd34OMTl+ZU7BLLfOO2+NXBlJpY=
github.com/grafana/smimesign v0.2.1-0.20220408144937-2a5adf3481d3/go.mod h1:iZiiwNT4HbtGRVqCQu7uJPEZCuEE5sfSSttcnePkDl4=
github.com/grafana/snowflake-prometheus-exporter v0.0.0-20221213150626-862cad8e9538 h1:tkT0yha3JzB5S5VNjfY4lT0cJAe20pU8XGt3Nuq73rM=
Expand Down Expand Up @@ -1549,6 +1551,8 @@ github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27k
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU=
Expand Down Expand Up @@ -1701,6 +1705,8 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/ohler55/ojg v1.19.3 h1:rFmEc33aZOvlwb7tibAmwVGEiPfMZkgvurK0YDDr1HI=
github.com/ohler55/ojg v1.19.3/go.mod h1:uHcD1ErbErC27Zhb5Df2jUjbseLLcmOCo6oxSr3jZxo=
github.com/ohler55/ojg v1.20.0 h1:hmpsD9VyuoVH7bHCPtni9eCpOxiIhSlIEzNndXkCySY=
github.com/ohler55/ojg v1.20.0/go.mod h1:uHcD1ErbErC27Zhb5Df2jUjbseLLcmOCo6oxSr3jZxo=
github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs=
github.com/oklog/run v0.0.0-20180308005104-6934b124db28/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
Expand Down

0 comments on commit 554f0bf

Please sign in to comment.