github.com/clambin/simplejson (go): Package simplejson provides a Go implementation for Grafana's SimpleJSON datasource: https://grafana.com/grafana/plugins/grafana-simple-json-datasource  A simplejson server is an HTTP server that supports one or more handlers.  Each handler can support multiple targets, each of which can be supported by a timeseries or table query.  Optionally tags can be used to alter the behaviour of the query (e.g. filtering what data should be returned).  Finally, a handler can support annotation, i.e. a set of timestamps with associated text.  To create a SimpleJSON server, create a Server and run it:  This starts a server, listening on port 8080, with one target "my-target", served by myHandler.  A handler serves incoming requests from Grafana, e.g. queries, requests for annotations or tags. The Handler interface contains all functions a handler needs to implement. It contains only one function (Endpoints). This function returns the Grafana SimpleJSON endpoints that the handler supports. Those can be:  Here's an example of a handler that supports timeseries queries:  Timeseries queries return values as a list of timestamp/value tuples. Here's an example of a timeseries query handler:  Table Queries, on the other hand, return data organized in columns and rows.  Each column needs to have the same number of rows:  simplejson exports two Prometheus metrics for performance analytics:  For information on query arguments, annotation and tags, refer to the documentation for those data structures.
Keywords: grafana|simplejson