class Span
A span which validates tag assignment.
Definitions
def initialize(context)
Initialize a new span.
Signature
-
parameter
context
Context
The context in which the span is recorded.
Implementation
def initialize(context)
@context = context
end
attr :context
Signature
-
attribute
Context
The context in which the span is recorded.
def []= key, value
Assign some metadata to the span.
Signature
-
parameter
key
String
The metadata key.
-
parameter
value
Object
The metadata value. Should be coercable to a string.
Implementation
def []= key, value
unless key.is_a?(String) || key.is_a?(Symbol)
raise ArgumentError, "Invalid attribute key (must be String or Symbol): #{key.inspect}!"
end
begin
String(value)
rescue
raise ArgumentError, "Invalid attribute value (must be convertible to String): #{value.inspect}!"
end
end