diff --git a/CHANGELOG.md b/CHANGELOG.md index 733bc72dc3..33ff4c2944 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,9 +52,10 @@ Main (unreleased) - Use a forked `github.com/goccy/go-json` module 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 reloading configuration and prometheus metrics duplication in `prometheus.write.queue`. (@mattdurham) diff --git a/internal/component/loki/process/stages/regex.go b/internal/component/loki/process/stages/regex.go index 531c230515..27c7daf381 100644 --- a/internal/component/loki/process/stages/regex.go +++ b/internal/component/loki/process/stages/regex.go @@ -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.Debug(r.logger).Enabled() { + level.Debug(r.logger).Log("msg", "extracted data debug in regex stage", "extracted data", fmt.Sprintf("%v", extracted)) + } } // Name implements Stage