From d641bbc28e5e8cc12b81d409e5d5fc1f2cb7f66c Mon Sep 17 00:00:00 2001 From: Josh Black Date: Mon, 9 Jan 2023 15:26:11 -0800 Subject: [PATCH] Add new clients into the monthly breakdown (#18629) * Add new clients into the monthly breakdown * add changelog --- changelog/18629.txt | 3 +++ vault/activity_log.go | 1 + 2 files changed, 4 insertions(+) create mode 100644 changelog/18629.txt diff --git a/changelog/18629.txt b/changelog/18629.txt new file mode 100644 index 000000000000..50743b3916f1 --- /dev/null +++ b/changelog/18629.txt @@ -0,0 +1,3 @@ +```release-note:bug +core/activity: add namespace breakdown for new clients when date range spans multiple months, including the current month. +``` diff --git a/vault/activity_log.go b/vault/activity_log.go index 3c4bc613da26..d89f7599baf9 100644 --- a/vault/activity_log.go +++ b/vault/activity_log.go @@ -1664,6 +1664,7 @@ func (a *ActivityLog) handleQuery(ctx context.Context, startTime, endTime time.T a.logger.Warn("no month data found, returning query with no namespace attribution for current month") } else { currentMonth.Namespaces = currentMonthNamespaceAttribution[0].Namespaces + currentMonth.NewClients = currentMonthNamespaceAttribution[0].NewClients } pq.Months = append(pq.Months, currentMonth) distinctEntitiesResponse += pq.Months[len(pq.Months)-1].NewClients.Counts.EntityClients