Cloud Trace API - Module Google::Cloud::Trace::LabelKey (v0.43.0)

Reference documentation and code samples for the Cloud Trace API module Google::Cloud::Trace::LabelKey.

A collection of well-known label keys for trace spans.

Methods

.set_stack_trace

def self.set_stack_trace(labels, stack_frames: nil, skip_frames: 1, truncate_stack: nil, filter_stack: nil)

Set the stack trace label in the given labels hash. The current call stack is formatted so the Stackdriver UI will display it.

Parameters
  • labels (Hash) — The labels hash in which to set the stack trace label value.
  • stack_frames (Array<Thread::Backtrace::Location>) (defaults to: nil) — The current caller stack as returned from ::Kernel.caller_locations. If not set, ::Kernel.caller_locations is called internally.
  • skip_frames (Integer) (defaults to: 1) — Passed to the internal invocation of ::Kernel.caller_locations if one is needed.
  • truncate_stack (Proc) (defaults to: nil) — A procedure that allows skipping of the "topmost" stack frames. Stack frames, represented by instances of Thread::Backtrace::Location, are passed to this proc beginning with the topmost frame. As long as the proc returns a falsy value, those frames are dropped. Once the proc returns true for the first time, that frame and all remaining frames (possibly subject to filter_stack) are used. If not set, no frames are skipped.
  • filter_stack (Proc) (defaults to: nil) — A procedure that allows skipping of stack frames in the middle of the stack trace. After possibly skipping frames using truncate_stack, all remaining frames are passed to this proc as Thread::Backtrace::Location objects. Those for whom the proc returns a falsy value are skipped. If this parameter is not set, no filtering is done and all frames are presented in the stack trace.
Example
require "google/cloud/trace"

trace_record = Google::Cloud::Trace::TraceRecord.new "my-project"
span = trace_record.create_span "root_span"
Google::Cloud::Trace::LabelKey.set_stack_trace span.labels

Constants

AGENT

value: "/agent".freeze

COMPONENT

value: "/component".freeze

ERROR_MESSAGE

value: "/error/message".freeze

ERROR_NAME

value: "/error/name".freeze

HTTP_CLIENT_CITY

value: "/http/client_city".freeze

HTTP_CLIENT_COUNTRY

value: "/http/client_country".freeze

HTTP_CLIENT_PROTOCOL

value: "/http/client_protocol".freeze

HTTP_CLIENT_REGION

value: "/http/client_region".freeze

HTTP_HOST

value: "/http/host".freeze

HTTP_METHOD

value: "/http/method".freeze

HTTP_REDIRECTED_URL

value: "/http/redirected_url".freeze

HTTP_REQUEST_SIZE

value: "/http/request/size".freeze

HTTP_RESPONSE_SIZE

value: "/http/response/size".freeze

HTTP_STATUS_CODE

value: "/http/status_code".freeze

HTTP_URL

value: "/http/url".freeze

HTTP_USER_AGENT

value: "/http/user_agent".freeze

PID

value: "/pid".freeze

STACKTRACE

value: "/stacktrace".freeze

TID

value: "/tid".freeze

GAE_APPLICATION_ERROR

value: "g.co/gae/application_error".freeze

GAE_APP_MODULE

value: "g.co/gae/app/module".freeze

GAE_APP_MODULE_VERSION

value: "g.co/gae/app/module_version".freeze

GAE_APP_VERSION

value: "g.co/gae/app/version".freeze

GAE_DATASTORE_COUNT

value: "g.co/gae/datastore/count".freeze

GAE_DATASTORE_CURSOR

value: "g.co/gae/datastore/cursor".freeze

GAE_DATASTORE_ENTITY_WRITES

value: "g.co/gae/datastore/entity_writes".freeze

GAE_DATASTORE_HAS_ANCESTOR

value: "g.co/gae/datastore/has_ancestor".freeze

GAE_DATASTORE_HAS_CURSOR

value: "g.co/gae/datastore/has_cursor".freeze

GAE_DATASTORE_HAS_TRANSACTION

value: "g.co/gae/datastore/has_transaction".freeze

GAE_DATASTORE_INDEX_WRITES

value: "g.co/gae/datastore/index_writes".freeze

GAE_DATASTORE_KIND

value: "g.co/gae/datastore/kind".freeze

GAE_DATASTORE_LIMIT

value: "g.co/gae/datastore/limit".freeze

GAE_DATASTORE_MORE_RESULTS

value: "g.co/gae/datastore/more_results".freeze

GAE_DATASTORE_OFFSET

value: "g.co/gae/datastore/offset".freeze

GAE_DATASTORE_REQUESTED_ENTITY_DELETES

value: "g.co/gae/datastore/requested_entity_deletes".freeze

GAE_DATASTORE_REQUESTED_ENTITY_PUTS

value: "g.co/gae/datastore/requested_entity_puts".freeze

GAE_DATASTORE_SIZE

value: "g.co/gae/datastore/size".freeze

GAE_DATASTORE_SKIPPED

value: "g.co/gae/datastore/skipped".freeze

GAE_DATASTORE_TRANSACTION_HANDLE

value: "g.co/gae/datastore/transaction_handle".freeze

GAE_ERROR_MESSAGE

value: "g.co/gae/error_message".freeze

GAE_MEMCACHE_COUNT

value: "g.co/gae/memcache/count".freeze

GAE_MEMCACHE_SIZE

value: "g.co/gae/memcache/size".freeze

GAE_REQUEST_LOG_ID

value: "g.co/gae/request_log_id".freeze

RPC_HOST

value: "/rpc/host".freeze

RPC_REQUEST_TYPE

value: "/rpc/request/type".freeze

RPC_REQUEST_SIZE

value: "/rpc/request/size".freeze

RPC_RESPONSE_SIZE

value: "/rpc/response/size".freeze

RPC_STATUS_CODE

value: "/rpc/status_code".freeze