metrics

package
v0.0.0-...-6d13c91 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Namespace missing godoc
	Namespace = "compass"
	// DirectorSubsystem missing godoc
	DirectorSubsystem = "director"
	// TenantFetcherSubsystem missing godoc
	TenantFetcherSubsystem = "tenantfetcher"
	// TenantFetcherJobName missing godoc
	TenantFetcherJobName = TenantFetcherSubsystem
	// InstanceIDKeyName missing godoc
	InstanceIDKeyName = "instance"
	// OrdAggregatorSubsystem is used in the metrics pusher configuration as value for key 'subsystem'
	OrdAggregatorSubsystem = "ordaggregator"
	// ErrorMetricLabel is the error label used by metrics config for creating CounterVec for Prometheus
	ErrorMetricLabel = "error"
	// ResourceIDMetricLabel is an additional label used by ord aggregator for creating CounterVec for Prometheus
	ResourceIDMetricLabel = "resource_id"
	// ResourceTypeMetricLabel is an additional label used by ord aggregator for creating CounterVec for Prometheus
	ResourceTypeMetricLabel = "resource_type"
	// CorrelationIDMetricLabel is an additional label used by ord aggregator for creating CounterVec for Prometheus
	CorrelationIDMetricLabel = "x_request_id"
)

Variables

This section is empty.

Functions

func NewInstrumentGraphqlRequestInterceptor

func NewInstrumentGraphqlRequestInterceptor(graphqlRequestInstrumenter GraphqlRequestInstrumenter) *instrumentGraphqlRequestInterceptor

NewInstrumentGraphqlRequestInterceptor creates a new InstrumentGraphqlRequestInterceptor instance

Types

type AggregationFailurePusher

type AggregationFailurePusher struct {
	// contains filtered or unexported fields
}

AggregationFailurePusher is used for pushing metrics to Prometheus related to failed aggregation.

func NewAggregationFailurePusher

func NewAggregationFailurePusher(cfg PusherConfig) AggregationFailurePusher

NewAggregationFailurePusher returns a new Prometheus metrics pusher that can be used to report aggregation failures.

func (AggregationFailurePusher) ReportAggregationFailure

func (p AggregationFailurePusher) ReportAggregationFailure(ctx context.Context, err error)

ReportAggregationFailure reports failed aggregation with the provided error.

func (AggregationFailurePusher) ReportAggregationFailureORD

func (p AggregationFailurePusher) ReportAggregationFailureORD(ctx context.Context, err string)

ReportAggregationFailureORD reports failed aggregation with the provided error. copy

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

Collector missing godoc

func NewCollector

func NewCollector(config Config) *Collector

NewCollector missing godoc

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

Collect missing godoc

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

Describe missing godoc

func (*Collector) GraphQLHandlerWithInstrumentation

func (c *Collector) GraphQLHandlerWithInstrumentation(handler http.Handler) http.HandlerFunc

GraphQLHandlerWithInstrumentation missing godoc

func (*Collector) InstrumentGraphqlRequest

func (c *Collector) InstrumentGraphqlRequest(operationType, operationName string)

InstrumentGraphqlRequest instruments a graphql request given operationName and operationType

func (*Collector) InstrumentOAuth20HTTPClient

func (c *Collector) InstrumentOAuth20HTTPClient(client *http.Client)

InstrumentOAuth20HTTPClient missing godoc

type Config

type Config struct {
	EnableGraphqlOperationInstrumentation bool `envconfig:"default=false,APP_METRICS_ENABLE_GRAPHQL_OPERATION_INSTRUMENTATION"`
}

Config configures the behaviour of the metrics collector.

type GraphqlRequestInstrumenter

type GraphqlRequestInstrumenter interface {
	InstrumentGraphqlRequest(queryType, queryOperation string)
}

GraphqlRequestInstrumenter collects metrics for GraphQL requests usage per enpoint.

type PusherConfig

type PusherConfig struct {
	Enabled    bool
	Endpoint   string
	MetricName string
	Timeout    time.Duration
	Subsystem  string
	Labels     []string
}

PusherConfig is used to provide configuration options for AggregationFailurePusher.

Jump to

Keyboard shortcuts

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