Error
Error Attributes
This document defines the shared attributes used to report an error.
Attributes
| 键 | Stability | Value Type | 描述 | Example Values |
|---|---|---|---|---|
error.message | 字符串 | A message providing more detail about an error in human-readable form. [1] | Unexpected input type: string; The user has exceeded their storage quota | |
error.type | 字符串 | 描述操作结束时发生的错误类型。[2] | timeout;java.net.UnknownHostException;server_certificate_invalid;500 |
[1] error.message: error.message should provide additional context and detail about an error. It is NOT RECOMMENDED to duplicate the value of error.type in error.message. It is also NOT RECOMMENDED to duplicate the value of exception.message in error.message.
error.message is NOT RECOMMENDED for metrics or spans due to its unbounded cardinality and overlap with span status.
[2] error.type: error.type 应可预测且具有低基数。
当 error.type 设置为某个类型(例如,异常类型)时,应该使用该工件内识别类型的规范类名。
Instrumentations 应该记录它们报告的错误列表。
一个仪器库内的 error.type 基数性应该低。从多个仪器库和应用程序聚合数据的遥测消费者,在没有额外过滤时,应准备好 error.type 在查询时具有高基数性。
如果操作已成功完成,Instrumentations 不应设置 error.type。
如果特定域定义了自己的一组错误标识符(例如 HTTP 或 gRPC 状态码),则建议
- 使用特定于域的属性
- 设置
error.type以捕获所有错误,无论它们是否包含在特定于域的集合中。
error.type 具有以下已知值列表。如果其中一个适用,则必须使用相应的值;否则,可以使用自定义值。
| 值 | 描述 | Stability |
|---|---|---|
_OTHER | 当检测不到自定义值时使用的回退错误值。 |