-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Spec https://opentelemetry.io/docs/specs/semconv/http/http-spans/ says
[5] error.type: If the request fails with an error before response status code was sent or received, error.type SHOULD be set to exception type (its fully-qualified class name, if applicable) or a component-specific low cardinality error identifier.
If response status code was sent or received and status indicates an error according to HTTP span status definition, error.type SHOULD be set to the status code number (represented as a string), an exception type (if thrown) or a component-specific error identifier.
The error.type value SHOULD be predictable and SHOULD have low cardinality. Instrumentations SHOULD document the list of errors they report.
The cardinality of error.type within one instrumentation library SHOULD be low, but telemetry consumers that aggregate data from multiple instrumentation libraries and applications should be prepared for error.type to have high cardinality at query time, when no additional filters are applied.
Relates to this place:
Lines 217 to 224 in a9468a6
| err := next(c) | |
| if err != nil { | |
| span.SetAttributes(semconv.ErrorType(err)) | |
| span.SetStatus(codes.Error, err.Error()) | |
| if config.OnNextError != nil { | |
| config.OnNextError(c, err) | |
| } | |
| } |