This is likely to be the longest method implemented depending on how much logic is involved querying your source data. In our example here, we see how the request can be parsed and an example of the kind of data that could be returned. All it needs to do is return a status code 200 OK. This endpoint is used when configuring a datasource in Grafana and clicking on the “Save & Test” button. The first endpoint that needs to be provided is /. The repo I created has instructions for getting Grafana running locally, and getting the Flask server running and configured in Grafana. There are three endpoints that need to be created for the datasource to be useful and three others for added functionality. The code I have created for this tutorial can be found here. The writings I found about using the Simple JSON datasource seemed to be either too in depth or too light, so I decided I would write a basic overview of its functionality and provide an interactive tutorial to drill points home. I already had a way to get the result using Python so it seemed serendipitous that this post described how to use Flask and the Grafana Simple JSON datasource plugin to make it all come together. I figured there must be a way to pull generic data from any source in Grafana and a quick search on Google lead me to this blog post. The problem was that I was able to get the result I wanted in Python, but was unsure how I could visualize that data in Grafana. ![]() The transformations needed of the data were very complex in pure SQL and I had implemented a better performing implementation in Python. I was working on a project where I was creating time series data based on data stored in Postgres.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |