Grafana events (EventBus)
Grafana uses an event bus to publish application events to notify different parts of Grafana when the user acts.
const subscription = eventBus.subscribe({ type: "data-hover" }, () => {
console.log("Data hovered.");
});
return () => {
subscription.unsubscribe();
};
Predefined Events
Event | Description |
---|---|
absolute-time | Called when the user selects an absolute time range on the dashboard. |
annotation-event | Called when an annotation event occurs, such as when an annotation is created, updated, or deleted. |
annotation-query-finished | Called when an annotation query has finished executing. |
annotation-query-started | Called when an annotation query has started executing. |
copy-panel | Called to copy a panel JSON into local storage. |
dashboard-loaded | Called when a dashboard is loaded. |
dashboard-saved | Called when a dashboard is saved. |
data-hover | Hovering over Legend and data point when shared crosshair enabled. |
data-hover-clear | Called when the user stops hovering over a data point on a panel when shared crosshair enabled. |
data-select | Called when the user selects a data point on a panel. |
datasource-updated-successfully | Called when a datasource is successfully updated. |
panel-edit-finished | Called when the user finishes editing a panel. |
panel-edit-started | Called When the user starts editing a panel. |
refresh | Called when a dashboard is refreshed. |
render | Called when a dashboard is rendered. |
shift-time | Called when the time shifts range on the dashboard. |
theme-changed | Called when the theme settings change. |
time-range-updated | Called when time range is updated. |
variables-changed | Called when the variable values on the dashboard are changed. |
variables-changed-in-url | Called when the variable values in the URL are changed. |
variables-time-range-process-done | Called when the time range for variables in the dashboard is processed. |
zoom-out | Called when use time range zoom out. |
Panels interconnectivity in Grafana via EventBus
This article describes the possibility of using Business Charts, Grafana Events, and Extended Result for panel communication by sending and receiving events in Grafana.