Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,13 +606,23 @@ var (
[]string{teleport.TagRoles, teleport.TagResources},
)

userCertificatesGeneratedMetric = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: teleport.MetricNamespace,
Name: teleport.MetricUserCertificatesGenerated,
Help: "Tracks the number of user certificates generated",
},
[]string{teleport.TagPrivateKeyPolicy},
)

prometheusCollectors = []prometheus.Collector{
generateRequestsCount, generateThrottledRequestsCount,
generateRequestsCurrent, generateRequestsLatencies, UserLoginCount, heartbeatsMissedByAuth,
registeredAgents, migrations,
totalInstancesMetric, enrolledInUpgradesMetric, upgraderCountsMetric,
accessRequestsCreatedMetric,
registeredAgentsInstallMethod,
userCertificatesGeneratedMetric,
}
)

Expand Down Expand Up @@ -2620,6 +2630,8 @@ func generateCert(a *Server, req certRequest, caType types.CertAuthType) (*proto

a.submitCertificateIssuedEvent(&req)

userCertificatesGeneratedMetric.WithLabelValues(string(attestedKeyPolicy)).Inc()

return certs, nil
}

Expand Down
5 changes: 5 additions & 0 deletions metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ const (
TagRoles = "roles"
// TagResources is a number of resources requested as a part of access request.
TagResources = "resources"

// UserCertificatesCreated provides total number of user certificates generated.
MetricUserCertificatesGenerated = "user_certificates_generated"
// TagPrivateKeyPolicy is a private key policy associated with a user's certificates.
TagPrivateKeyPolicy = "private_key_policy"
)

const (
Expand Down