Ad

Is It Possible To Fetch Data From Influxdb Directly And Render It On Angular Dashboard?

I have an Instance of Influxdb running with few Databases & measurements which is storing machine generated data all the time and I want to fetch the Data from InfluxDb and render it on my Dashboard which is created in Angular without having an User-defined Api in between. I want to use the Influx api call to directly fetch Data from the database and no other api Calls as it increases time in getting the data.

Ad

Answer

Is it possible? Yes.

How is it possible? You can use the influxDB API to directly request data in Angular/Frontend.

Such a request looks like this:

curl -X GET \
  'https://example.com:8086/query?q=SELECT%20%22value%22%20FROM%20%22measurement_table%22%20WHERE%20%22device%22=%27PC123%27%20&db=machine_data'

A good explanation how to that with plotly (also JS), can be found here: https://dzone.com/articles/data-visualizations-with-influxdb-and-plotlyjs Documentation of the influxDB API https://docs.influxdata.com/influxdb/v1.7/tools/api/

Ad
source: stackoverflow.com
Ad