Class: OpenCensus::Trace::Annotation

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

Overview

A text annotation with a set of attributes.

Instance Attribute Summary collapse

Attributes inherited from TimeEvent

#time

Instance Method Summary collapse

Constructor Details

#initialize(description, attributes: {}, dropped_attributes_count: 0, time: nil) ⇒ Annotation

Create an Annotation object.



51
52
53
54
55
56
57
# File 'lib/opencensus/trace/annotation.rb', line 51

def initialize description, attributes: {}, dropped_attributes_count: 0,
               time: nil
  super time: time
  @description = description
  @attributes = attributes
  @dropped_attributes_count = dropped_attributes_count
end

Instance Attribute Details

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

A set of attributes on the annotation.

Returns:



35
36
37
# File 'lib/opencensus/trace/annotation.rb', line 35

def attributes
  @attributes
end

#descriptionTruncatableString (readonly)

A user-supplied message describing the event.

Returns:



28
29
30
# File 'lib/opencensus/trace/annotation.rb', line 28

def description
  @description
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)


44
45
46
# File 'lib/opencensus/trace/annotation.rb', line 44

def dropped_attributes_count
  @dropped_attributes_count
end