class

OpenTelemetry::API::AbstractResource

Inherits OpenTelemetry::Sendable / Reference / Object

Constructors

new(attrs)

Create a new Resource that has been intialized by the provided key/value pairs. This initialization will support any seed object that provides an #each method which takes a two-argument block.

Source
new

Create an empty Resource.

Source

Instance methods

[](key)

Retrieve the value for a key in the Resource.

Source
[]=(key, value)

Assign a value to a key in the Resource.

Source
[]?(key)

Retrieve a value for a key in the Resource. Return nil instead of an exception if the key is not present.

Source
attributes
Source
attributes=(attributes : Hash(String, AnyAttribute))
Source
dropped_attribute_count
Source
dropped_attribute_count=(dropped_attribute_count : UInt32)
Source
empty?

Return true if the resource is empty.

Source
get_attribute(key)

Alias for #[]

Source
get_attribute?(key)

Alias for #[]?

Source
set_attribute(key, value)

Alias for #[]=

Source
to_json(json : JSON::Builder)
Source
to_json

Export the resource with a JSON representation.

Source
to_protobuf

Export the resource to its protocol buffer representation.

Source