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

improve regexp component performance in loki.process: call fmt only if debug enabled #2272

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ Main (unreleased)

- Upgrade `github.com/goccy/go-json` to v0.10.4, which reduces the memory consumption of an Alloy instance by 20MB.
If Alloy is running certain otelcol components, this reduction will not apply. (@ptodev)

- improve performance in regexp component: call fmt only if debug is enabled (@r0ka)
- Update `prometheus.write.queue` library for performance increases in cpu. (@mattdurham)


### Bugfixes

- Fixed issue with automemlimit logging bad messages and trying to access cgroup on non-linux builds (@dehaansa)
Expand Down
4 changes: 3 additions & 1 deletion internal/component/loki/process/stages/regex.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ func (r *regexStage) Process(labels model.LabelSet, extracted map[string]interfa
extracted[name] = match[i]
}
}
level.Debug(r.logger).Log("msg", "extracted data debug in regex stage", "extracted data", fmt.Sprintf("%v", extracted))
if level.DebugValue() {
level.Debug(r.logger).Log("msg", "extracted data debug in regex stage", "extracted data", fmt.Sprintf("%v", extracted))
}
}

// Name implements Stage
Expand Down