Skip to content

Latest commit

 

History

History
160 lines (94 loc) · 6.29 KB

oc_span.md

File metadata and controls

160 lines (94 loc) · 6.29 KB

Module oc_span

Functions for functional manipulation of span data.

Data Types


maybe(T) = T | undefined

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

Add a Link to the list of Links in the span.

add_time_event/2


add_time_event(TimeEvent, Span) -> 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

Create an Annotation.

finish_span/1


finish_span(Span::maybe(opencensus:span())) -> true

Finish a span, setting the end_time and sending to the reporter.

link/4


link(LinkType, TraceId, SpanId, Attributes) -> Link

Create a Link which can be added to a Span.

message_event/4


message_event(MessageEventType, Id, UncompressedSize, CompressedSize) -> MessageEvent

Create a MessageEvent.

put_attribute/3


put_attribute(Key, Value, Span) -> 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

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

Set Status.