Telemetry events emitted by the library.
Every HTTP call to the Compute API is wrapped in a :telemetry.span/3, so you
get the standard :start / :stop / :exception trio.
Events
[:gcp_compute, :request, :start]— measurements:%{system_time, monotonic_time}; metadata:%{method, path, project}.[:gcp_compute, :request, :stop]— measurements:%{duration, monotonic_time}; metadata:%{method, path, project, result, http_status}(resultis:okor:error;http_statusis present on API errors).[:gcp_compute, :request, :exception]— measurements:%{duration, monotonic_time}; metadata:%{method, path, project, kind, reason, stacktrace}.
Attaching a quick logger
GcpCompute.Telemetry.attach_default_logger()or wire the events into Telemetry.Metrics / your reporter of choice.
Summary
Functions
@spec attach_default_logger(Logger.level()) :: :ok | {:error, :already_exists}
Attach a simple Logger handler for request stops/exceptions.
Intended for development. In production prefer Telemetry.Metrics + a reporter.
@spec events() :: [[atom()]]
The list of telemetry events this library emits.