追蹤追蹤記錄範圍屬性和事件

用戶端追蹤記錄是透過執行 RPC 收集,可提供用戶端每個要求的幾項資訊,包括時間戳記的範圍,指出用戶端傳送 RPC 要求的時間,以及用戶端收到 RPC 回應的時間。這些範圍包括網路和用戶端系統造成的延遲。

用戶端追蹤記錄可能包含下列資訊:

時距中繼資料

時距 ID 這個範圍的專屬 ID
父項時距 ID 父項時距的 ID,根時距則未設定
專案 ID Google Cloud 擷取追蹤記錄的專案 ID
開始時間 時距開始時間
結束時間 時距結束時間

範圍屬性

用戶端版本
otel.scope.version 字串
用戶端環境
gcp.firestore.memory_utilization 雙倍 (百分比)
用戶端連線屬性
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 雙精度值
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 Stream Started」。
嘗試 大於或等於 0 的整數 (例如:2)。初始嘗試為 0
事件:「已收到 RunAggregationQuery 回應」。
嘗試 大於或等於 0 的整數 (例如:2)。初始嘗試為 0
事件:「RunAggregationQuery: Retryable Error.」
error.message 字串
事件:「RunAggregationQuery:錯誤。」
error.message 字串

BatchGetDocuments 事件

事件:「BatchGetDocuments: Start」
doc_count 整數
transactional 布林值
事件:「BatchGetDocuments: First Response Received」
// Once every 100 responses are received
Event: "BatchGetDocuments: Received 100 responses"
事件:「BatchGetDocuments: Completed with ${N} responses」(BatchGetDocuments:已完成,並傳回 ${N} 個回應)
response_count 整數

RunQuery 事件

事件:「RunQuery」
transactional 布林值
retry_query_with_cursor 布林值
事件:「RunQuery: First Response Received」
// Once every 100 responses are received
Event: "RunQuery: Received 100 documents"
// Only if/when half-close is performed by the server
Event: "RunQuery: Received RunQueryResponse.Done"
事件:「RunQuery: Retryable Error」(RunQuery:可重試的錯誤)。
error.message 字串
事件:「RunQuery: Error.」(RunQuery:錯誤。)
error.message 字串
事件:「RunQuery: Completed.」(RunQuery:已完成)。
response_count 整數

交易事件

範圍:「Transaction.Run」
transaction_type 字串 (「READ_ONLY」或「READ_WRITE」)
attempts_allowed 整數
attempts_remaining 整數
// Only if/when a transaction is retried
Event: "Initiate transaction retry"

提交事件

範圍:「BulkWriter.Commit」
doc_count 整數
範圍:「Batch.Commit」
doc_count 整數
範圍:「Transaction.Commit」
doc_count 整數

特殊活動

時距狀態 = ERROR
exception.message 字串
exception.type 字串
exception.stacktrace 字串