Module oc_span
Functions for functional manipulation of span data.
Function Index
add_link/2 | Add a Link to the list of Links in the span. |
add_time_event/2 | Add an Annotation or MessageEvent to the list of TimeEvents in a span. |
add_time_event/3 | |
annotation/2 | Create an Annotation. |
finish_span/1 | Finish a span, setting the end_time and sending to the reporter. |
link/4 | Create a Link which can be added to a Span. |
message_event/4 | Create a MessageEvent. |
put_attribute/3 | Put an attribute (a key/value pair) in the attribute map of a span. |
put_attributes/2 | Merge a map of attributes with the current attributes of a span. |
set_status/3 | Set Status. |
Function Details
add_link/2
add_link(Link, Span) -> Span
Link = opencensus:link()
Span = maybe(opencensus:span())
Add a Link to the list of Links in the span.
add_time_event/2
add_time_event(TimeEvent, Span) -> Span
TimeEvent = opencensus:annotation() | opencensus:message_event()
Span = maybe(opencensus:span())
Add an Annotation or MessageEvent to the list of TimeEvents in a span.
add_time_event/3
add_time_event(Timestamp, TimeEvent, Span) -> any()
annotation/2
annotation(Description, Attributes) -> Annotation
Description = unicode:unicode_binary()
Attributes = opencensus:attributes()
Annotation = opencensus:annotation()
Create an Annotation.
finish_span/1
finish_span(Span::maybe(opencensus:span())) -> ok
Finish a span, setting the end_time and sending to the reporter.
link/4
link(LinkType, TraceId, SpanId, Attributes) -> Link
LinkType = opencensus:link_type()
TraceId = opencensus:trace_id()
SpanId = opencensus:span_id()
Attributes = opencensus:attributes()
Link = opencensus:link()
Create a Link which can be added to a Span.
message_event/4
message_event(MessageEventType, Id, UncompressedSize, CompressedSize) -> MessageEvent
MessageEventType = opencensus:message_event_type()
Id = integer()
UncompressedSize = integer()
CompressedSize = integer()
MessageEvent = opencensus:message_event()
Create a MessageEvent.
put_attribute/3
put_attribute(Key, Value, Span) -> Span
Key = unicode:unicode_binary()
Value = opencensus:attribute_value()
Span = maybe(opencensus:span())
Put an attribute (a key/value pair) in the attribute map of a span. If the attribute already exists it is overwritten with the new value.
put_attributes/2
put_attributes(Attributes, Span) -> Span
Attributes = #{unicode:unicode_binary() => opencensus:attribute_value()}
Span = maybe(opencensus:span())
Merge a map of attributes with the current attributes of a span. The new values overwrite the old if any keys are the same.
set_status/3
set_status(Code, Message, Span) -> Span
Code = integer()
Message = unicode:unicode_binary()
Span = maybe(opencensus:span())
Set Status.