How used grafana-websocket-plugin get data from Binance websocket API

im used grafana-websocket-plugin get data from Binance Websocket API
but always show the loading no data income

THANK YOU!!

Hi @deluxelinux,

Welcome to the :grafana: community support forums !!

We are excited that you joined our OSS community. Please read about some of the FAQs in the community :slight_smile:

I checked about this plugin (if this is one you are asking about) and it seems to be a community plugin as described on the plugin page (that means, it is not maintained by us).

Therefore, the suggestion would be check their GitHub page and ask for help.

I still did found these blog posts which explains as how to use this plugin.

1- Using WebSockets with Grafana - Golioth
2- How to use WebSockets to visualize real-time IoT data in Grafana | Grafana Labs

I hope this is helpful.

1 Like

Thank you so much for your help!
But currently, we are still unable to obtain data!
use Grafana version is v10.0.0 I installed it locally in Windows 11
Using Access localhost:3000
Does Grafana have an official Websocket plugin available for use?

What kind of data do you have e.g. JSON, CSV etc?

And is it accessible via API e.g. curl command?

JSON data
Example:
wss://fstream.binance.com/ws/bnbusdt@aggTrade
i Grafana get the Binance websocket API but always show loading no data income




same issue!

grafana is endless loading on the data tab at inspect

anybody got a solution for this problem?

Hi @misshoneybee and @tradebotv12

Do you need to define any API-Key and Token for authentication for e.g. using this websocket:
wss://fstream.binance.com/ws/bnbusdt@aggTrade

nope, I am able to connect to this stream without any api key or token if I only use a browser console and I get the desired data as json streamed

Thanks for the quick reply.

Yes, I tested this WSS URL and seems to get live stream of data without any Auth.

While using the WebSocket Plugin, I was getting the same issue as you describe.

As this confirms that there is an issue (bug), please report it as described earlier:

I hope this helps.

will do, thank you very much!

you could also try out Dynamic Text using javascript handlers to get your data

handlebars.registerHelper("where_my_money_at", () => {
  let binance_socket = new WebSocket("wss://fstream.binance.com/ws/bnbusdt@aggTrade");

  let result;

  binance_socket.onmessage = (event) => {

    result = JSON.parse(event.data);
  }
  //binance_socket.close();
  return result;
});

@yosiasz That’s interesting. You can avoid using helpers and subscribe to the socket directly. You need to close the connection similar to the Grafana Events code: Grafana Events | Volkov Labs

You can take it a step further to broadcast Grafana Events to other panels using Event Bus.

The other option is to implement the same code in Apache ECharts and broadcast and/or display data as Time Series or Candlesticks.

The Websocket plugin is tricky to use and sometimes it’s not clear what the issue is. We used it for a couple of projects and it was challenging in both cases.

1 Like