OpenTelemetry API v0.3.1 API Reference
Modules
An OpenTelemetry Trace consists of 1 or more Spans that either have a
parent/child relationship or are linked together through a Link. Each Span has a TraceId (trace_id/0
),
SpanId (span_id/0
), and a start and end time in nanoseconds.
require OpenTelemetry.Counter
OpenTelemetry.Counter.add("some.counter", 3)
require OpenTelemetry.Measure
OpenTelemetry.Measure.record("some.counter", 3)
require OpenTelemetry.Meter
OpenTelemetry.register_application_meter(Your.Application)
OpenTelemetry.Meter.new_instruments([...])
bound = OpenTelemetry.Meter.bind("some.latency", [])
# measure time spent on some function and then record it
OpenTelemetry.Meter.record(bound, time)
require OpenTelemetry.Observer
OpenTelemetry.Observer.set_callback("some.counter", fn o -> OpenTelemetry.Observer.observe(o, 33, []))
This module contains macros for Span operations that update the active current Span in the current process. An example of creating an Event and adding it to the current Span
This module contains macros for Tracer operations around the lifecycle of the Spans within a Trace.