跟踪 span 属性和事件

客户端跟踪记录通过执行 RPC 收集,为客户端的每个请求提供多条信息,包括包含客户端发送 RPC 请求的时间和客户端收到 RPC 响应的时间的时间戳的 span。这些 span 包含网络和客户端系统造成的延迟。

客户端跟踪记录可以包含以下信息:

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 字符串
数据库外部 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 double
gcp.firestore.settings.retrySettings.rpc_timeout_multiplier double
gcp.firestore.settings.retrySettings.total_timeout 字符串
时长(以秒为单位)
OpenTelemetry 配置
otel.scope.name 字符串,例如 "com.google.cloud.firestore"
service.name 炸毛仔
telemetry.sdk.language 字符串,例如 “java”
telemetry.sdk.name opentelemetry
telemetry.sdk.version 例如:1.29.0

日志和事件

客户端跟踪记录提供以下日志和事件。

gRPC 事件

RPC 属性
message.id 整数,例如 1、2
message.type SENT 或 RECEIVED

AggregateQuery 事件

事件:“RunAggregationQuery Stream Started.”
尝试 大于或等于 0 的整数(例如:2)。初始尝试为 0
事件:“RunAggregationQuery Response Received.”
尝试 大于或等于 0 的整数(例如:2)。初始尝试为 0
事件:“RunAggregationQuery: Retryable Error.”
error.message 字符串
事件:“RunAggregationQuery: Error.”
error.message 字符串

BatchGetDocuments 事件

事件:“BatchGetDocuments: Start”
doc_count 整数
transactional 布尔值
事件:“BatchGetDocuments: First Response Received”
// 每收到 100 个响应后触发一次
事件:“BatchGetDocuments: Received 100 responses”
事件:“BatchGetDocuments: Completed with ${N} responses”
response_count 整数

RunQuery 事件

事件:“RunQuery”
transactional 布尔值
retry_query_with_cursor 布尔值
事件:“RunQuery: First Response Received”
// 每收到 100 个响应后触发一次
事件:“RunQuery: Received 100 documents”
// 仅当服务器执行半关闭时触发
事件:"RunQuery: Received RunQueryResponse.Done"
事件:“RunQuery: Retryable Error.”
error.message 字符串
事件:“RunQuery: Error.”
error.message 字符串
事件:“RunQuery: Completed.”
response_count 整数

交易事件

span:“Transaction.Run”
transaction_type 字符串(“READ_ONLY”或“READ_WRITE”)
attempts_allowed 整数
attempts_remaining 整数
// 仅当重试交易时触发
事件:“Initiate transaction retry”

提交事件

span:“BulkWriter.Commit”
doc_count 整数
span:“Batch.Commit”
doc_count 整数
span:“Transaction.Commit”
doc_count 整数

异常事件

span 状态 = ERROR
exception.message 字符串
exception.type 字符串
exception.stacktrace 字符串