diff --git a/vault/token_store.go b/vault/token_store.go index faf626d088e5..bdb26c81ed53 100644 --- a/vault/token_store.go +++ b/vault/token_store.go @@ -774,6 +774,9 @@ func (ts *TokenStore) create(ctx context.Context, entry *logical.TokenEntry) err } entry.Policies = policyutil.SanitizePolicies(entry.Policies, policyutil.DoNotAddDefaultPolicy) + if len(entry.Policies) == 1 && entry.Policies[0] == "root" { + metrics.IncrCounter([]string{"token", "create-root"}, 1) + } switch entry.Type { case logical.TokenTypeDefault, logical.TokenTypeService: