Plugins 〉WebSocket API
WebSocket API
WebSocket Data Source for Grafana
A WebSocket data source plugin for realtime data updates in Grafana Dashboards.
Plugin Purpose
This plugin allows you to connect a WebSocket endpoint as a Data Source for your Grafana dashboard. Unlike REST APIs, WebSockets automatically update as soon as new data is available from the source, without having to periodically fetch data from it.
How it works
When a WebSocket endpoint is added as a data source in Grafana, the plugin will open the WebSocket connection with the source API and keep it open. When there is new data, the WebSocket endpoint will send it directly to the plugin through the open WebSocket connection and your dashboard will be updated automatically.
Using the WebSocket Data Source
Here are the steps to configure and use the WebSocket Data Source Plugin in Grafana.
Configure Data Source
Add the WebSocket data source plugin in Grafana
- Click the gear icon on the left sidebar and choose "data sources"
- Click "Add data source"
- Scroll to the bottom and chose "WebSocket API" in the "Others" category.
Configure WebSocket endpoint information
- WebSocket Host (use this format):
wss://your-host/some/prefix-path
- Add Query Parameters and Custom Headers if necessary (consult your WebSocket API data source). This example shows the use of an API key.
- WebSocket Host (use this format):
Add a panel to the Grafana Dashboard to begin seeing data
- Click
+
in the left sidebar. Choose "Dashboard" --> "Add a new panel" - Select
WebSocket API
as Data Source in the select drop-down - In the bottom left, set the "Fields" tab to
$
- Click the "Path" tab and set the path (if necessary) of the websocket endpoint that you want to connect
- Above the panel, click the "Table view" toggle at the top of the window
- Any data coming from the WebSocket Endpoint will be shown as JSON in the panel
- Click
Customizing Your Data View
Once you have confirmed that you are receiving realtime data, it can be visualized:
Make sure that Table View is turned off and choose any kind of compatible graphic from the upper right "Visualizations" list.
Choose "Last 5 minutes" from the time selection window in the upper right corner of the graph.
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
.h4 . .mb-0 }
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Installing WebSocket API on Grafana Cloud:
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
For more information, visit the docs on plugin installation.
Installing on a local Grafana:
For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.
1. Install the Data Source
Use the grafana-cli tool to install WebSocket API from the commandline:
grafana-cli plugins install
The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.
Alternatively, you can manually download the .zip file for your architecture below and unpack it into your grafana plugins directory.
Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory.
2. Configure the Data Source
Accessed from the Grafana main menu, newly installed data sources can be added immediately within the Data Sources section.
Next, click the Add data source button in the upper right. The data source will be available for selection in the Type select box.
To see a list of installed data sources, click the Plugins item in the main menu. Both core data sources and installed data sources will appear.
Changelog
1.0.2
- update plugin's description and bump toolkit version
1.0.1
- add links at the plugin.jon pointing to the license and to the repo.
1.0.0
Golioth's WebSocket Data Source Plugin Launch
The main focus on this release is to launch the new websocket data source plugin for the Grafana Community.