Class: OpenCensus::Trace::Link

Inherits:
Object
  • Object
show all
Defined in:
lib/opencensus/trace/link.rb

Overview

A pointer from the current span to another span in the same trace or in a different trace. For example, this can be used in batching operations, where a single batch handler processes multiple requests from different traces or when the handler receives a request from a different project.

Constant Summary collapse

TYPE_UNSPECIFIED =

A link type, indicating the relationship of the two spans is unknown, or is known but is other than parent-child.

Returns:

  • (Symbol)
:TYPE_UNSPECIFIED
CHILD_LINKED_SPAN =

A link type, indicating the linked span is a child of the current span.

Returns:

  • (Symbol)
:CHILD_LINKED_SPAN
PARENT_LINKED_SPAN =

A link type, indicating the linked span is a parent of the current span.

Returns:

  • (Symbol)
:PARENT_LINKED_SPAN

Instance Attribute Summary collapse

Instance Attribute Details

#attributesHash<String, (TruncatableString, Integer, Float, Boolean)> (readonly)

A set of attributes on the link.

Returns:



74
75
76
# File 'lib/opencensus/trace/link.rb', line 74

def attributes
  @attributes
end

#dropped_attributes_countInteger (readonly)

The number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0, then no attributes were dropped.

Returns:

  • (Integer)


83
84
85
# File 'lib/opencensus/trace/link.rb', line 83

def dropped_attributes_count
  @dropped_attributes_count
end

#span_idString (readonly)

A unique identifier for a span within a trace, assigned when the span is created. The ID is a 16-byte represented as a hexadecimal string.

Returns:

  • (String)


59
60
61
# File 'lib/opencensus/trace/link.rb', line 59

def span_id
  @span_id
end

#trace_idString (readonly)

A unique identifier for a trace. All spans from the same trace share the same trace_id. The ID is a 16-byte represented as a hexadecimal string.

Returns:

  • (String)


51
52
53
# File 'lib/opencensus/trace/link.rb', line 51

def trace_id
  @trace_id
end

#typeSymbol (readonly)

The relationship of the current span relative to the linked span. You should use the type constants provided by this class.

Returns:

  • (Symbol)


67
68
69
# File 'lib/opencensus/trace/link.rb', line 67

def type
  @type
end