mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 20:54:22 -06:00
cc3fc18076
* added packages reference menu item. * removed the draft flag. * Updated docs by running script.
6.7 KiB
6.7 KiB
+++
-----------------------------------------------------------------------
Do not edit this file. It is automatically generated by API Documenter.
-----------------------------------------------------------------------
title = "@grafana/runtime" keywords = ["grafana","documentation","sdk","@grafana/runtime"] type = "docs" +++
@grafana/runtime package
A library containing services, configurations etc. used to interact with the Grafana engine.
Classes
Class | Description |
---|---|
DataSourceWithBackend | Extend this class to implement a data source plugin that is depending on the Grafana backend API. |
GrafanaBootConfig |
Enumerations
Enumeration | Description |
---|---|
EchoEventType | Supported echo event types that can be sent via the EchoSrv. |
HealthStatus | Describes the current healt status of a data source plugin. |
MetaAnalyticsEventName | The meta analytics events that can be added to the echo service. |
Functions
Function | Description |
---|---|
getAngularLoader() | Used to retrieve the AngularLoader that enables the use of Angular components within a React component.Please see the AngularComponent for a proper example. |
getDataSourceSrv() | Used to retrieve the DataSourceSrv that is the entry point for communicating with a datasource that is added as a plugin (both external and internal). |
getEchoSrv() | Used to retrieve the EchoSrv that can be used to report events to registered echo backends. |
getLocationSrv() | Used to retrieve the LocationSrv that can be used to automatically navigate the user to a new place in Grafana. |
loadPluginCss(options) | Use this to load css for a Grafana plugin by specifying a PluginCssOptions containing styling for the dark and the light theme. |
Interfaces
Interface | Description |
---|---|
AngularComponent | Used to enable rendering of Angular components within a React component without losing proper typings. |
AngularLoader | Used to load an Angular component from the context of a React component. Please see the AngularComponent for a proper example. |
BackendSrv | Used to communicate via http(s) to a remote backend such as the Grafana backend, a datasource etc. The BackendSrv is using the Fetch API under the hood to handle all the communication.The request function can be used to perform a remote call by specifying a BackendSrvRequest. To make the BackendSrv a bit easier to use we have added a couple of shorthand functions that will use default values executing the request. |
DashboardInfo | Describes the basic dashboard information that can be passed as the meta analytics payload. |
DashboardViewEventPayload | Describes the payload of a dashboard view event. |
DataRequestEventPayload | Describes the payload of a data request event. |
DataRequestInfo | Describes the data request information passed as the meta analytics payload. |
DataSourceSrv | This is the entry point for communicating with a datasource that is added as a plugin (both external and internal). Via this service you will get access to the DataSourceApi that have a rich API for communicating with the datasource. |
EchoBackend | Describes echo backends that can be registered to receive of events. |
EchoEvent | Describes an echo event. |
EchoMeta | Describes the meta information that are sent together with each event. |
EchoSrv | Used to send events to all the registered backends. This should be accessed via the getEchoSrv() function. Will, by default, flush events to the backends every 10s or when the flush function is triggered. |
HealthCheckResult | Describes the payload returned when checking the health of a data source plugin. |
LocationSrv | If you need to automatically navigate the user to a new place in the application this should be done via the LocationSrv and it will make sure to update the application state accordingly. |
LocationUpdate | |
MetaAnalyticsEvent | Describes meta analytics event with predefined EchoEventType.MetaAnalytics type. |
PluginCssOptions | Option to specify a plugin css that should be applied for the dark and the light theme. |
SizeMeta | Describes a size with width/height |
TemplateSrv | Via the TemplateSrv consumers get access to all the available template variables that can be used within the current active dashboard.For a more in-depth description visit: https://grafana.com/docs/grafana/latest/reference/templating |
Variables
Variable | Description |
---|---|
config | Use this to access the GrafanaBootConfig for the current running Grafana instance. |
getBackendSrv | Used to retrieve the BackendSrv that can be used to communicate via http(s) to a remote backend such as the Grafana backend, a datasource etc. |
getTemplateSrv | Used to retrieve the TemplateSrv that can be used to fetch available template variables. |
registerEchoBackend | Used to register echo backends that will receive Grafana echo events during application runtime. |
reportMetaAnalytics | Helper function to report meta analytics to the EchoSrv. |
Type Aliases
Type Alias | Description |
---|---|
BackendSrvRequest | Used to initiate a remote call via the BackendSrv |
MetaAnalyticsEventPayload | Describes the meta analytics payload passed with the MetaAnalyticsEvent |