View Source Telemetria.Inspect protocol (telemetria v0.18.0)

The protocol to be implemented for structs to decrease an amount of data to be sent to :telemetry events.

Telemetria reports the arguments in calls to wrapped functions as well as the result. Sometimes it might be too noisy to grasp in logs. If Telemetria.Inspect protocol is implemented for any kind of data to be spitted out, it would be applied instead of Inspect to re-shape and possibly make the input value fingerprint less verbose.

Summary

Functions

Converts term into an algebra document, to be used with Telemetria events.

Types

t()

@type t() :: term()

Functions

inspect(term, opts)

@spec inspect(
  t(),
  keyword()
) :: Inspect.Algebra.t()

Converts term into an algebra document, to be used with Telemetria events.

iex|🌢|1  defmodule A, do: defstruct(foo: 42, bar: :baz)
iex|🌢|2  Telemetria.Inspect.inspect(%A{}, only: [:foo])
A{foo: 42, }

To enable it for your struct, use @derive Telemetria.Inspect or @derive {Telemetria.Inspect, options}.