struct
OpenTelemetry::AnyValue
- OpenTelemetry::AnyValue
- Struct
- Value
- Object
Overview
A scalar, byte sequence, array, or map suitable for telemetry attributes. Mutable input is copied and readers receive independent copies. Arrays and maps take more work to convert and render than scalars. Concurrency: immutable and safe to share.
Defined in:
api/any_value.crConstant Summary
-
EMPTY =
new(nil)
Constructors
- .new(value : Bool | Int64 | Float64 | String | Nil)
- .new(value : Array(T)) : AnyValue forall T
- .new(value : Hash(String, T)) : AnyValue forall T
- .new(value : AnyValue) : AnyValue
- .new(value : Bytes) : AnyValue
- .new(value : Int8 | Int16 | Int32 | UInt8 | UInt16 | UInt32) : AnyValue
- .new(value : UInt64 | Int128 | UInt128) : AnyValue
- .new(value : Float32) : AnyValue
- .new(value : NamedTuple) : AnyValue
Instance Method Summary
- #==(other : AnyValue) : Bool
- #[]?(index : Int) : AnyValue | Nil
- #[]?(key : String) : AnyValue | Nil
- #as_bool? : Bool | Nil
- #as_bytes? : Bytes | Nil
- #as_f64? : Float64 | Nil
- #as_i64? : Int64 | Nil
- #as_s? : String | Nil
- #each_element(& : AnyValue -> ) : Nil
- #each_entry(& : String, AnyValue -> ) : Nil
- #empty? : Bool
-
#hash(hasher)
See
Object#hash(hasher) - #kind : Kind
-
#size : Int32
Returns the number of elements, entries, or bytes.
- #to_a : Array(AnyValue) | Nil
- #to_h : Hash(String, AnyValue) | Nil
-
#to_s(io : IO) : Nil
Writes the representation for protocols that carry attribute values as strings.
- #unwrap : Bool | Int64 | Float64 | String | Bytes | Array(AnyValue) | Hash(String, AnyValue) | Nil
-
#write_bytes(io : IO) : Nil
Writes an independent byte slice when the value contains bytes.
Constructor Detail
Instance Method Detail
def to_s(io : IO) : Nil
#
Writes the representation for protocols that carry attribute values as strings.
def unwrap : Bool | Int64 | Float64 | String | Bytes | Array(AnyValue) | Hash(String, AnyValue) | Nil
#