-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync cri stage in loki.process with promtail. (#5057)
* Sync cri stage in loki.process with promtail. * Clarify partial line settings in the docs * converter: properly convert new settings in cri stage This commit properly converts the new settings in the CRI stage, which previously weren't available. This also changes the MaxPartialLineSize field to the underlying uint64 type rather than a flagext.ByteSize: * flagext is a Loki package, and we're trying to drop our Loki dependency. * flagext.ByteSize is a type represented by a uint64, but River can't directly decode a uint64 into a flagext.ByteSize because a uint64 is not directly assignable to it in Go. (It needs to implement encoding.TextUnmarshaler for this to work properly). * Promtail does not document that it's possible to pass a string for max_partial_line_size, so using flagext.ByteSize is unnecessary from the documentation's perspective. --------- Co-authored-by: Robert Fratto <[email protected]>
- Loading branch information
Showing
10 changed files
with
184 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
converter/internal/promtailconvert/testdata/pipeline_stages_cri_empty.river
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
discovery.kubernetes "example" { | ||
role = "pod" | ||
kubeconfig_file = "/home/toby/.kube/config" | ||
} | ||
|
||
local.file_match "example" { | ||
path_targets = discovery.kubernetes.example.targets | ||
} | ||
|
||
loki.process "example" { | ||
forward_to = [loki.write.default.receiver] | ||
|
||
stage.cri { } | ||
} | ||
|
||
loki.source.file "example" { | ||
targets = local.file_match.example.targets | ||
forward_to = [loki.process.example.receiver] | ||
} | ||
|
||
loki.write "default" { | ||
endpoint { | ||
url = "http://localhost/loki/api/v1/push" | ||
} | ||
external_labels = {} | ||
} |
12 changes: 12 additions & 0 deletions
12
converter/internal/promtailconvert/testdata/pipeline_stages_cri_empty.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
clients: | ||
- url: http://localhost/loki/api/v1/push | ||
scrape_configs: | ||
- job_name: example | ||
pipeline_stages: | ||
- cri: { } | ||
kubernetes_sd_configs: | ||
- role: pod | ||
kubeconfig_file: /home/toby/.kube/config | ||
|
||
tracing: { enabled: false } | ||
server: { register_instrumentation: false } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.