View Source AppIdentity.Telemetry (AppIdentity for Elixir v1.2.0)
If telemetry is a dependency in your
application, and the telemetry is not explicitly disabled, telemetry events
will be emitted for AppIdentity.generate_proof/2,
AppIdentity.verify_proof/3, and AppIdentity.Plug. See
AppIdentity.Telemetry for more information.
telemetry-events
Telemetry Events
All of AppIdentity's telemetry events are spans, consisting of :start and
:stop events. These are always in the form [:app_identity, <telemetry_type>, <event>].
The events are:
[:app_identity, :generate_proof, :start]emitted whenAppIdentity.generate_proof/2orAppIdentity.generate_proof!/2is called.[:app_identity, :generate_proof, :stop]emitted whenAppIdentity.generate_proof/2orAppIdentity.generate_proof!/2finishes, either on success or failure. Telemetry is generated prior to the raising of any exceptions forAppIdentity.generate_proof/2.[:app_identity, :plug, :start]emitted whenAppIdentity.Plugis called. IfAppIdentity.Plugis called in-line, exceptions may be thrown if there are configuration issues and telemetry will not be emitted.[:app_identity, :plug, :stop]emitted when the response is sent afterAppIdentity.Plugcompletes.[:app_identity, :verify_proof, :start]emitted whenAppIdentity.verify_proof/3orAppIdentity.verify_proof!/3is called.[:app_identity, :verify_proof, :stop]emitted whenAppIdentity.verify_proof/3orAppIdentity.verify_proof!/3finishes, either on success or failure. Telemetry is verified prior to the raising of any exceptions forAppIdentity.verify_proof/3.
measurements
Measurements
All AppIdentity telemetry events measure one of two things:
:startevents always measuremonotonic_time(:erlang.monotonic_time/0) andsystem_time(:erlang.system_time/0).:stopevents always measuremonotonic_time(:erlang.monotonic_time/0) andduration(the difference between the start time and stop time).
metadata
Metadata
All AppIdentity telemetry includes a telemetry_span_context key which is
a :erlang.reference/0. In this version, this value will be generated with
the :start event and reused for the :stop event.
When a measurement type is given as t:telemetry_app, this will be one of the
following values:
[:app_identity, :generate_proof, :start] Metadata
app:telemetry_app/0options: a list ofAppIdentity.option/0
[:app_identity, :generate_proof, :stop] Metadata
app:telemetry_app/0options: a list ofAppIdentity.option/0- One of:
proof: The generated proof stringerror: A descriptive error
[:app_identity, :plug, :start] Metadata
conn:Plug.Conn.t/0options: A map with the following keys (derived fromAppIdentity.Plug.option/0):apps: a list oftelemetry_app/0finder: Either a value ofAppIdentity.Plug.on_failure/0or the string"function"if theon_failurevalue isAppIdentity.Plug.on_failure_fn/0.
[:app_identity, :plug, :stop] Metadata
conn:Plug.Conn.t/0, updated after processingoptions: A map with the following keys (derived fromAppIdentity.Plug.option/0):apps: a list oftelemetry_app/0finder: Either a value ofAppIdentity.Plug.on_failure/0or the string"function"if theon_failurevalue isAppIdentity.Plug.on_failure_fn/0.
[:app_identity, :verify_proof, :start] Metadata
app:telemetry_app/0options: a list ofAppIdentity.option/0- One of:
candidate: The candidate proof stringproof: The parsed proof
[:app_identity, :verify_proof, :stop] Metadata
app:telemetry_app/0. In the case of an error, this will be the sameappvalue as was reported in the:startevent. If not, this value will be the post-verification version of theapp.options: a list ofAppIdentity.option/0- One of:
candidate: The candidate proof stringproof: The parsed proof
- In case of an error:
error: A descriptive error
disabling-telemetry
Disabling Telemetry
Telemetry may be disabled by setting this for your configuration:
config :app_identity, AppIdentity.Telemetry, enabled: falseRemember to run mix deps.compile --force app_identity after changing this setting
to ensure the change is picked up.
Link to this section Summary
Types
A telemetry-safe version of an input or verified app.
Link to this section Types
@opaque telemetry_app()
A telemetry-safe version of an input or verified app.
May be one of the following values:
nil: the app is not found or does not verify correctly."loader": the app provided is aAppIdentity.App.loader/0function."finder": the app provided is aAppIdentity.App.finder/0function.- Otherwise, a map is returned with required
:idand:versionkeys and optional:configand:verifiedkeys.