Record latency of validation instead of request/response time (#3879)

Fixes #3862.
This commit is contained in:
Roland Bracewell Shoemaker 2018-10-05 10:59:53 -04:00 committed by GitHub
parent 97d1788a18
commit 15ccea65f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -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)