otelauthgear

package
v0.0.0-...-17f547e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AttributeKeyStatus = attribute.Key("status")

AttributeKeyStatus defines the attribute.

View Source
var AttributeKeyWhatsappAPIErrorCode = attribute.Key("whatsapp_api_error_code")

AttributeKeyWhatsappAPIErrorCode defines the attribute.

View Source
var AttributeKeyWhatsappAPIType = attribute.Key("whatsapp_api_type")

AttributeKeyWhatsappAPIType defines the attribute.

View Source
var AttributeStatusError = AttributeKeyStatus.String("error")

AttributeStatusError is "status=error".

View Source
var AttributeStatusOK = AttributeKeyStatus.String("ok")

AttributeStatusOK is "status=ok".

View Source
var CounterAuthflowSessionCreationCount = mustInt64Counter(
	"authgear.authflow_session.creation.count",
	metric.WithDescription("The number of creation of Authflow session"),
	metric.WithUnit("{session}"),
)
View Source
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

View Source
var CounterEmailRequestCount = mustInt64Counter(
	"authgear.email.request.count",
	metric.WithDescription("The number of email request"),
	metric.WithUnit("{request}"),
)

CounterEmailRequestCount has the following labels: - AttributeKeyStatus

View Source
var CounterOAuthAccessTokenRefreshCount = mustInt64Counter(
	"authgear.oauth_access_token.refresh.count",
	metric.WithDescription("The number of access token obtained via a refresh token"),
	metric.WithUnit("{token}"),
)
View Source
var CounterOAuthAuthorizationCodeConsumptionCount = mustInt64Counter(
	"authgear.oauth_authorization_code.consumption.count",
	metric.WithDescription("The number of consumption of OAuth authorization code"),
	metric.WithUnit("{code}"),
)
View Source
var CounterOAuthAuthorizationCodeCreationCount = mustInt64Counter(
	"authgear.oauth_authorization_code.creation.count",
	metric.WithDescription("The number of creation of OAuth authorization code"),
	metric.WithUnit("{code}"),
)
View Source
var CounterOAuthSessionCreationCount = mustInt64Counter(
	"authgear.oauth_session.creation.count",
	metric.WithDescription("The number of creation of OAuth session"),
	metric.WithUnit("{session}"),
)
View Source
var CounterSAMLSessionCreationCount = mustInt64Counter(
	"authgear.saml_session.creation.count",
	metric.WithDescription("The number of creation of SAML session"),
	metric.WithUnit("{session}"),
)
View Source
var CounterSMSRequestCount = mustInt64Counter(
	"authgear.sms.request.count",
	metric.WithDescription("The number of SMS request"),
	metric.WithUnit("{request}"),
)

CounterSMSRequestCount has the following labels: - AttributeKeyStatus

View Source
var CounterWebSessionCreationCount = mustInt64Counter(
	"authgear.web_session.creation.count",
	metric.WithDescription("The number of creation of Web session"),
	metric.WithUnit("{session}"),
)
View Source
var CounterWhatsappRequestCount = mustInt64Counter(
	"authgear.whatsapp.request.count",
	metric.WithDescription("The number of Whatsapp request"),
	metric.WithUnit("{request}"),
)

CounterWhatsappRequestCount has the following labels: - AttributeKeyStatus

View Source
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 SetClientID(ctx context.Context, clientID string)

func SetProjectID

func SetProjectID(ctx context.Context, projectID string)

Types

type HTTPInstrumentationMiddleware

type HTTPInstrumentationMiddleware struct {
	TrustProxy config.TrustProxy
}

func (*HTTPInstrumentationMiddleware) Handle

type IntCounter

type IntCounter interface {
	Add(ctx context.Context, incr int64, options ...metric.AddOption)
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL