Documentationbreadcrumb arrow Pluginsbreadcrumb arrow Business Chartsbreadcrumb arrow Exploring Grafana events
Grafana Cloud Enterprise Open source

Exploring Grafana events

Grafana leverages an event bus to broadcast application events, enabling different parts of the system to respond when a user interacts with the interface. This mechanism facilitates real-time communication across components.

Here’s a basic example of subscribing to an event:

js
const subscription = eventBus.subscribe({ type: "data-hover" }, () => 
  console.log("Data hovered");
});

return () => {
  subscription.unsubscribe();
};

Predefined events

The Grafana EventBus supports a variety of predefined events. Following is a list of key events and their purposes:

EventDescription
absolute-timeTriggered when a user selects an absolute time range on the dashboard
annotation-eventFired when an annotation is created, updated, or deleted
annotation-query-finishedOccurs after an annotation query completes
annotation-query-startedOccurs when an annotation query begins
copy-panelInitiated to copy a panel’s JSON to local storage
dashboard-loadedFired when a dashboard finishes loading
dashboard-savedTriggered after a dashboard is saved
data-hoverOccurs when hovering over a legend or data point with shared crosshair enabled
data-hover-clearFired when the user stops hovering over a data point with shared crosshair enabled
data-selectTriggered when a user selects a data point on a panel
datasource-updated-successfullyFired when a data source update succeeds
panel-edit-finishedOccurs when a user finishes editing a panel
panel-edit-startedTriggered when a user begins editing a panel
refreshFired when a dashboard is refreshed
renderOccurs when a dashboard is rendered
shift-timeTriggered when the dashboard’s time range shifts
theme-changedFired when the theme settings are modified
time-range-updatedOccurs when the time range is updated
variables-changedTriggered when dashboard variable values change
variables-changed-in-urlFired when variable values in the URL are updated
variables-time-range-process-doneOccurs when the time range processing for variables completes
zoom-outTriggered when the user zooms out the time range

The Grafana EventBus is a powerful tool for developers looking to create dynamic, responsive plugins. By subscribing to predefined events—or even defining your own—you can build interconnected dashboards that react instantly to user actions.

Whether you’re enhancing visualizations or enabling cross-panel communication, mastering the EventBus unlocks a new level of flexibility and control in Grafana development.