class Traces::Backend::Capture::Span

A span which validates tag assignment.

def []= key, value

@parameter value [Object] The metadata value. Should be coercable to a string.
@parameter key [String] The metadata key.
Assign some metadata to the span.
def []= key, value
	@attributes[key] = value
end

def as_json

Convert the span to a JSON representation.
def as_json
	{
		name: @name,
		resource: @resource,
		attributes: @attributes,
		context: @context.as_json
	}
end

def initialize(context, name, resource, attributes)

@parameter attributes [Hash] Metadata for the recorded span.
@parameter resource [String] The "resource" that the span is associated with.
@parameter name [String] A useful name/annotation for the recorded span.
@parameter context [Context] The context in which the span is recorded.
Initialize a new span.
def initialize(context, name, resource, attributes)
	@context = context
	@name = name
	@resource = resource
	@attributes = attributes
end

def to_json(...)

Convert the span to a JSON string.
def to_json(...)
	as_json.to_json(...)
end