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

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)
])

Link to this section Summary

Link to this section Functions

Link to this function

format(level, message, timestamp, metadata)

View Source

Specs

See Uinta.formatter.format/4