All Projects → appnexus → grafana-api-java-client

appnexus / grafana-api-java-client

Licence: other
A simple java client for interacting with Grafana using a fluent interface.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to grafana-api-java-client

grafana-redis-app
Redis Application for @grafana provides Application pages and custom panels for Redis Data Source.
Stars: ✭ 23 (-42.5%)
Mutual labels:  grafana
zabbix-monitor
monitor system based on zabbix API pyzaabix grafana
Stars: ✭ 70 (+75%)
Mutual labels:  grafana
monasca-docker
Docker files and setup for Monasca
Stars: ✭ 24 (-40%)
Mutual labels:  grafana
grafana-redis-datasource
Redis Data Source for @grafana allows connecting to any @redis database On-Premises and in the Cloud.
Stars: ✭ 107 (+167.5%)
Mutual labels:  grafana
alexandra-trackmap-panel
Grafana map plugin to visualise coordinates as markers, hexbin, ant path, or heatmap.
Stars: ✭ 58 (+45%)
Mutual labels:  grafana
octane-exporter
Export Laravel Octane metrics using this Prometheus exporter.
Stars: ✭ 14 (-65%)
Mutual labels:  grafana
grafana-pnp-datasource
PNP4Nagios/RRD Datasource for Grafana
Stars: ✭ 27 (-32.5%)
Mutual labels:  grafana
webperf-dashboard
Web Performance Dashboard forked from https://github.com/boyney123/garie
Stars: ✭ 51 (+27.5%)
Mutual labels:  grafana
redis-modules-java
Java client libraries for redis-modules https://redis.io/modules, based on Redisson. https://github.com/redisson/redisson
Stars: ✭ 57 (+42.5%)
Mutual labels:  java-client
grafana-plugin-template-webpack
Template project for developing plugins for Grafana with Webpack
Stars: ✭ 34 (-15%)
Mutual labels:  grafana
jmeterReports
Jmeter autogenerater reports after test to Confluence, using grafana custom dushboards.
Stars: ✭ 23 (-42.5%)
Mutual labels:  grafana
wp-api-v2-client-java
WP-API v2 Java Client
Stars: ✭ 72 (+80%)
Mutual labels:  java-client
grafana-ng
Grafana on .net core + angular.
Stars: ✭ 51 (+27.5%)
Mutual labels:  grafana
remote-storage-wars
Prometheus remote storages playground
Stars: ✭ 22 (-45%)
Mutual labels:  grafana
microservices-observability
🎉 Microservices Observability - Log Aggregation, Distributed Tracking, Metrics
Stars: ✭ 40 (+0%)
Mutual labels:  grafana
grafana-operator
Grafana Operator creates and manages Grafana deployments on Kubernetes.
Stars: ✭ 18 (-55%)
Mutual labels:  grafana
darksky2influxdb
Stores wheather forcecast data from darkskyapi into a influxdb database
Stars: ✭ 21 (-47.5%)
Mutual labels:  grafana
grafana
Grafana dashboard for Veeam solutions
Stars: ✭ 31 (-22.5%)
Mutual labels:  grafana
histou
Adds templates to Grafana in combination with nagflux
Stars: ✭ 33 (-17.5%)
Mutual labels:  grafana
epiphany
Cloud and on-premises automation for Kubernetes centered industrial grade solutions.
Stars: ✭ 114 (+185%)
Mutual labels:  grafana

Grafana Client Build Status

A simple java client for interacting with Grafana using a fluent interface.

Usage

Simple Example:

import com.appnexus.grafana.client.GrafanaClient;

//Setup the client
GrafanaConfiguration grafanaConfiguration =
        new GrafanaConfiguration().host("your_grafana_host").apiKey("Bearer your_secret_key");
GrafanaClient grafanaClient = new GrafanaClient(grafanaConfiguration);

//Setup the dashboard
String DASHBOARD_NAME = "new_dashboard";

Dashboard dashboard = new Dashboard()
      .title(DASHBOARD_NAME)
      .version(0);

GrafanaDashboard grafanaDashboard = new GrafanaDashboard().dashboard(dashboard);

//Make API calls
grafanaClient.createDashboard(grafanaDashboard);

grafanaClient.getDashboard(DASHBOARD_NAME);

grafanaClient.deleteDashboard(DASHBOARD_NAME);

Here is a more complex example that sets up a Grafana dashboard with a panel and row:

import com.appnexus.grafana.client.GrafanaClient;

//Setup the client
GrafanaConfiguration grafanaConfiguration =
        new GrafanaConfiguration().host("your_grafana_host").apiKey("Bearer your_secret_key");
GrafanaClient grafanaClient = new GrafanaClient(grafanaConfiguration);

//Setup the dashboard
String DASHBOARD_NAME = "new_dashboard";

DashboardPanelTarget dashboardPanelTarget =
    new DashboardPanelTarget().refId("getSomeMetric").target("*");

DashboardPanelXAxis dashboardPanelXAxis =
    new DashboardPanelXAxis().show(true).mode(DashboardPanelXAxis.Mode.TIME);

DashboardPanelYAxis dashboardPanelYAxis =
    new DashboardPanelYAxis().format(DashboardPanelYAxis.Format.SHORT).logBase(1).show(true);

//Datasource is required or alerts cannot be added
DashboardPanel dashboardPanel =
    new DashboardPanel()
        .targets(new ArrayList<>(Collections.singletonList(dashboardPanelTarget)))
        .datasource(DASHBOARD_DATA_SOURCE)
        .type(DashboardPanel.Type.GRAPH)
        .fill(1)
        .title(dashboardName)
        .linewidth(1)
        .lines(true)
        .height("300px")
        .span(12)
        .xaxis(dashboardPanelXAxis)
        .yaxes(new ArrayList<>(Arrays.asList(dashboardPanelYAxis, dashboardPanelYAxis)));

DashboardRow dashboardRow =
    new DashboardRow()
        .collapse(false)
        .panels(new ArrayList<>(Collections.singletonList(dashboardPanel)));

Dashboard dashboard =
    new Dashboard()
        .title(dashboardName)
        .schemaVersion(1)
        .rows(new ArrayList<>(Collections.singletonList(dashboardRow)));

DashboardMeta dashboardMeta = new DashboardMeta().canSave(true).slug(dashboardName);

GrafanaDashboard grafanaDashboard =
    new GrafanaDashboard().meta(dashboardMeta).dashboard(dashboard);

//create new dashboard
DashboardMeta createdDashboardMeta = createDashboardTest(grafanaDashboard);

Javadocs

Javadocs can be found here.

Contributing

If you would like to contribute, please see our current list of issues and/or feature requests and send us a pull request. If you have something specific that you'd like to add or fix, please open up an issue for discussion. If it is a fix for a bug or everyone agrees that it would be a useful feature, then submit your pull request. Make sure that your pull request's commit message uses one of the appropriate identifiers to link the pull request to the issue.

Style Guide

This project follows the Google Java Style. It is enforced through the spotless gradle plugin which runs as part of each build. To fix any style issues automatically you can run ./gradlew spotlessApply

License

See LICENSE file

Notice

See NOTICE file

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].