Documentation ¶
Index ¶
- Constants
- func NewInstrumentGraphqlRequestInterceptor(graphqlRequestInstrumenter GraphqlRequestInstrumenter) *instrumentGraphqlRequestInterceptor
- type AggregationFailurePusher
- type Collector
- func (c *Collector) Collect(ch chan<- prometheus.Metric)
- func (c *Collector) Describe(ch chan<- *prometheus.Desc)
- func (c *Collector) GraphQLHandlerWithInstrumentation(handler http.Handler) http.HandlerFunc
- func (c *Collector) InstrumentGraphqlRequest(operationType, operationName string)
- func (c *Collector) InstrumentOAuth20HTTPClient(client *http.Client)
- type Config
- type GraphqlRequestInstrumenter
- type PusherConfig
Constants ¶
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 (*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 ¶
InstrumentGraphqlRequest instruments a graphql request given operationName and operationType
func (*Collector) InstrumentOAuth20HTTPClient ¶
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.