Record latency of validation instead of request/response time (#3879)
Fixes #3862.
This commit is contained in:
parent
97d1788a18
commit
15ccea65f7
15
va/va.go
15
va/va.go
|
@ -185,8 +185,7 @@ type verificationRequestEvent struct {
|
|||
Hostname string `json:",omitempty"`
|
||||
ValidationRecords []core.ValidationRecord `json:",omitempty"`
|
||||
Challenge core.Challenge `json:",omitempty"`
|
||||
RequestTime time.Time `json:",omitempty"`
|
||||
ResponseTime time.Time `json:",omitempty"`
|
||||
ValidationLatency time.Duration `json:",omitempty"`
|
||||
Error string `json:",omitempty"`
|
||||
}
|
||||
|
||||
|
@ -1034,10 +1033,9 @@ func (va *ValidationAuthorityImpl) performRemoteValidation(ctx context.Context,
|
|||
// validation records, even when it also returns an error.
|
||||
func (va *ValidationAuthorityImpl) PerformValidation(ctx context.Context, domain string, challenge core.Challenge, authz core.Authorization) ([]core.ValidationRecord, error) {
|
||||
logEvent := verificationRequestEvent{
|
||||
ID: authz.ID,
|
||||
Requester: authz.RegistrationID,
|
||||
Hostname: domain,
|
||||
RequestTime: va.clk.Now(),
|
||||
ID: authz.ID,
|
||||
Requester: authz.RegistrationID,
|
||||
Hostname: domain,
|
||||
}
|
||||
vStart := va.clk.Now()
|
||||
|
||||
|
@ -1081,11 +1079,14 @@ func (va *ValidationAuthorityImpl) PerformValidation(ctx context.Context, domain
|
|||
|
||||
logEvent.Challenge = challenge
|
||||
|
||||
validationLatency := time.Since(vStart)
|
||||
logEvent.ValidationLatency = validationLatency
|
||||
|
||||
va.metrics.validationTime.With(prometheus.Labels{
|
||||
"type": string(challenge.Type),
|
||||
"result": string(challenge.Status),
|
||||
"problemType": problemType,
|
||||
}).Observe(time.Since(vStart).Seconds())
|
||||
}).Observe(validationLatency.Seconds())
|
||||
|
||||
va.log.AuditObject("Validation result", logEvent)
|
||||
va.log.Infof("Validations: %+v", authz)
|
||||
|
|
Loading…
Reference in New Issue