hellhound/telemetry
Typed Hellhound events, as sinal descriptors over :telemetry.
Every event carries closed, non-secret values only: no token, code,
state, nonce, verifier, secret, claim, identity, query string, header or
body ever reaches an event. Each carries the correlation that the
caller set with hellhound.with_correlation, which Hellhound also passes to
its HTTP Gun requests.
| Event | When |
|---|---|
[hellhound, http, request] (http_request) | an outbound provider request completes or fails |
[hellhound, login] (login) | complete_login or recover_custody returns |
[hellhound, refresh] (refresh) | a refresh completes, joins another, or fails |
[hellhound, logout] (logout) | logout ends a session |
sinal.observe(telemetry.http_request(), fn(measurements, request) {
// measurements.duration_ms, request.host, request.outcome, ...
Nil
})
Types
Whether a failed request may have reached the provider.
pub type Evidence {
NotSent
MaybeSent
}
Constructors
-
NotSentProven not sent.
-
MaybeSentMay have been sent.
pub type HttpMeasurements {
HttpMeasurements(duration_ms: Int)
}
Constructors
-
HttpMeasurements(duration_ms: Int)
pub type HttpMethod {
Get
Post
}
Constructors
-
Get -
Post
[hellhound, http, request] metadata: discovery, keys, token, userinfo,
introspection and revocation requests. Queries are never recorded.
pub type HttpRequest {
HttpRequest(
method: HttpMethod,
host: String,
path: String,
outcome: Outcome,
correlation: option.Option(correlation.Correlation),
)
}
Constructors
-
HttpRequest( method: HttpMethod, host: String, path: String, outcome: Outcome, correlation: option.Option(correlation.Correlation), )
[hellhound, login] metadata.
pub type Login {
Login(
outcome: LoginOutcome,
correlation: option.Option(correlation.Correlation),
)
}
Constructors
-
Login( outcome: LoginOutcome, correlation: option.Option(correlation.Correlation), )
pub type LoginOutcome {
LoginSucceeded
LoginCallbackRefused
LoginDenied
LoginExchangeFailed
LoginIdentityRejected
LoginCustodyUnconfirmed
LoginUnavailable
}
Constructors
-
LoginSucceededA session was installed.
-
LoginCallbackRefusedThe callback was malformed, unbound to this browser, replayed or expired; nothing was sent.
-
LoginDeniedThe provider denied the authorization.
-
LoginExchangeFailedThe code exchange failed or its outcome is unknown.
-
LoginIdentityRejectedTokens arrived but the identity was not accepted.
-
LoginCustodyUnconfirmedInstallation was not confirmed; a recovery value was returned.
-
LoginUnavailableA store did not answer, or the login timed out before the exchange.
[hellhound, logout] metadata: emitted once custody is removed.
pub type Logout {
Logout(
revocation: Revocation,
correlation: option.Option(correlation.Correlation),
)
}
Constructors
-
Logout( revocation: Revocation, correlation: option.Option(correlation.Correlation), )
A response status, or a failure with its submission evidence.
pub type Outcome {
Status(code: Int)
Failed(evidence: Evidence, reason: TransportReason)
}
Constructors
-
Status(code: Int) -
Failed(evidence: Evidence, reason: TransportReason)
[hellhound, refresh] metadata.
pub type Refresh {
Refresh(
outcome: RefreshOutcome,
correlation: option.Option(correlation.Correlation),
)
}
Constructors
-
Refresh( outcome: RefreshOutcome, correlation: option.Option(correlation.Correlation), )
pub type RefreshOutcome {
Refreshed
RefreshJoined
RefreshNotSent
RefreshRejected
RefreshRevoked
RefreshQuarantined
RefreshWaitTimedOut
RefreshUnconfirmed
RefreshUnavailable
}
Constructors
-
RefreshedThis request refreshed the session.
-
RefreshJoinedAnother request’s refresh was waited for and used.
-
RefreshNotSentProven not sent; the generation was released.
-
RefreshRejectedRejected before grant processing; the generation was released.
-
RefreshRevokedThe refresh token is revoked (
invalid_grant). -
RefreshQuarantinedThe generation is quarantined after an uncertain outcome.
-
RefreshWaitTimedOutAnother request’s refresh did not settle within the wait.
-
RefreshUnconfirmedPublication was not confirmed; a recovery value was returned.
-
RefreshUnavailableThe custody store did not answer.
pub type Revocation {
Revoked
RevocationUnsupported
RevocationFailed
RevocationSkipped
}
Constructors
-
Revoked -
RevocationUnsupported -
RevocationFailed -
RevocationSkipped
pub type SessionMeasurements {
SessionMeasurements(duration_ms: Int)
}
Constructors
-
SessionMeasurements(duration_ms: Int)
The closed transport failure reasons, as hellhound.TransportReason names
them. May gain variants as HTTP Gun does.
pub type TransportReason {
DestinationRejected
InsecureScheme
InvalidDestination
ResolutionFailed
ConnectionRefused
ConnectionFailed
TlsRejected
Timeout
ResponseTooLarge
ResponseHeadersTooLarge
MalformedHttp
ReceiveFailed
UnsupportedContentEncoding
OtherTransportFailure
}
Constructors
-
DestinationRejected -
InsecureScheme -
InvalidDestination -
ResolutionFailed -
ConnectionRefused -
ConnectionFailed -
TlsRejected -
Timeout -
ResponseTooLarge -
ResponseHeadersTooLarge -
MalformedHttp -
ReceiveFailed -
UnsupportedContentEncoding -
OtherTransportFailure
Values
pub fn http_request() -> sinal.Event(
HttpMeasurements,
HttpRequest,
)
The descriptor for [hellhound, http, request]. On the wire the metadata is
#{method => <<"get">> | <<"post">>, host => Binary, path => Binary, outcome => {status, Code} | {failure, not_sent | maybe_sent, Reason}, correlation => Binary} (correlation omitted when unset) and the
measurements are #{duration_ms => Integer}.
pub fn login() -> sinal.Event(SessionMeasurements, Login)
The descriptor for [hellhound, login]; outcome is a snake_case binary.
pub const login_outcomes: List(LoginOutcome)
pub fn logout() -> sinal.Event(SessionMeasurements, Logout)
The descriptor for [hellhound, logout]; revocation is a snake_case
binary.
pub fn refresh() -> sinal.Event(SessionMeasurements, Refresh)
The descriptor for [hellhound, refresh]; outcome is a snake_case binary.
pub const refresh_outcomes: List(RefreshOutcome)
pub const revocations: List(Revocation)
pub fn transport_reason_name(reason: TransportReason) -> String
The snake_case wire name of a transport reason.
pub const transport_reasons: List(TransportReason)
Every transport reason, for codecs and tests.