Documentation
¶
Index ¶
- Variables
- func Float64HistogramRecord(ctx context.Context, histogram metric.Float64Histogram, val float64, ...)
- func IntCounterAddOne(ctx context.Context, counter IntCounter, inOptions ...MetricOption)
- func SetClientID(ctx context.Context, clientID string)
- func SetProjectID(ctx context.Context, projectID string)
- type HTTPInstrumentationMiddleware
- type IntCounter
- type MetricOption
Constants ¶
This section is empty.
Variables ¶
var AttributeKeyStatus = attribute.Key("status")
AttributeKeyStatus defines the attribute.
var AttributeKeyWhatsappAPIErrorCode = attribute.Key("whatsapp_api_error_code")
AttributeKeyWhatsappAPIErrorCode defines the attribute.
var AttributeKeyWhatsappAPIType = attribute.Key("whatsapp_api_type")
AttributeKeyWhatsappAPIType defines the attribute.
var AttributeStatusError = AttributeKeyStatus.String("error")
AttributeStatusError is "status=error".
var AttributeStatusOK = AttributeKeyStatus.String("ok")
AttributeStatusOK is "status=ok".
var CounterAuthflowSessionCreationCount = mustInt64Counter( "authgear.authflow_session.creation.count", metric.WithDescription("The number of creation of Authflow session"), metric.WithUnit("{session}"), )
var CounterCSRFRequestCount = mustInt64Counter( "authgear.csrf.request.count", metric.WithDescription("The number of HTTP request with CSRF protection"), metric.WithUnit("{request}"), )
CounterCSRFRequestCount has the following labels: - AttributeKeyStatus
var CounterEmailRequestCount = mustInt64Counter( "authgear.email.request.count", metric.WithDescription("The number of email request"), metric.WithUnit("{request}"), )
CounterEmailRequestCount has the following labels: - AttributeKeyStatus
var CounterOAuthAccessTokenRefreshCount = mustInt64Counter( "authgear.oauth_access_token.refresh.count", metric.WithDescription("The number of access token obtained via a refresh token"), metric.WithUnit("{token}"), )
var CounterOAuthAuthorizationCodeConsumptionCount = mustInt64Counter( "authgear.oauth_authorization_code.consumption.count", metric.WithDescription("The number of consumption of OAuth authorization code"), metric.WithUnit("{code}"), )
var CounterOAuthAuthorizationCodeCreationCount = mustInt64Counter( "authgear.oauth_authorization_code.creation.count", metric.WithDescription("The number of creation of OAuth authorization code"), metric.WithUnit("{code}"), )
var CounterOAuthSessionCreationCount = mustInt64Counter( "authgear.oauth_session.creation.count", metric.WithDescription("The number of creation of OAuth session"), metric.WithUnit("{session}"), )
var CounterSAMLSessionCreationCount = mustInt64Counter( "authgear.saml_session.creation.count", metric.WithDescription("The number of creation of SAML session"), metric.WithUnit("{session}"), )
var CounterSMSRequestCount = mustInt64Counter( "authgear.sms.request.count", metric.WithDescription("The number of SMS request"), metric.WithUnit("{request}"), )
CounterSMSRequestCount has the following labels: - AttributeKeyStatus
var CounterWebSessionCreationCount = mustInt64Counter( "authgear.web_session.creation.count", metric.WithDescription("The number of creation of Web session"), metric.WithUnit("{session}"), )
var CounterWhatsappRequestCount = mustInt64Counter( "authgear.whatsapp.request.count", metric.WithDescription("The number of Whatsapp request"), metric.WithUnit("{request}"), )
CounterWhatsappRequestCount has the following labels: - AttributeKeyStatus
var DependencySet = wire.NewSet( wire.Struct(new(HTTPInstrumentationMiddleware), "*"), )
var HTTPServerRequestDurationHistogram = mustFloat64Histogram( semconv.HTTPServerRequestDurationName, metric.WithDescription(semconv.HTTPServerRequestDurationDescription), metric.WithUnit(semconv.HTTPServerRequestDurationUnit), metric.WithExplicitBucketBoundaries( 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10, ), )
HTTPServerRequestDurationHistogram is https://opentelemetry.io/docs/specs/semconv/http/http-metrics/#metric-httpserverrequestduration
Functions ¶
func Float64HistogramRecord ¶
func Float64HistogramRecord(ctx context.Context, histogram metric.Float64Histogram, val float64, inOptions ...MetricOption)
func IntCounterAddOne ¶
func IntCounterAddOne(ctx context.Context, counter IntCounter, inOptions ...MetricOption)
IntCounterAddOne prepares necessary attributes and calls Add with incr=1. It is intentionally that this does not accept metric.AddOption. If this accepts metric.AddOption, then you can pass in arbitrary metric.WithAttributes. Those attributes MAY NOT be the attributes defined in this package, and could contain unexpected end user data.
func SetClientID ¶
func SetProjectID ¶
Types ¶
type HTTPInstrumentationMiddleware ¶
type HTTPInstrumentationMiddleware struct {
TrustProxy config.TrustProxy
}
type IntCounter ¶
IntCounter is metric.Int64Counter or metric.Int64UpDownCounter
type MetricOption ¶
type MetricOption interface {
// contains filtered or unexported methods
}
func WithHTTPStatusCode ¶
func WithHTTPStatusCode(code int) MetricOption
func WithStatusError ¶
func WithStatusError() MetricOption
func WithStatusOk ¶
func WithStatusOk() MetricOption
func WithWhatsappAPIErrorCode ¶
func WithWhatsappAPIErrorCode(code int) MetricOption
func WithWhatsappAPIType ¶
func WithWhatsappAPIType(apiType config.WhatsappAPIType) MetricOption