Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max_cache_size was being set to 0 #5869

Merged
merged 4 commits into from
Nov 28, 2023
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 @@ -209,6 +209,8 @@ v0.38.0 (2023-11-21)
- Fix converter output for prometheus.exporter.windows to not unnecessarily add
empty blocks. (@erikbaranowski)

- Fix converter issue with `loki.relabel` and `max_cache_size` being set to 0 instead of default (10_000). (@mattdurham)

### Other changes

- Bump `mysqld_exporter` version to v0.15.0. (@marctc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ func (s *ScrapeConfigBuilder) getOrNewLokiRelabel() string {
args := lokirelabel.Arguments{
ForwardTo: s.getOrNewProcessStageReceivers(),
RelabelConfigs: component.ToFlowRelabelConfigs(s.cfg.RelabelConfigs),
// max_cache_size doesnt exist in static, and we need to manually set it to default.
// Since the default is 10_000 if we didnt set the value, it would compare the default 10k to 0 and emit 0.
// We actually dont want to emit anything since this setting doesnt exist in static, setting to 10k matches the default
// and ensures it doesnt get emitted.
MaxCacheSize: lokirelabel.DefaultArguments.MaxCacheSize,
}
compLabel := common.LabelForParts(s.globalCtx.LabelPrefix, s.cfg.JobName)
s.f.Body().AppendBlock(common.NewBlockWithOverride([]string{"loki", "relabel"}, compLabel, args))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ loki.relabel "fun" {
source_labels = ["__trail__"]
target_label = "__path__"
}
max_cache_size = 0
}

loki.source.cloudflare "fun" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ loki.relabel "fun" {
source_labels = ["__trail__"]
target_label = "__path__"
}
max_cache_size = 0
}

loki.source.windowsevent "fun" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ loki.relabel "logs_log_config_fun" {
source_labels = ["__trail__"]
target_label = "__path__"
}
max_cache_size = 0
}

loki.source.cloudflare "logs_log_config_fun" {
Expand Down
2 changes: 0 additions & 2 deletions converter/internal/staticconvert/testdata/sanitize.river
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ loki.relabel "logs_integrations_integrations_windows_exporter_application" {
source_labels = ["computer"]
target_label = "agent_hostname"
}
max_cache_size = 0
}

loki.source.windowsevent "logs_integrations_integrations_windows_exporter_application" {
Expand Down Expand Up @@ -75,7 +74,6 @@ loki.relabel "logs_integrations_integrations_windows_exporter_system" {
source_labels = ["computer"]
target_label = "agent_hostname"
}
max_cache_size = 0
}

loki.source.windowsevent "logs_integrations_integrations_windows_exporter_system" {
Expand Down