gqlgenmetrics

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultInstrumentationName is the default used when creating meters.
	DefaultInstrumentationName = "github.com/mahboubii/gqlgenmetrics"
)

Variables

This section is empty.

Functions

func Middleware

func Middleware(options ...Option) middleware

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option applies an option value when creating a Handler.

func WithInstrumentRequestCount

func WithInstrumentRequestCount(instrumentRequestCount bool) Option

WithInstrumentRequestCount enable/disable reporting of 'gql.request.completed' metric enabled by default.

func WithInstrumentRequestDuration

func WithInstrumentRequestDuration(instrumentRequestDuration bool) Option

WithInstrumentRequestDuration enable/disable reporting of 'gql.request.duration' metric which is a histogram and could results in high cardinality. enabled by default.

func WithInstrumentResolverCount

func WithInstrumentResolverCount(instrumentResolverCount bool) Option

WithInstrumentResolverCount enable/disable reporting of 'gql.resolver.completes' metric. enabled by default.

func WithInstrumentResolverCustomOnly

func WithInstrumentResolverCustomOnly(instrumentResolverCustomOnly bool) Option

WithInstrumentResolverCustomOnly allows reducing cardinality of the 'gql.resolver.duration' and 'gql.resolver.completed' metrics by only reporting custom field resolvers. disabled by default.

func WithInstrumentResolverDuration

func WithInstrumentResolverDuration(instrumentResolverDuration bool) Option

WithInstrumentResolverDuration enable/disable reporting of 'gql.resolver.duration' metric which is a histogram and could results in high cardinality. enabled by default.

func WithInstrumentationName

func WithInstrumentationName(name string) Option

WithInstrumentationName returns an Option to set custom name for metrics scope.

func WithMeterProvider

func WithMeterProvider(p metric.MeterProvider) Option

WithMeterProvider returns an Option to use custom MetricProvider when creating metrics.

Jump to

Keyboard shortcuts

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