Documentation ¶
Index ¶
- Constants
- func Middleware(options ...Option) middleware
- type Option
- func WithInstrumentRequestCount(instrumentRequestCount bool) Option
- func WithInstrumentRequestDuration(instrumentRequestDuration bool) Option
- func WithInstrumentResolverCount(instrumentResolverCount bool) Option
- func WithInstrumentResolverCustomOnly(instrumentResolverCustomOnly bool) Option
- func WithInstrumentResolverDuration(instrumentResolverDuration bool) Option
- func WithInstrumentationName(name string) Option
- func WithMeterProvider(p metric.MeterProvider) Option
Constants ¶
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 ¶
WithInstrumentRequestCount enable/disable reporting of 'gql.request.completed' metric enabled by default.
func WithInstrumentRequestDuration ¶
WithInstrumentRequestDuration enable/disable reporting of 'gql.request.duration' metric which is a histogram and could results in high cardinality. enabled by default.
func WithInstrumentResolverCount ¶
WithInstrumentResolverCount enable/disable reporting of 'gql.resolver.completes' metric. enabled by default.
func WithInstrumentResolverCustomOnly ¶
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 ¶
WithInstrumentResolverDuration enable/disable reporting of 'gql.resolver.duration' metric which is a histogram and could results in high cardinality. enabled by default.
func WithInstrumentationName ¶
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.