Trace span 属性和事件
客户端跟踪记录通过执行 RPC 收集,可为来自客户端的每个请求提供多项信息,包括包含时间戳的 span,其中记录了客户端发送 RPC 请求的时间和客户端收到 RPC 响应的时间。Span 包含网络和客户端系统造成的延迟。
客户端跟踪记录可以包含以下信息:
span ID |
相应 span 的唯一 ID |
父级 Span ID |
父 span 的 ID,对于根 span 未设置 |
项目 ID |
Google Cloud 提取轨迹的项目 ID |
开始时间 |
Span 开始时间 |
结束时间 |
Span 结束时间 |
Span 属性
客户端版本 |
otel.scope.version |
字符串 |
客户端环境 |
gcp.firestore.memory_utilization |
double(百分比) |
客户端连接属性 |
gcp.firestore.settings.channel.needs_credentials |
布尔值 |
gcp.firestore.settings.channel.needs_endpoint |
布尔值 |
gcp.firestore.settings.channel.needs_headers |
布尔值 |
gcp.firestore.settings.channel.should_auto_close |
布尔值 |
gcp.firestore.settings.channel.transport_name |
字符串示例。“grpc” |
gcp.firestore.settings.credentials.authentication_type |
字符串示例。“OAuth2” |
gcp.firestore.settings.host |
字符串示例。“firestore.googleapis.com:443” |
数据库属性 |
gcp.firestore.settings.project_id |
字符串
Google Cloud 包含 Firestore 数据库的项目 ID |
gcp.firestore.settings.database_id |
string
数据库外部 ID(名称) |
客户端 RPC 重试设置 |
gcp.firestore.settings.retrySettings.initial_retry_delay |
字符串
时长(以秒为单位)。示例:0.01 秒 |
gcp.firestore.settings.retrySettings.initial_rpc_timeout |
gcp.firestore.settings.retrySettings.max_attempts |
整数(数量) |
gcp.firestore.settings.retrySettings.max_retry_delay |
字符串
时长(以秒为单位)。示例:0.1 秒 |
gcp.firestore.settings.retrySettings.max_rpc_timeout |
gcp.firestore.settings.retrySettings.retry_delay_multiplier |
双精度 |
gcp.firestore.settings.retrySettings.rpc_timeout_multiplier |
双精度 |
gcp.firestore.settings.retrySettings.total_timeout |
字符串
时长(以秒为单位) |
OpenTelemetry 配置 |
otel.scope.name |
字符串示例。"com.google.cloud.firestore" |
service.name |
Sparky |
telemetry.sdk.language |
字符串示例。“java” |
telemetry.sdk.name |
opentelemetry |
telemetry.sdk.version |
例如:1.29.0 |
日志和事件
客户端轨迹提供以下日志和事件。
gRPC 事件
RPC 属性 |
message.id |
整数,例如 1、2 |
message.type |
已发送或已接收 |
AggregateQuery 事件
事件:“RunAggregationQuery 流已启动。” |
尝试 |
大于或等于 0 的整数(例如:2)。0 表示初始尝试 |
事件:“收到了 RunAggregationQuery 响应。” |
尝试 |
大于或等于 0 的整数(例如:2)。0 表示初始尝试 |
事件:“RunAggregationQuery:可重试的错误。” |
error.message |
字符串 |
事件:“RunAggregationQuery:错误。” |
error.message |
字符串 |
BatchGetDocuments 事件
事件:“BatchGetDocuments:开始” |
doc_count |
整数 |
transactional |
布尔值 |
事件:“BatchGetDocuments:已收到第一个响应” |
// 每当收到 100 个响应时
事件:“BatchGetDocuments:已收到 100 个响应” |
事件:“BatchGetDocuments:已完成,包含 ${N} 个响应” |
response_count |
整数 |
RunQuery 事件
事件:“RunQuery” |
transactional |
布尔值 |
retry_query_with_cursor |
布尔值 |
// 每收到 100 个响应时触发一次
事件:“RunQuery:已收到 100 个文档” |
// 仅当服务器执行半关闭时
事件:“RunQuery:已收到 RunQueryResponse.Done” |
事件:“RunQuery:可重试的错误。” |
error.message |
字符串 |
事件:“RunQuery:错误。” |
error.message |
字符串 |
事件:“RunQuery:已完成。” |
response_count |
整数 |
交易事件
Span: "Transaction.Run" |
transaction_type |
字符串(“READ_ONLY”或“READ_WRITE”) |
attempts_allowed |
整数 |
attempts_remaining |
整数 |
提交事件
Span: "BulkWriter.Commit" |
doc_count |
整数 |
Span: "Batch.Commit" |
doc_count |
整数 |
Span: "Transaction.Commit" |
doc_count |
整数 |
特殊事件
Span Status = ERROR |
exception.message |
字符串 |
exception.type |
字符串 |
exception.stacktrace |
字符串 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-10-22。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-10-22。"],[],[]]