OpenTelemetry

zio.telemetry.opentelemetry.OpenTelemetry
object OpenTelemetry

The entrypoint to telemetry functionality for tracing, metrics, logging and baggage.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def baggage(logAnnotated: Boolean): URLayer[ContextStorage, Baggage]

Use when you need to pass contextual information between spans.

Use when you need to pass contextual information between spans.

Value parameters

logAnnotated

propagate ZIO log annotations as Baggage key/values if it is set to true

Attributes

Use when you use automatic instrumentation.

Use when you use automatic instrumentation.

Attributes

Use when you do not use automatic instrumentation.

Use when you do not use automatic instrumentation.

Attributes

Use when you need to configure an instance of OpenTelemetry programmatically.

Value parameters

zio

scoped ZIO value that returns a configured instance of io.opentelemetry.api.OpenTelemetry, thus ensuring that the returned instance will be closed.

Attributes

def logging(instrumentationScopeName: String, logLevel: LogLevel): URLayer[OpenTelemetry & ContextStorage, Unit]

Use when you need to propagate calls to ZIO.log* as OTEL Log signals.

Use when you need to propagate calls to ZIO.log* as OTEL Log signals.

Value parameters

instrumentationScopeName

name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name

logLevel

configures the logger to propagate the log records only when the log level is more than specified

Attributes

def metrics(instrumentationScopeName: String, instrumentationVersion: Option[String], schemaUrl: Option[String], logAnnotated: Boolean): URLayer[OpenTelemetry & ContextStorage, Meter & Builder]

Use when you need to instrument metrics manually.

Use when you need to instrument metrics manually.

Value parameters

instrumentationScopeName

name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name

instrumentationVersion

version of the instrumentation scope (e.g., "1.0.0")

schemaUrl

schema URL

Attributes

def tracing(instrumentationScopeName: String, instrumentationVersion: Option[String], schemaUrl: Option[String], logAnnotated: Boolean): URLayer[OpenTelemetry & ContextStorage, Tracing]

Use when you need to instrument spans manually.

Use when you need to instrument spans manually.

Value parameters

instrumentationScopeName

name uniquely identifying the instrumentation scope, such as the instrumentation library, package, or fully qualified class name

instrumentationVersion

version of the instrumentation scope (e.g., "1.0.0")

schemaUrl

schema URL

Attributes

Use when you want to allow a seamless integration with ZIO runtime and JVM metrics.

Use when you want to allow a seamless integration with ZIO runtime and JVM metrics.

By default this layer enables the propagation of ZIO runtime metrics only. For JVM metrics you need to provide DefaultJvmMetrics.live.unit.

Attributes

Concrete fields

A global singleton for the entrypoint to telemetry functionality for tracing, metrics, logging and baggage. Should be used with SDK Autoconfiguration module and/or Automatic instrumentation Java agent.

A global singleton for the entrypoint to telemetry functionality for tracing, metrics, logging and baggage. Should be used with SDK Autoconfiguration module and/or Automatic instrumentation Java agent.

Attributes

See also