View Source Uinta.Formatter.Datadog (Uinta v0.14.0)

Installation

config :logger, :console, format: {Uinta.Formatter.Datadog, :format}

Features

Trace and Span id correlation

Takes trace ids and span ids in the OpenTelemetry format (as hex) and convert them into Datadog format in the correct key. Logger.metadata must include the keys :trace_id and :span_id. Be sure to add those two keys onto the allowlist in the :logger config. See Datadog's documentation for more details.

Example

ctx = OpenTelemetry.Tracer.current_span_ctx()
Logger.metadata([
  trace_id: OpenTelemetry.Span.hex_trace_id(ctx),
  span_id: OpenTelemetry.Span.hex_span_id(ctx)
])

Summary

Functions

Link to this function

format(level, message, timestamp, metadata)

View Source
@spec format(Uinta.Types.level(), iodata(), Uinta.Types.time(), Keyword.t()) ::
  iodata()

See Uinta.formatter.format/4