Documentation ¶
Overview ¶
Package instrumentation contains backend plugin instrumentation logic.
Index ¶
- Variables
- func InstrumentCallResourceRequest(ctx context.Context, req *backend.PluginContext, cfg Cfg, requestSize float64, ...) error
- func InstrumentCheckHealthRequest(ctx context.Context, req *backend.PluginContext, cfg Cfg, fn func() error) error
- func InstrumentCollectMetrics(ctx context.Context, req *backend.PluginContext, cfg Cfg, fn func() error) error
- func InstrumentQueryDataRequest(ctx context.Context, req *backend.PluginContext, cfg Cfg, requestSize float64, ...) error
- type Cfg
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 }
Click to show internal directories.
Click to hide internal directories.