GraphQL 服务器 Span 的语义约定
状态: 开发中
状态:
此 Span 表示 GraphQL 服务器实现上的一个入站操作。
Span 名称 应为 {graphql.operation.type} 格式,前提是 graphql.operation.type 可用。如果 graphql.operation.type 不可用,Span 应命名为 GraphQL Operation。
警告
graphql.operation.name值由客户端提供,可能具有高基数性。不建议(默认情况下)在 GraphQL 服务器 Span 名称中使用它。Instrumentation 可以提供一个配置选项,以便在
graphql.operation.name可用时,采用{graphql.operation.type} {graphql.operation.name}格式实现更具描述性的 Span 名称。
Span kind 应为 SERVER。
**Span 状态**应遵循 记录错误文档。
Attributes
| 键 | Stability | 需求级别 | Value Type | 描述 | Example Values |
|---|---|---|---|---|---|
graphql.document | 推荐 | 字符串 | 正在执行的 GraphQL 文档。 [1] | query findBookById { bookById(id: ?) { name } } | |
graphql.operation.name | 推荐 | 字符串 | 正在执行的操作的名称。 | findBookById | |
graphql.operation.type | 推荐 | 字符串 | 正在执行的操作的类型。 | query; mutation; subscription |
[1] graphql.document: 该值可能会被清理以排除敏感信息。
graphql.operation.type 具有以下已知值列表。如果其中一个适用,则必须使用相应的值;否则,可以改用自定义值。
| 值 | 描述 | Stability |
|---|---|---|
mutation | GraphQL mutation | |
query | GraphQL query | |
subscription | GraphQL subscription |