Email Service
This service will send a confirmation email to the user when an order is placed.
Initializing Tracing¶
You will need to require the core OpenTelemetry SDK and exporter Ruby gems, as well as any gem that will be needed for auto-instrumentation libraries (ie: Sinatra)
The Ruby SDK uses OpenTelemetry standard environment variables to configure OTLP export, resource attributes, and service name automatically. When initializing the OpenTelemetry SDK, you will also specify which auto-instrumentation libraries to leverage (ie: Sinatra)
Traces¶
Add attributes to auto-instrumented spans¶
Within the execution of auto-instrumented code you can get current span from context.
Adding multiple attributes to a span is accomplished using add_attributes
on
the span object.
Adding only a single attribute can be accomplished using set_attribute
on the
span object.
Create new spans¶
New spans can be created and placed into active context using in_span
from an
OpenTelemetry Tracer object. When used in conjunction with a do..end
block,
the span will automatically be ended when the block ends execution.
Metrics¶
TBD
Logs¶
TBD