Geometrics.OpenTelemetry.Logger (geometrics v1.0.4-rc.3) View Source

Capture crashes and exits with open spans. This helps to capture problems where a system is overloaded or under-optimized, and timeouts occur. Timeout errors (in Ecto, or when calling into GenServers) typically trigger exit instead of raising exceptions.

Frameworks such as Phoenix and Phoenix.LiveView use :telemetry, with wrappers that rescue and reraise exceptions, but which do not catch exits. For this reason, exits and other timeout errors can interrupt application tracing, since spans opened in processes may otherwise never be closed, and therefore never be exported.

This module requires that when a span is opened, it be

References:

Link to this section Summary

Functions

Callback implementation for :gen_event.handle_call/2.

Callback implementation for :gen_event.handle_info/2.

Callback implementation for :gen_event.init/1.

When ending a span, it no longer needs to be tracked by the Logger.

Given an otel span context, ensure that it is saved in the Logger metadata for the current process. If the process crashes or exits, the custom logger defined by this file will receive an error event, and can send telemetry to indicate that the span should be closed.

Link to this section Functions

Callback implementation for :gen_event.handle_call/2.

Link to this function

handle_event(event, state)

View Source

Callback implementation for :gen_event.handle_event/2.

Callback implementation for :gen_event.handle_info/2.

Callback implementation for :gen_event.init/1.

When ending a span, it no longer needs to be tracked by the Logger.

Link to this function

track_span_ctx(span_ctx)

View Source

Given an otel span context, ensure that it is saved in the Logger metadata for the current process. If the process crashes or exits, the custom logger defined by this file will receive an error event, and can send telemetry to indicate that the span should be closed.