Skip to content

Commit

Permalink
Merge pull request #136 from uselagoon/fix-coverage
Browse files Browse the repository at this point in the history
feat: rename metrics to avoid duplicate names
  • Loading branch information
smlx authored Nov 16, 2022
2 parents 9a2ef2d + 9e891b3 commit bb28a7f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion internal/sshportalapi/sshportal.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type SSHAccessQuery struct {
var (
requestsCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "sshportalapi_requests_total",
Help: "The total number of requests received",
Help: "The total number of ssh-portal-api requests received",
})
)

Expand Down
8 changes: 4 additions & 4 deletions internal/sshserver/authhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ var (

var (
authAttemptsTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "authentication_attempts_total",
Help: "The total number of authentication attempts",
Name: "sshportal_authentication_attempts_total",
Help: "The total number of ssh-portal authentication attempts",
})
authSuccessTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "authentication_success_total",
Help: "The total number of successful authentication",
Name: "sshportal_authentication_success_total",
Help: "The total number of successful ssh-portal authentications",
})
)

Expand Down
4 changes: 2 additions & 2 deletions internal/sshserver/sessionhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (

var (
sessionTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "session_total",
Help: "The total number of ssh sessions started",
Name: "sshportal_sessions_total",
Help: "The total number of ssh-portal sessions started",
})
)

Expand Down
10 changes: 5 additions & 5 deletions internal/sshtoken/authhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ type LagoonDBService interface {

var (
authnAttemptsTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "authentication_attempts_total",
Help: "The total number of authentication attempts",
Name: "sshtoken_authentication_attempts_total",
Help: "The total number of ssh-token authentication attempts",
})
authnSuccessTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "authentication_success_total",
Help: "The total number of successful authentication attempts",
Name: "sshtoken_authentication_success_total",
Help: "The total number of successful ssh-token authentications",
})
authnAttemptsNonLagoonUser = promauto.NewCounter(prometheus.CounterOpts{
Name: "authentication_attempts_non_lagoon_user",
Name: "sshtoken_authentication_attempts_non_lagoon_user",
Help: "The total number of failed authentication attempts with a user other than lagoon",
})
)
Expand Down
8 changes: 4 additions & 4 deletions internal/sshtoken/sessionhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ type KeycloakService interface {

var (
sessionTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "session_total",
Help: "The total number of ssh sessions started",
Name: "sshtoken_sessions_total",
Help: "The total number of ssh-token sessions started",
})
tokensGeneratedTotal = promauto.NewCounter(prometheus.CounterOpts{
Name: "tokens_generated_total",
Help: "The total number of Lagoon authentication tokens generated",
Name: "sshtoken_tokens_generated_total",
Help: "The total number of ssh-token user access tokens generated",
})
)

Expand Down

0 comments on commit bb28a7f

Please sign in to comment.