Add tracing manifests and docs; clean up branch lint findings
Manager env block (downward-API resource attrs, commented OTLP examples), architecture §10 + Decisions entries, README section. Lint: goconst constants, gofmt, logcheck (Setup now takes its logger from ctx via logf.FromContext). Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -50,17 +50,25 @@ func (i *instrumented) record(op string, err error) {
|
||||
i.rec.ProviderRequest(i.name, op, resultLabel(err))
|
||||
}
|
||||
|
||||
const (
|
||||
resultOK = "ok"
|
||||
resultNotFound = "not_found"
|
||||
resultQuotaExceeded = "quota_exceeded"
|
||||
resultPermanent = "permanent"
|
||||
resultTransient = "transient"
|
||||
)
|
||||
|
||||
func resultLabel(err error) string {
|
||||
switch Class(err) {
|
||||
case nil:
|
||||
return "ok"
|
||||
return resultOK
|
||||
case ErrNotFound:
|
||||
return "not_found"
|
||||
return resultNotFound
|
||||
case ErrQuotaExceeded:
|
||||
return "quota_exceeded"
|
||||
return resultQuotaExceeded
|
||||
case ErrPermanent:
|
||||
return "permanent"
|
||||
return resultPermanent
|
||||
default:
|
||||
return "transient"
|
||||
return resultTransient
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user