Comments (6)
As I mentioned earlier
the query result needs to contain a time field and a number field
In your case, you seem to have neither :)
- SensorValue is a string. The plugin would need to support parsing strings as numbers which it currently doesn't. If this is important to you, please create a feature request.
- In your screenshot, you don't seem to extract the SensorUpdateTime. You'd need to add another JSON Path query referencing the property you'd like to use for the timestamp.
from grafana-json-datasource.
Yeah, I already did that on a dashboard for the same data source with a custom JSON exporter (Here and here). That works good.
I wanted to do it only in grafana because I was planning to run the whole thing on a raspberry pi which is already overloaded with this, and don't think can handle prometheus too : ) + I don't need more than like 60 samples at best, so keeping historical data does not help. I think I can roll a JSON -> JSON stateful adapter to save those samples if I plan to use this.
Thanks for looking into this, greatly appreciated! Happy holidays!
from grafana-json-datasource.
To graph data in Grafana, the query result needs to contain a time field and a number field. The plugin detects time fields by checking if it's a valid ISO 8601 string, or if it looks like a UNIX epoch.
Let me know if you have trouble graphing data with this plugin!
from grafana-json-datasource.
Here is the sample data from the API below, and my JsonPath query is $[?(@.SensorName == "Physical Memory Used")].SensorValue
. (I tried the whole object too, $[?(@.SensorName == "Physical Memory Used")]
)
The SensorUpdateTime is indeed in Unix epoch time.
This is what I get on Grafana:
After switching to table view:
With the full object:
Let me know if I am doing something wrong here and thanks for looking into this!
[
{
"SensorApp": "HWiNFO",
"SensorClass": "System: MSI MS-7C92",
"SensorName": "Virtual Memory Commited",
"SensorValue": "13857",
"SensorUnit": "MB",
"SensorUpdateTime": 1609297850
},
{
"SensorApp": "HWiNFO",
"SensorClass": "System: MSI MS-7C92",
"SensorName": "Virtual Memory Available",
"SensorValue": "27028",
"SensorUnit": "MB",
"SensorUpdateTime": 1609297850
},
{
"SensorApp": "HWiNFO",
"SensorClass": "System: MSI MS-7C92",
"SensorName": "Virtual Memory Load",
"SensorValue": "33.8",
"SensorUnit": "%",
"SensorUpdateTime": 1609297850
},
{
"SensorApp": "HWiNFO",
"SensorClass": "System: MSI MS-7C92",
"SensorName": "Physical Memory Used",
"SensorValue": "10133",
"SensorUnit": "MB",
"SensorUpdateTime": 1609297850
}
]
from grafana-json-datasource.
Okay, I tried that. This recognizes the date format, but does not plot anything. When I said that JSON updates in real time, I meant that the JSON will only be for the current instance. It won't have data for the previous time instances.
So, I don't think this is possible with this data source, since I believe it is expecting the complete data to be sent over, rather than just the current data. My JSON source is sending data only for the current time instance, the next time you request, it would respond with new data.
from grafana-json-datasource.
Oh I see. Yeah, this plugin doesn't keep state at all. The JSON response need to contain the entire time series. If you want to store historical data, then I agree that something like Prometheus would be a better option 💯
from grafana-json-datasource.
Related Issues (20)
- Grafana API does not export panel annotations HOT 1
- Cannot see JSONAPI datasource in the plugin list HOT 1
- Chore: migrate to create plugin
- Suporte a paginação HOT 1
- Support multi-value variables HOT 1
- Dynamically adding fields for all JSON properties HOT 1
- Issue with multiple API calls from same chart HOT 1
- Grafana v9 - Button HOT 2
- README Shows Example that doesn't work at all [?(@.data > 'otherdata']
- Filtering in Jsonpath using Grafana multi-value variable? 'IN' operator supported? Or workarounds? HOT 1
- Audit and fix A11Y issues HOT 1
- Can't perform basic math with JSONata HOT 1
- Query error e.ArrayVector is not a constructor Getting this error after the new update. HOT 2
- Query error e.ArrayVector is not a constructor Getting this error after the new update HOT 3
- Support Sigv4 Auth
- A variable can't take another variable's value as a http request parameter if it starts with "1"
- Hope to support returning key value pairs as variables
- Show more details in console or query inspector
- TimeShift not working HOT 1
- JSON API: Bad Gateway HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grafana-json-datasource.