-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
VAULT-17555: Secret sync client metrics #25713
Conversation
CI Results: |
Build Results: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM to the extent that I understand the details of secret sync and client counts and this code in particular (which is not very large!). I don't see any obvious logical errors or issues other than the optional bike-shed comment inline!
vault/activity_log.go
Outdated
a.metrics.SetGauge([]string{"identity", strings.ReplaceAll(clientType, "-", ""), "active", "monthly"}, float32(count)) | ||
} | ||
for clientType, count := range summedMetricsReporting { | ||
a.metrics.SetGauge([]string{"identity", strings.ReplaceAll(clientType, "-", ""), "active", "reporting_period"}, float32(count)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you consider substituting _
for rather than removing hyphens? I think our metrics often (though probably not consistentlty) use underscores for multi-word terms -- for example reporting_period
in the same metric name here. I have a very gentle preference towards identity.non_entity.active.reporting_period
rather than identity.nonentity.active.reporting_period
on consistency grounds. But not a big deal if you disagree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also prefer underscores. We already have the metric nonentity
and so I was trying to make secret syncs follow the same pattern, but there's no reason why it needs to. I'll change it.
This PR refactors the metrics reporting from the activity log to move it to a separate function. I've also added a test and two new metrics for secret sync.
The documentation for the new metrics will be in a separate PR, along with the rest of the secret sync client count documentation.