Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

- [BUGFIX] Operator: Create govern service per Grafana Agent (@shturman)

- [BUGFIX] Operator: Fix relabel_config directive for PodLogs resource (@hjet)

- [CHANGE] Self-scraped integrations will now use an SUO-specific value for the `instance` label. (@rfratto)

# v0.20.0 (2021-10-28)
Expand Down
18 changes: 18 additions & 0 deletions pkg/operator/config/logs_templates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,17 @@ func TestPodLogsConfig(t *testing.T) {
Namespace: "operator",
Name: "podlogs",
},
Spec: gragent.PodLogsSpec{
RelabelConfigs: []*prom_v1.RelabelConfig{{
SourceLabels: []string{"input_a", "input_b"},
Separator: ";",
TargetLabel: "target_a",
Regex: "regex",
Modulus: 1234,
Replacement: "foobar",
Action: "replace",
}},
},
},
"apiServer": prom_v1.APIServerConfig{},
"ignoreNamespaceSelectors": false,
Expand Down Expand Up @@ -502,6 +513,13 @@ func TestPodLogsConfig(t *testing.T) {
target_label: __path__
separator: /
replacement: /var/log/pods/*$1/*.log
- source_labels: ["input_a", "input_b"]
separator: ";"
target_label: "target_a"
regex: regex
modulus: 1234
replacement: foobar
action: replace
`),
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local optionals = import 'ext/optionals.libsonnet';

// @param {RelabelConfig} cfg
function(cfg) {
source_labels: optionals.array(cfg.SourceLabels),
separator: optionals.string(cfg.Separator),
regex: optionals.string(cfg.Regex),
modulus: optionals.number(cfg.Modulus),
target_label: optionals.string(cfg.TargetLabel),
replacement: optionals.string(cfg.Replacement),
action: optionals.string(cfg.Action),
}