Class: Google::Apis::CloudtraceV2::Span
- Inherits:
-
Object
- Object
- Google::Apis::CloudtraceV2::Span
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/cloudtrace_v2/classes.rb,
lib/google/apis/cloudtrace_v2/representations.rb,
lib/google/apis/cloudtrace_v2/representations.rb
Overview
A span represents a single operation within a trace. Spans can be nested to form a trace tree. Often, a trace contains a root span that describes the end- to-end latency, and one or more subspans for its sub-operations. A trace can also contain multiple root spans, or none at all. Spans do not need to be contiguous—there might be gaps or overlaps between spans in a trace.
Instance Attribute Summary collapse
-
#attributes ⇒ Google::Apis::CloudtraceV2::Attributes
A set of attributes as key-value pairs.
-
#child_span_count ⇒ Fixnum
Optional.
-
#display_name ⇒ Google::Apis::CloudtraceV2::TruncatableString
Represents a string that might be shortened to a specified length.
-
#end_time ⇒ String
Required.
-
#links ⇒ Google::Apis::CloudtraceV2::Links
A collection of links, which are references from this span to a span in the same or different trace.
-
#name ⇒ String
Required.
-
#parent_span_id ⇒ String
The
[SPAN_ID]of this span's parent span. -
#same_process_as_parent_span ⇒ Boolean
(also: #same_process_as_parent_span?)
Optional.
-
#span_id ⇒ String
Required.
-
#span_kind ⇒ String
Optional.
-
#stack_trace ⇒ Google::Apis::CloudtraceV2::StackTrace
A call stack appearing in a trace.
-
#start_time ⇒ String
Required.
-
#status ⇒ Google::Apis::CloudtraceV2::Status
The
Statustype defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. -
#time_events ⇒ Google::Apis::CloudtraceV2::TimeEvents
A collection of
TimeEvents.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Span
constructor
A new instance of Span.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Span
Returns a new instance of Span.
383 384 385 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 383 def initialize(**args) update!(**args) end |
Instance Attribute Details
#attributes ⇒ Google::Apis::CloudtraceV2::Attributes
A set of attributes as key-value pairs.
Corresponds to the JSON property attributes
292 293 294 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 292 def attributes @attributes end |
#child_span_count ⇒ Fixnum
Optional. The number of child spans that were generated while this span was
active. If set, allows implementation to detect missing child spans.
Corresponds to the JSON property childSpanCount
298 299 300 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 298 def child_span_count @child_span_count end |
#display_name ⇒ Google::Apis::CloudtraceV2::TruncatableString
Represents a string that might be shortened to a specified length.
Corresponds to the JSON property displayName
303 304 305 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 303 def display_name @display_name end |
#end_time ⇒ String
Required. The end time of the span. On the client side, this is the time kept
by the local machine where the span execution ends. On the server side, this
is the time when the server application handler stops running.
Corresponds to the JSON property endTime
310 311 312 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 310 def end_time @end_time end |
#links ⇒ Google::Apis::CloudtraceV2::Links
A collection of links, which are references from this span to a span in the
same or different trace.
Corresponds to the JSON property links
316 317 318 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 316 def links @links end |
#name ⇒ String
Required. The resource name of the span in the following format: * projects/[
PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID] [TRACE_ID] is a unique
identifier for a trace within a project; it is a 32-character hexadecimal
encoding of a 16-byte array. It should not be zero. [SPAN_ID] is a unique
identifier for a span within a trace; it is a 16-character hexadecimal
encoding of an 8-byte array. It should not be zero. .
Corresponds to the JSON property name
326 327 328 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 326 def name @name end |
#parent_span_id ⇒ String
The [SPAN_ID] of this span's parent span. If this is a root span, then this
field must be empty.
Corresponds to the JSON property parentSpanId
332 333 334 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 332 def parent_span_id @parent_span_id end |
#same_process_as_parent_span ⇒ Boolean Also known as: same_process_as_parent_span?
Optional. Set this parameter to indicate whether this span is in the same
process as its parent. If you do not set this parameter, Trace is unable to
take advantage of this helpful information.
Corresponds to the JSON property sameProcessAsParentSpan
339 340 341 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 339 def same_process_as_parent_span @same_process_as_parent_span end |
#span_id ⇒ String
Required. The [SPAN_ID] portion of the span's resource name.
Corresponds to the JSON property spanId
345 346 347 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 345 def span_id @span_id end |
#span_kind ⇒ String
Optional. Distinguishes between spans generated in a particular context. For
example, two spans with the same name may be distinguished using CLIENT (
caller) and SERVER (callee) to identify an RPC call.
Corresponds to the JSON property spanKind
352 353 354 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 352 def span_kind @span_kind end |
#stack_trace ⇒ Google::Apis::CloudtraceV2::StackTrace
A call stack appearing in a trace.
Corresponds to the JSON property stackTrace
357 358 359 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 357 def stack_trace @stack_trace end |
#start_time ⇒ String
Required. The start time of the span. On the client side, this is the time
kept by the local machine where the span execution starts. On the server side,
this is the time when the server's application handler starts running.
Corresponds to the JSON property startTime
364 365 366 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 364 def start_time @start_time end |
#status ⇒ Google::Apis::CloudtraceV2::Status
The Status type defines a logical error model that is suitable for different
programming environments, including REST APIs and RPC APIs. It is used by
gRPC. Each Status message contains three pieces of
data: error code, error message, and error details. You can find out more
about this error model and how to work with it in the API Design Guide.
Corresponds to the JSON property status
374 375 376 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 374 def status @status end |
#time_events ⇒ Google::Apis::CloudtraceV2::TimeEvents
A collection of TimeEvents. A TimeEvent is a time-stamped annotation on
the span, consisting of either user-supplied key:value pairs, or details of a
message sent/received between Spans.
Corresponds to the JSON property timeEvents
381 382 383 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 381 def time_events @time_events end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 |
# File 'lib/google/apis/cloudtrace_v2/classes.rb', line 388 def update!(**args) @attributes = args[:attributes] if args.key?(:attributes) @child_span_count = args[:child_span_count] if args.key?(:child_span_count) @display_name = args[:display_name] if args.key?(:display_name) @end_time = args[:end_time] if args.key?(:end_time) @links = args[:links] if args.key?(:links) @name = args[:name] if args.key?(:name) @parent_span_id = args[:parent_span_id] if args.key?(:parent_span_id) @same_process_as_parent_span = args[:same_process_as_parent_span] if args.key?(:same_process_as_parent_span) @span_id = args[:span_id] if args.key?(:span_id) @span_kind = args[:span_kind] if args.key?(:span_kind) @stack_trace = args[:stack_trace] if args.key?(:stack_trace) @start_time = args[:start_time] if args.key?(:start_time) @status = args[:status] if args.key?(:status) @time_events = args[:time_events] if args.key?(:time_events) end |