Skip to content

Commit

Permalink
Use stage.cri for cri-o container runtimes (#496)
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <pete.wall@grafana.com>
  • Loading branch information
petewall committed Apr 30, 2024
1 parent 2986a2f commit ca161f3
Show file tree
Hide file tree
Showing 62 changed files with 1,755 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ discovery.relabel "pod_logs" {
rule {
action = "replace"
source_labels = ["__meta_kubernetes_pod_container_id"]
regex = "^(\\w+):\\/\\/.+$"
regex = "^(\\S+):\\/\\/.+$"
replacement = "$1"
target_label = "tmp_container_runtime"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ loki.process "pod_logs" {
}
}

stage.match {
selector = "{tmp_container_runtime=\"cri-o\"}"
// the cri processing stage extracts the following k/v pairs: log, stream, time, flags
stage.cri {}

// Set the extract flags and stream values as labels
stage.labels {
values = {
flags = "",
stream = "",
}
}
}

// if the label tmp_container_runtime from above is docker parse using docker
stage.match {
selector = "{tmp_container_runtime=\"docker\"}"
Expand Down
16 changes: 15 additions & 1 deletion examples/alloy-autoscaling-and-storage/logs.alloy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions examples/alloy-autoscaling-and-storage/metrics.alloy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 58 additions & 2 deletions examples/alloy-autoscaling-and-storage/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion examples/control-plane-metrics/logs.alloy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions examples/control-plane-metrics/metrics.alloy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 58 additions & 2 deletions examples/control-plane-metrics/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion examples/custom-config/logs.alloy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions examples/custom-config/metrics.alloy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ca161f3

Please sign in to comment.