All Projects → grafana-tools → Sdk

grafana-tools / Sdk

Licence: apache-2.0
Library for using Grafana' structures in Go programs and client for Grafana REST API.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Sdk

Hastic Grafana App
Hastic data management server for labeling patterns and anomalies in Grafana
Stars: ✭ 166 (-13.99%)
Mutual labels:  monitoring, metrics, grafana
Grafana
The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
Stars: ✭ 45,930 (+23697.93%)
Mutual labels:  monitoring, metrics, grafana
Influxgraph
Graphite InfluxDB backend. InfluxDB storage finder / plugin for Graphite API.
Stars: ✭ 87 (-54.92%)
Mutual labels:  monitoring, metrics, grafana
Vos backend
vangav open source - backend; a backend generator (generates more than 90% of the code needed for big scale backend services)
Stars: ✭ 71 (-63.21%)
Mutual labels:  metrics, generator, client
Bigquery Grafana
Google BigQuery Datasource Plugin for Grafana.
Stars: ✭ 188 (-2.59%)
Mutual labels:  monitoring, metrics, grafana
Legacy Kubernetes App
Grafana App for Kubernetes
Stars: ✭ 76 (-60.62%)
Mutual labels:  monitoring, metrics, grafana
Pingprom
Prometheus uptime monitoring quickstart
Stars: ✭ 107 (-44.56%)
Mutual labels:  monitoring, metrics, grafana
Pgwatch2
PostgreSQL metrics monitor/dashboard
Stars: ✭ 960 (+397.41%)
Mutual labels:  monitoring, metrics, grafana
Stagemonitor
an open source solution to application performance monitoring for java server applications
Stars: ✭ 1,664 (+762.18%)
Mutual labels:  monitoring, metrics, grafana
Grafana Influx Dashboard
Grafana InfluxDB scripted dashboard
Stars: ✭ 130 (-32.64%)
Mutual labels:  monitoring, metrics, grafana
Grafanalib
Python library for building Grafana dashboards
Stars: ✭ 1,174 (+508.29%)
Mutual labels:  monitoring, grafana, dashboards
Github Monitoring
Monitor your GitHub Repos with Docker & Prometheus
Stars: ✭ 163 (-15.54%)
Mutual labels:  monitoring, metrics, grafana
Spring Boot Actuator Demo
Spring Boot Actuator: Health Check, Metrics Gathering, Auditing, and Monitoring
Stars: ✭ 61 (-68.39%)
Mutual labels:  monitoring, metrics, grafana
Internettools
XPath/XQuery 3.1 interpreter for Pascal with compatibility modes for XPath 2.0/XQuery 1.0/3.0, custom and JSONiq extensions, XML/HTML parsers and classes for HTTP/S requests
Stars: ✭ 82 (-57.51%)
Mutual labels:  json, parser, library
Infra Integrations Sdk
New Relic Infrastructure Integrations SDK
Stars: ✭ 42 (-78.24%)
Mutual labels:  sdk, monitoring, metrics
Flickr Sdk
Almost certainly the best Flickr API client in the world for node and the browser
Stars: ✭ 104 (-46.11%)
Mutual labels:  json, sdk, client
Swagger Stats
API Observability. Trace API calls and Monitor API performance, health and usage statistics in Node.js Microservices.
Stars: ✭ 559 (+189.64%)
Mutual labels:  monitoring, metrics, grafana
Prometheus
Kubernetes Setup for Prometheus and Grafana
Stars: ✭ 824 (+326.94%)
Mutual labels:  monitoring, metrics, grafana
Heplify Server
HEP Capture Server
Stars: ✭ 110 (-43.01%)
Mutual labels:  monitoring, metrics, grafana
Appmetrics
App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application.
Stars: ✭ 1,986 (+929.02%)
Mutual labels:  monitoring, metrics, grafana

Grafana SDK Go Report Card

SDK for Go language offers a library for interacting with Grafana server from Go applications. It realizes many of HTTP REST API calls for administration, client, organizations. Beside of them it allows creating of Grafana objects (dashboards, panels, datasources) locally and manipulating them for constructing dashboards programmatically. It would be helpful for massive operations on a large set of Grafana objects.

It was made foremost for autograf project but later separated from it and moved to this new repository because the library is useful per se.

Library design principles

  1. SDK offers client functionality so it covers Grafana REST API with its requests and responses as close as possible.
  2. SDK maps Grafana objects (dashboard, row, panel, datasource) to similar Go structures but not follows exactly all Grafana abstractions.
  3. It doesn't use any logger, instead API functions could return errors where it need.
  4. Prefere no external deps except Go stdlib.
  5. Cover SDK calls with unit tests.

Examples GoDoc

	board := sdk.NewBoard("Sample dashboard title")
	board.ID = 1
	row1 := board.AddRow("Sample row title")
	row1.Add(sdk.NewGraph("Sample graph"))
	graph := sdk.NewGraph("Sample graph 2")
	target := sdk.Target{
		RefID:      "A",
		Datasource: "Sample Source 1",
		Expr:       "sample request 1"}
	graph.AddTarget(&target)
	row1.Add(graph)
	grafanaURL := "http://grafana.host"
	c := sdk.NewClient(grafanaURL, "grafana-api-key", sdk.DefaultHTTPClient)
	response, err := c.SetDashboard(context.TODO() ,*board, sdk.SetDashboardParams{
		Overwrite: false,
	})
	if err != nil {
		fmt.Printf("error on uploading dashboard %s", board.Title)
	} else {
		fmt.Printf("dashboard URL: %v", grafanaURL+*response.URL)
	}

The library includes several demo apps for showing API usage:

You need Grafana API key with admin rights for using these utilities.

Installation Build Status

Of course Go development environment should be set up first. Then:

go get github.com/grafana-tools/sdk

Dependency packages have included into distro. govendor utility used for vendoring. The single dependency now is:

go get github.com/gosimple/slug

The "slugify" for URLs is a simple task but this package used in Grafana server so it used in the SDK for the compatibility reasons.

Status of REST API realization Coverage Status

Work on full API implementation still in progress. Currently implemented only create/update/delete operations for dashboards and datasources. State of support for misc API parts noted below.

API Status
Authorization API tokens and Basic Auth
Annotations partially
Dashboards partially
Datasources +
Alert notification channels +
Organization (current) partially
Organizations partially
Users partially
User (actual) partially
Snapshots -
Frontend settings -
Admin partially

There is no exact roadmap. The integration tests are being run against the following Grafana versions:

With the following Go versions:

  • 1.14.x
  • 1.13.x
  • 1.12.x
  • 1.11.x

I still have interest to this library development but not always have time for it. So I gladly accept new contributions. Drop an issue or contact me.

Licence

Distributed under Apache v2.0. All rights belong to the SDK authors. There is no authors list yet, you can see the full list of the contributors in the git history. Official repository is https://github.com/grafana-tools/sdk

Collection of Grafana tools in Golang

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].