Connectum API Reference / @connectum/otel / shared / buildErrorAttributes
Function: buildErrorAttributes() ​
buildErrorAttributes(
error):Record<string,string>
Defined in: shared.ts:179
Builds error-specific attributes for spans and metrics.
For ConnectError instances, error.type and rpc.response.status_code both carry the Connect error-code name (the convention asks error.type to be the status code). For generic Error instances, records the error constructor name as error.type only. For unknown error types, records "UNKNOWN".
Parameters ​
error ​
unknown
The caught error
Returns ​
Record<string, string>
Record of error attributes to attach to spans/metrics