plugin

package
v0.0.0-...-7f9ff31 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const ChannelCacheSizeMB = 64
View Source
const DefaultCacheSizeMB = 1024
View Source
const DefaultHttpTimeout = 60
View Source
const MinimalCacheSizeMB = 128
View Source
const SdsDelay = 5 * time.Second
View Source
const TimeSeriesType = "TimeSeries"

Variables

This section is empty.

Functions

func NewRMFDatasource

func NewRMFDatasource(ctx context.Context, settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error)

NewRMFDatasource creates a new instance of the RMF datasource.

Types

type Config

type Config struct {
	URL       string
	Timeout   int
	CacheSize int
	Username  string
	Password  string
	JSON      struct {
		// Conventional Grafana HTTP config (see the `DataSourceHttpSettings` UI element)
		TimeoutRaw         string `json:"timeout"`
		TlsSkipVerify      bool   `json:"tlsSkipVerify"`
		DisableCompression bool   `json:"disableCompression"`
		// Custom RMF settings.
		CacheSizeRaw string `json:"cacheSize"`
		// Legacy custom RMF settings. We should ge rid of these at some point.
		Server     *string `json:"path"`
		Port       string  `json:"port"`
		SSL        bool    `json:"ssl"`
		Username   string  `json:"userName"`
		Password   string  `json:"password"`
		SSLVerify  bool    `json:"skipVerify"` // NB: the meaning of JSON field is inverted.
		OmegamonDs string  `json:"omegamonDs"`
	}
}

type RMFDatasource

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

func (*RMFDatasource) CallResource

func (*RMFDatasource) CheckHealth

func (ds *RMFDatasource) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (retRes *backend.CheckHealthResult, _ error)

CheckHealth handles health checks sent from Grafana to the plugin. The main use case for these health checks is the test button on the datasource configuration page which allows users to verify that a datasource is working as expected.

func (*RMFDatasource) Dispose

func (ds *RMFDatasource) Dispose()

Dispose here tells plugin SDK that plugin wants to clean up resources when a new instance created. As soon as datasource settings change detected by SDK old datasource instance will be disposed and a new one will be created using NewRMFClient factory function.

func (*RMFDatasource) PublishStream

PublishStream is called when a client sends a message to the stream.

func (*RMFDatasource) QueryData

func (ds *RMFDatasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (qr *backend.QueryDataResponse, errRet error)

QueryData handles multiple queries and returns multiple responses. req contains the queries []DataQuery (where each query contains RefID as a unique identifier). The QueryDataResponse contains a map of RefID to the response for each query, and each response contains Frames ([]*Frame).

func (*RMFDatasource) RunStream

func (ds *RMFDatasource) RunStream(ctx context.Context, req *backend.RunStreamRequest, sender *backend.StreamSender) error

RunStream is called once for any open channel. Results are shared with everyone subscribed to the same channel.

func (*RMFDatasource) SubscribeStream

SubscribeStream is called when a client wants to connect to a stream. This callback allows sending the first message.

type RequestParams

type RequestParams struct {
	Resource struct {
		Value string `json:"value"`
	} `json:"selectedResource"`
	AbsoluteTime bool   `json:"absoluteTimeSelected"`
	VisType      string `json:"selectedVisualisationType"`
}

type VariableQueryRequest

type VariableQueryRequest struct {
	Query string `json:"query"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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