Class: Google::Apis::ServicecontrolV1::TraceSpan

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/servicecontrol_v1/classes.rb,
lib/google/apis/servicecontrol_v1/representations.rb,
lib/google/apis/servicecontrol_v1/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 may be gaps or overlaps between spans in a trace.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ TraceSpan

Returns a new instance of TraceSpan.



2632
2633
2634
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2632

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#attributesGoogle::Apis::ServicecontrolV1::Attributes

A set of attributes, each in the format [KEY]:[VALUE]. Corresponds to the JSON property attributes



2560
2561
2562
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2560

def attributes
  @attributes
end

#child_span_countFixnum

An optional 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

Returns:

  • (Fixnum)


2566
2567
2568
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2566

def child_span_count
  @child_span_count
end

#display_nameGoogle::Apis::ServicecontrolV1::TruncatableString

Represents a string that might be shortened to a specified length. Corresponds to the JSON property displayName



2571
2572
2573
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2571

def display_name
  @display_name
end

#end_timeString

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

Returns:

  • (String)


2578
2579
2580
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2578

def end_time
  @end_time
end

#nameString

The resource name of the span in the following format: projects/[PROJECT_ID]/ traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. [ SPAN_ID] is a unique identifier for a span within a trace; it is a 16- character hexadecimal encoding of an 8-byte array. Corresponds to the JSON property name

Returns:

  • (String)


2587
2588
2589
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2587

def name
  @name
end

#parent_span_idString

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

Returns:

  • (String)


2593
2594
2595
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2593

def parent_span_id
  @parent_span_id
end

#same_process_as_parent_spanBoolean 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, Stackdriver Trace is unable to take advantage of this helpful information. Corresponds to the JSON property sameProcessAsParentSpan

Returns:

  • (Boolean)


2600
2601
2602
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2600

def same_process_as_parent_span
  @same_process_as_parent_span
end

#span_idString

The [SPAN_ID] portion of the span's resource name. Corresponds to the JSON property spanId

Returns:

  • (String)


2606
2607
2608
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2606

def span_id
  @span_id
end

#span_kindString

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

Returns:

  • (String)


2613
2614
2615
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2613

def span_kind
  @span_kind
end

#start_timeString

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

Returns:

  • (String)


2620
2621
2622
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2620

def start_time
  @start_time
end

#statusGoogle::Apis::ServicecontrolV1::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



2630
2631
2632
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2630

def status
  @status
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
# File 'lib/google/apis/servicecontrol_v1/classes.rb', line 2637

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)
  @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)
  @start_time = args[:start_time] if args.key?(:start_time)
  @status = args[:status] if args.key?(:status)
end