instrumentation

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package instrumentation contains backend plugin instrumentation logic.

Index

Constants

This section is empty.

Variables

View Source
var (
	PluginRequestDurationSeconds = promauto.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: "grafana",
		Name:      "plugin_request_duration_seconds",
		Help:      "Plugin request duration in seconds",
		Buckets:   []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25},
	}, []string{"source", "plugin_id", "endpoint", "status", "target"})
)

Functions

func InstrumentCallResourceRequest

func InstrumentCallResourceRequest(ctx context.Context, req *backend.PluginContext, cfg Cfg, requestSize float64, fn func() error) error

InstrumentCallResourceRequest instruments callResource.

func InstrumentCheckHealthRequest

func InstrumentCheckHealthRequest(ctx context.Context, req *backend.PluginContext, cfg Cfg, fn func() error) error

InstrumentCheckHealthRequest instruments checkHealth.

func InstrumentCollectMetrics

func InstrumentCollectMetrics(ctx context.Context, req *backend.PluginContext, cfg Cfg, fn func() error) error

InstrumentCollectMetrics instruments collectMetrics.

func InstrumentQueryDataRequest

func InstrumentQueryDataRequest(ctx context.Context, req *backend.PluginContext, cfg Cfg,
	requestSize float64, fn func() error) error

InstrumentQueryDataRequest instruments success rate and latency of query data requests.

Types

type Cfg

type Cfg struct {
	LogDatasourceRequests bool
	Target                backendplugin.Target
}

Jump to

Keyboard shortcuts

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