Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateSchemaUsageInfoBatch ¶
func AggregateSchemaUsageInfoBatch(batch []*graphqlmetrics.SchemaUsageInfo) *graphqlmetrics.PublishAggregatedGraphQLRequestMetricsRequest
Types ¶
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
func NewExporter ¶
func NewExporter(logger *zap.Logger, client graphqlmetricsv1connect.GraphQLMetricsServiceClient, apiToken string, settings *ExporterSettings) (*Exporter, error)
NewExporter creates a new GraphQL metrics exporter. The collectorEndpoint is the endpoint to which the metrics are sent. The apiToken is the token used to authenticate with the collector. The collector supports Brotli compression and retries on failure. Underling queue implementation sends batches of metrics at the specified interval and batch size.
func (*Exporter) RecordUsage ¶
func (e *Exporter) RecordUsage(usageInfo *graphqlmetrics.SchemaUsageInfo, synchronous bool) (ok bool)
type ExporterSettings ¶
type ExporterSettings struct { // BatchSize is the maximum number of items to be sent in a single batch. BatchSize int // QueueSize is the maximum number of batches allowed in queue at a given time. QueueSize int // Interval is the interval at which the queue is flushed. Interval time.Duration // Retry is the retry options for the exporter. RetryOptions RetryOptions // ExportTimeout is the timeout for the export request. ExportTimeout time.Duration }
func NewDefaultExporterSettings ¶
func NewDefaultExporterSettings() *ExporterSettings
Click to show internal directories.
Click to hide internal directories.