View Source AppIdentity.Telemetry (AppIdentity for Elixir v1.3.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

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:

Measurements

All AppIdentity telemetry events measure one of two things:

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_identity, :generate_proof, :stop] Metadata

[:app_identity, :plug, :start] Metadata

  • conn: Plug.Conn.t/0
  • options: A map that may have the following keys (derived from AppIdentity.Plug.Config.param/0):
    • apps: a list of telemetry_app/0 values
    • finder: 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 names
    • header_groups: a map of header groups to lists of header names
    • on_failure: the atom value of AppIdentity.Plug.Config.on_failure/0 or if the on_failure configuration is AppIdentity.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: a AppIdentity.disallowed/0 value.

[:app_identity, :plug, :stop] Metadata

  • conn: Plug.Conn.t/0, updated after processing
  • options: A map with the following keys (derived from AppIdentity.Plug.Config.param/0):
    • apps: a list of telemetry_app/0 values
    • finder: 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 names
    • header_groups: a map of header groups to lists of header names
    • on_failure: the atom value of AppIdentity.Plug.Config.on_failure/0 or if the on_failure configuration is AppIdentity.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: a AppIdentity.disallowed/0 value.

[:app_identity, :verify_proof, :start] Metadata

[:app_identity, :verify_proof, :stop] Metadata

  • app: telemetry_app/0. In the case of an error, this will be the same app value as was reported in the :start event. If not, this value will be the post-verification version of the app.
  • options: a list of AppIdentity.option/0
  • One of:
    • candidate: The candidate proof string
    • proof: 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: false

Recompile 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

Link to this opaque

telemetry_app()

View Source (opaque)
@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 a AppIdentity.App.loader/0 function.
  • "finder": the app provided is a AppIdentity.App.finder/0 function.
  • Otherwise, a map is returned with required :id and :version keys and optional :config and :verified keys.