databricks-grafana

module
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2022 License: Apache-2.0

README

Databricks - Grafana Data Source Backend Plugin

Grafana Databricks integration allowing direct connection to Databricks to query and visualize Databricks data in Grafana.

⚠️ WIP ⚠️

The plugin is still work in progress and currently only offers limited functionality.

TODO:
  • Full-text query editor
  • Allow multiple metrics query
  • Add GROUP BY to query form
  • Autocomplete
  • ...
Signing

The build plugin in the release section of this repo is signed for localhost:3000. If you want to use it on another domain, you either have build it without signing (or simply delete the MANIFEST.txt) and add the plugin ID to the allow_loading_unsigned_plugins in the grafana config or sign it yourself according to the Grafana Documentation.

defaults.ini

[plugins]
# Enter a comma-separated list of plugin identifiers to identify plugins to load even if they are unsigned. Plugins with modified signatures are never loaded.
allow_loading_unsigned_plugins = mullerpeter-databricks-datasource

Simple Query Editor

img.png

At the moment only simple queries for one value over time are implemented. The Time-range and TimeBucket parameters from Grafana are automatically inserted into the query. If you want to use more advanced queries use the raw SQL editor.

Raw SQL Editor

img.png

When using the raw SQL editor, template variables are replaced by the Time-Range and Bucket (see query help in editor for examples).

Plugin Configuration

img_1.png

To configure the plugin use the values provided under JDBC/ODBC in the advanced options of the Databricks Cluster and create a personal access token for Databricks.

Development

What is Grafana Data Source Backend Plugin?

Grafana supports a wide range of data sources, including Prometheus, MySQL, and even Datadog. There’s a good chance you can already visualize metrics from the systems you have set up. In some cases, though, you already have an in-house metrics solution that you’d like to add to your Grafana dashboards. Grafana Data Source Plugins enables integrating such solutions with Grafana.

For more information about backend plugins, refer to the documentation on Backend plugins.

Getting started

A data source backend plugin consists of both frontend and backend components.

Frontend
  1. Install dependencies

    yarn install
    
  2. Build plugin in development mode or run in watch mode

    yarn dev
    

    or

    yarn watch
    
  3. Build plugin in production mode

    yarn build
    
Backend
  1. Update Grafana plugin SDK for Go dependency to the latest minor version:

    go get -u github.com/grafana/grafana-plugin-sdk-go
    go mod tidy
    
  2. Build backend plugin binaries for Linux, Windows and Darwin:

    mage -v
    
  3. List all available Mage targets for additional commands:

    mage -l
    

Learn more

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL