Guava.Usage (Guava v0.34.0)

Copy Markdown View Source

Optional, opt-in usage reporting (uploads batched method-call/exception events to v1/upload-telemetry).

Distinct from :telemetry instrumentation (which the SDK also emits, for you to hook). This is off by default — enable with config :guava, usage_telemetry: true.

Summary

Functions

Returns a specification to start this module under a supervisor.

Whether usage reporting is enabled via config.

Set the client used for uploads (no-op when disabled).

Record a usage event (dropped when disabled or the queue is full).

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

enabled?()

@spec enabled?() :: boolean()

Whether usage reporting is enabled via config.

set_client(client)

@spec set_client(Guava.Client.t()) :: :ok

Set the client used for uploads (no-op when disabled).

track(event_type, data \\ %{})

@spec track(String.t(), map()) :: :ok

Record a usage event (dropped when disabled or the queue is full).