Skip to content

OtelAttribute

This docs was updated at: 2026-02-23

com.paragon.telemetry.otel.OtelAttribute  ยท  Record


OpenTelemetry key-value attribute pair. Used for resources, scopes, and spans.

Follows the OTLP specification for attributes.

Methods

ofString

public static @NonNull OtelAttribute ofString(@NonNull String key, @NonNull String value)

Creates a string attribute.


ofBool

public static @NonNull OtelAttribute ofBool(@NonNull String key, boolean value)

Creates a boolean attribute.


ofInt

public static @NonNull OtelAttribute ofInt(@NonNull String key, long value)

Creates an integer attribute.


ofDouble

public static @NonNull OtelAttribute ofDouble(@NonNull String key, double value)

Creates a double attribute.


of

public static @NonNull OtelAttribute of(@NonNull String key, @NonNull Object value)

Creates an attribute from any value, inferring the type.