Class OTel

java.lang.Object
io.bytestreams.exchange.core.OTel

public final class OTel extends Object
OpenTelemetry constants and helpers.

Public AttributeKey constants define the metric and span attribute names used by channel implementations. These are the canonical keys for querying telemetry data.

The meter() and tracer() helpers delegate to GlobalOpenTelemetry.get(), which returns a no-op provider unless the OpenTelemetry SDK is configured by the application.

  • Field Details

    • CHANNEL_ID

      public static final io.opentelemetry.api.common.AttributeKey<String> CHANNEL_ID
    • CHANNEL_TYPE

      public static final io.opentelemetry.api.common.AttributeKey<String> CHANNEL_TYPE
    • DIRECTION

      public static final io.opentelemetry.api.common.AttributeKey<String> DIRECTION
    • ERROR_TYPE

      public static final io.opentelemetry.api.common.AttributeKey<String> ERROR_TYPE
    • MESSAGE_ID

      public static final io.opentelemetry.api.common.AttributeKey<String> MESSAGE_ID
    • MESSAGE_TYPE

      public static final io.opentelemetry.api.common.AttributeKey<String> MESSAGE_TYPE
    • SERVER_ADDRESS

      public static final io.opentelemetry.api.common.AttributeKey<String> SERVER_ADDRESS
    • SERVER_PORT

      public static final io.opentelemetry.api.common.AttributeKey<Long> SERVER_PORT
    • NETWORK_TRANSPORT

      public static final io.opentelemetry.api.common.AttributeKey<String> NETWORK_TRANSPORT
    • NETWORK_TYPE

      public static final io.opentelemetry.api.common.AttributeKey<String> NETWORK_TYPE
    • NETWORK_PEER_ADDRESS

      public static final io.opentelemetry.api.common.AttributeKey<String> NETWORK_PEER_ADDRESS
    • NETWORK_PEER_PORT

      public static final io.opentelemetry.api.common.AttributeKey<Long> NETWORK_PEER_PORT
    • NANOS_PER_MS

      public static final double NANOS_PER_MS
      See Also:
    • NAMESPACE

      public static final String NAMESPACE
      See Also:
    • UNIT_ATTEMPT

      public static final String UNIT_ATTEMPT
      See Also:
    • UNIT_REQUEST

      public static final String UNIT_REQUEST
      See Also:
  • Method Details

    • meter

      public static io.opentelemetry.api.metrics.Meter meter()
      Returns the default Meter, resolved lazily from GlobalOpenTelemetry.
    • tracer

      public static io.opentelemetry.api.trace.Tracer tracer()
      Returns the default Tracer, resolved lazily from GlobalOpenTelemetry.
    • endSpan

      public static void endSpan(io.opentelemetry.api.trace.Span span, Throwable error)
    • withError

      public static io.opentelemetry.api.common.Attributes withError(io.opentelemetry.api.common.Attributes attrs, Throwable error)
      Returns the given attributes with error_type added if the throwable is non-null.