From da79510e22486a98f270a8bf32e80fcc97503f1b Mon Sep 17 00:00:00 2001 From: Oleg Zaytsev Date: Tue, 29 Nov 2022 11:38:37 +0100 Subject: [PATCH 1/4] Tag all activity-tracker logs It can be quite hard to find all the activity-tracker logs, I usually grep by `activity` but some customers have that in many queries that are being logged too. Grepping by `activity=` could do the trick sometimes, but also not always. This adds a `module=activity-tracker` label to all the logs issues for the activity tracker, making it much easier to find them. Signed-off-by: Oleg Zaytsev --- pkg/mimir/modules.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/mimir/modules.go b/pkg/mimir/modules.go index 44afc4a3c74..3f559c286e1 100644 --- a/pkg/mimir/modules.go +++ b/pkg/mimir/modules.go @@ -13,6 +13,7 @@ import ( "strconv" "time" + "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/grafana/dskit/dns" "github.com/grafana/dskit/kv/codec" @@ -132,7 +133,7 @@ func (t *Mimir) initActivityTracker() (services.Service, error) { entries, err := activitytracker.LoadUnfinishedEntries(t.Cfg.ActivityTracker.Filepath) - l := util_log.Logger + l := log.With(util_log.Logger, "module", "activity-tracker") if err != nil { level.Warn(l).Log("msg", "failed to fully read file with unfinished activities", "err", err) } From 80e5585699de2dc22241a5e7cd3eecf05f20f667 Mon Sep 17 00:00:00 2001 From: Oleg Zaytsev Date: Tue, 29 Nov 2022 11:41:24 +0100 Subject: [PATCH 2/4] Update CHANGELOG.md Signed-off-by: Oleg Zaytsev --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82fbe2a9d7d..cfae90aad4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ * [ENHANCEMENT] Move the validation of incoming series before the distributor's forwarding functionality, so that we don't forward invalid series. #3386 #3458 * [ENHANCEMENT] S3 bucket configuration now validates that the endpoint does not have the bucket name prefix. #3414 * [ENHANCEMENT] Ruler: Added `ruler.tls-enabled` configuration for alertmanager client. #3432 +* [ENHANCEMENT] Activity tracker logs now have `module=activity-tracker` label. #3556 * [BUGFIX] Flusher: Add `Overrides` as a dependency to prevent panics when starting with `-target=flusher`. #3151 * [BUGFIX] Updated `golang.org/x/text` dependency to fix CVE-2022-32149. #3285 * [BUGFIX] Query-frontend: properly close gRPC streams to the query-scheduler to stop memory and goroutines leak. #3302 From 309178479e8054227090f8fc4b2b6591f41673ad Mon Sep 17 00:00:00 2001 From: Oleg Zaytsev Date: Tue, 29 Nov 2022 11:58:02 +0100 Subject: [PATCH 3/4] Update pkg/mimir/modules.go Co-authored-by: Marco Pracucci --- pkg/mimir/modules.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/mimir/modules.go b/pkg/mimir/modules.go index 3f559c286e1..7188744ae8c 100644 --- a/pkg/mimir/modules.go +++ b/pkg/mimir/modules.go @@ -133,7 +133,7 @@ func (t *Mimir) initActivityTracker() (services.Service, error) { entries, err := activitytracker.LoadUnfinishedEntries(t.Cfg.ActivityTracker.Filepath) - l := log.With(util_log.Logger, "module", "activity-tracker") + l := log.With(util_log.Logger, "component", "activity-tracker") if err != nil { level.Warn(l).Log("msg", "failed to fully read file with unfinished activities", "err", err) } From 26437454ffdab9bbe1c1931040da5bc0cc55dee5 Mon Sep 17 00:00:00 2001 From: Oleg Zaytsev Date: Tue, 29 Nov 2022 11:58:21 +0100 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cfae90aad4e..c5afc602565 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,7 +30,7 @@ * [ENHANCEMENT] Move the validation of incoming series before the distributor's forwarding functionality, so that we don't forward invalid series. #3386 #3458 * [ENHANCEMENT] S3 bucket configuration now validates that the endpoint does not have the bucket name prefix. #3414 * [ENHANCEMENT] Ruler: Added `ruler.tls-enabled` configuration for alertmanager client. #3432 -* [ENHANCEMENT] Activity tracker logs now have `module=activity-tracker` label. #3556 +* [ENHANCEMENT] Activity tracker logs now have `component=activity-tracker` label. #3556 * [BUGFIX] Flusher: Add `Overrides` as a dependency to prevent panics when starting with `-target=flusher`. #3151 * [BUGFIX] Updated `golang.org/x/text` dependency to fix CVE-2022-32149. #3285 * [BUGFIX] Query-frontend: properly close gRPC streams to the query-scheduler to stop memory and goroutines leak. #3302