View Source AppIdentity.Telemetry (AppIdentity for Elixir v1.3.2)
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
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
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
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 that may have the following keys (derived fromAppIdentity.Plug.Config.param/0):apps: a list oftelemetry_app/0valuesfinder: if present, the string"function (anonymous)"for an anonymous finder function or"function (module.function/1)"for a finder function specified by name.headers: a list of identity header namesheader_groups: a map of header groups to lists of header nameson_failure: the atom value ofAppIdentity.Plug.Config.on_failure/0or if theon_failureconfiguration isAppIdentity.Plug.Config.on_failure_callback/0, it will be either the string"function (anonymous)"for an anonymous callback or"function (module.function/1)"for a named callback.on_success: if present, either the string"function (anonymous)"for an anonymous callback or"function (module.function/1)"for a named callback.on_resolution: if present, either the string"function (anonymous)"for an anonymous callback or"function (module.function/1)"for a named callback.disallowed: aAppIdentity.disallowed/0value.
[:app_identity, :plug, :stop] Metadata
conn:Plug.Conn.t/0, updated after processingoptions: A map with the following keys (derived fromAppIdentity.Plug.Config.param/0):apps: a list oftelemetry_app/0valuesfinder: if present, the string"function (anonymous)"for an anonymous finder function or"function (module.function/1)"for a finder function specified by name.headers: a list of identity header namesheader_groups: a map of header groups to lists of header nameson_failure: the atom value ofAppIdentity.Plug.Config.on_failure/0or if theon_failureconfiguration isAppIdentity.Plug.Config.on_failure_callback/0, it will be either the string"function (anonymous)"for an anonymous callback or"function (module.function/1)"for a named callback.on_success: if present, either the string"function (anonymous)"for an anonymous callback or"function (module.function/1)"for a named callback.on_resolution: if present, either the string"function (anonymous)"for an anonymous callback or"function (module.function/1)"for a named callback.disallowed: aAppIdentity.disallowed/0value.
[: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
Telemetry may be disabled by setting this for your configuration:
config :app_identity, AppIdentity.Telemetry, enabled: falseRecompile app_identity if this setting is changed:
$ mix deps.compile --force app_identity
Summary
Types
A telemetry-safe version of an input or verified app.
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.