Documentation ¶
Index ¶
- func Middleware(next http.Handler, opts ...MiddlewareOption) http.Handler
- func NewGCPMeterProvider(ctx context.Context, projectID string) (*sdkmetric.MeterProvider, error)
- func NewGCPTracerProvider(ctx context.Context, projectID string, tracingRatio float64) (*sdktrace.TracerProvider, error)
- type Metrics
- type MiddlewareOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(next http.Handler, opts ...MiddlewareOption) http.Handler
Middleware is a simple OpenTelemetry HTTP middleware.
func NewGCPMeterProvider ¶
NewGCPMeterProvider returns a new OpenTelemetry MeterProvider with a Google Cloud Monitoring exporter.
func NewGCPTracerProvider ¶
func NewGCPTracerProvider(ctx context.Context, projectID string, tracingRatio float64) (*sdktrace.TracerProvider, error)
NewGCPTracerProvider returns a new OpenTelemetry TracerProvider with a Google Cloud Trace exporter.
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
NewMetrics returns a new Metrics instance.
func (*Metrics) IncreaseRequestCounter ¶
IncreaseRequestCounter increases the request counter by 1.
type MiddlewareOption ¶
type MiddlewareOption func(*middlewareOptions)
func WithExcludedPrefixes ¶
func WithExcludedPrefixes(prefixes []string) MiddlewareOption
WithExcludedPrefixes sets the excluded paths for the middleware.
Click to show internal directories.
Click to hide internal directories.