Skip to main content

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

EventDescription
absolute-timeCalled when the user selects an absolute time range on the dashboard.
annotation-eventCalled when an annotation event occurs, such as when an annotation is created, updated, or deleted.
annotation-query-finishedCalled when an annotation query has finished executing.
annotation-query-startedCalled when an annotation query has started executing.
copy-panelCalled to copy a panel JSON into local storage.
dashboard-loadedCalled when a dashboard is loaded.
dashboard-savedCalled when a dashboard is saved.
data-hoverHovering over Legend and data point when shared crosshair enabled.
data-hover-clearCalled when the user stops hovering over a data point on a panel when shared crosshair enabled.
data-selectCalled when the user selects a data point on a panel.
datasource-updated-successfullyCalled when a datasource is successfully updated.
panel-edit-finishedCalled when the user finishes editing a panel.
panel-edit-startedCalled When the user starts editing a panel.
refreshCalled when a dashboard is refreshed.
renderCalled when a dashboard is rendered
shift-timeCalled when the time shifts range on the dashboard.
theme-changedCalled when the theme settings change.
time-range-updatedCalled when time range is updated.
variables-changedCalled when the variable values on the dashboard are changed.
variables-changed-in-urlCalled when the variable values in the URL are changed.
variables-time-range-process-doneCalled when the time range for variables in the dashboard is processed.
zoom-outCalled when use time range zoom out.

Panels interconnectivity in Grafana via EventBus

This article describes the possibility of using ECharts Instance, Grafana Events, and Extended Result for panel communication by sending and receiving events in Grafana.