Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document PAR Telemetry Events #345

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions lib/oidcc/authorization.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
defmodule Oidcc.Authorization do
use TelemetryRegistry

telemetry_event(%{
event: [:oidcc, :par_request, :start],
description: "Emitted at the start of executing a PAR request",
measurements: "%{system_time: non_neg_integer(), monotonic_time: integer()}",
metadata: "%{issuer: :uri_string.uri_string(), client_id: String.t()}"
})

telemetry_event(%{
event: [:oidcc, :par_request, :stop],
description: "Emitted at the end of executing a PAR request",
measurements: "%{duration: integer(), monotonic_time: integer()}",
metadata: "%{issuer: :uri_string.uri_string(), client_id: String.t()}"
})

telemetry_event(%{
event: [:oidcc, :par_request, :exception],
description: "Emitted at the end of executing a PAR request",
measurements: "%{duration: integer(), monotonic_time: integer()}",
metadata: "%{issuer: :uri_string.uri_string(), client_id: String.t()}"
})

@moduledoc """
Functions to start an OpenID Connect Authorization

## Telemetry

#{telemetry_docs()}
"""
@moduledoc since: "3.0.0"

Expand Down
21 changes: 21 additions & 0 deletions src/oidcc_authorization.erl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,27 @@
| no_supported_code_challenge
| oidcc_http_util:error().

-telemetry_event(#{
event => [oidcc, par_request, start],
description => <<"Emitted at the start of executing a PAR request">>,
measurements => <<"#{system_time => non_neg_integer()}">>,
metadata => <<"#{issuer => uri_string:uri_string(), client_id => binary()}">>
}).

-telemetry_event(#{
event => [oidcc, par_request, stop],
description => <<"Emitted at the end of executing a PAR request">>,
measurements => <<"#{duration => integer(), monotonic_time => integer()}">>,
metadata => <<"#{issuer => uri_string:uri_string(), client_id => binary()}">>
}).

-telemetry_event(#{
event => [oidcc, par_request, exception],
description => <<"Emitted at the end of executing a PAR request">>,
measurements => <<"#{duration => integer(), monotonic_time => integer()}">>,
metadata => <<"#{issuer => uri_string:uri_string(), client_id => binary()}">>
}).

%% @doc
%% Create Auth Redirect URL
%%
Expand Down
Loading