Class Context

java.lang.Object
io.confluent.telemetry.Context

public class Context extends Object
Context for metrics collectors. Encapsulates metadata such as the OpenTelemetry Resource and InstrumentationScope
  • Constructor Details

    • Context

      public Context(String domain)
    • Context

      public Context(io.opentelemetry.proto.resource.v1.Resource resource, String domain)
    • Context

      public Context(io.opentelemetry.proto.resource.v1.Resource resource, String domain, boolean debugEnabled)
  • Method Details

    • getResource

      public io.opentelemetry.proto.resource.v1.Resource getResource()
      Get the Resource in this Context. The Resource represents the entity for which telemetry is being collected.

      The buildMetricsData() and buildRequest() methods can be used to construct OTLP messages with the Resource and InstrumentationScope from this context.

    • getInstrumentationScope

      public io.opentelemetry.proto.common.v1.InstrumentationScope getInstrumentationScope()
      Get the InstrumentationScope in this Context. The InstrumentationScope represents the library or framework that is instrumenting the telemetry data.

      The buildMetricsData() and buildRequest() methods can be used to construct OTLP messages with the Resource and InstrumentationScope from this context.

    • isDebugEnabled

      public boolean isDebugEnabled()
    • getDomain

      public String getDomain()