Giter Club home page Giter Club logo

spotify-heroic-datasource's Introduction

spotify-heroic-datasource

Build Status

heroic-datasource-screenshot

The Spotify Heroic datasource is the "official" plugin for Heroic!

It includes:

  • Query builder with suggestions for metrics.
  • Table support.
  • Annotation support.

Compatible with Grafana versions 6.0 -> 6.5.2

This plugin is supersedes the previous Heroic datasource.

Inspiration was taken from the Grafana InfluxDB plugin.

Installation

The recommened way to install the plugin is via the official cli:

grafana-cli plugins install spotify-heroic-datasource

The plugin can also be installed by directly pointing at a release. Useful if you want to test a feature that hasn't been released yet.

grafana-cli --pluginUrl https://github.com/spotify/spotify-heroic-datasource/archive/master.zip plugins install spotify-heroic-datasource

Local Development

To develop locally:

  • yarn install
  • yarn watch

Add the following to your grafana.ini to deploy to your local Grafana instance:

[plugin.spotify-heroic-datasource]
path = /{path-to-spotify-heroic-datasource}

If using Docker, you can mount this repo into the Grafana plugin directory:

docker run -it -p 3000:3000 --name=grafana -v `pwd`/dist:/var/lib/grafana/plugins/spotify-heroic-datasource grafana/grafana

Releasing

Travis will automatically bump the patch version of the plugin, tag the commit and make a GitHub Release.

The commit hash then needs to be appended to repo.json in for it to be installable via the grafana-cli.

Code of Conduct

This project adheres to the Open Code of Conduct. By participating, you are expected to honor this code.

spotify-heroic-datasource's People

Contributors

dbochman avatar dependabot[bot] avatar dmichel1 avatar hexedpackets avatar jsferrei avatar lmuhlha avatar ryanmvazquez avatar ryanvazquez avatar sjoeboo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spotify-heroic-datasource's Issues

Support mode heroic feature toggles

All heroic query "features" can the turned on or off at query time(use a - to turn off a default on feature):

"features": ["com.spotify.heroic.distributed_aggregations","-com.spotify.heroic.shift_range"]

We should support enabling/disabling these in grafana (perhaps under some advances-options section, defaulted to the state heroic has them in by default?)

Heatmap y-axis not numerically sorted

in grafana 6 i use heatmap panel with this query:

average by f
from points
where
$key = "orfees"
and st = "i"
and host = "rsdb"

everithing seems good except for Y: the y axes is not sorted by f (average by f)

image

Improve complex filter UI

  • Make the text box bigger so you can see the whole query while you type
  • Preserve the current complex filter so you can edit it when you click on the text box. Currently it clears the whole box to provide suggestions, but there are none.

Perhaps we can make this a freeform text box to improve both of the above.

Improvements to alert threshold when using percent

When adding an alert on a percentage threshold, the value needs to be entered divided by 100 since the input isn't read as a percent, which can be confusing to end users. Some may expect the value should be entered as the % value since the panel is already "using % units".

For example, entering 0.1 is 10%

image

Store JSONified query for complex filters

With a standard query, the JSONified version is stored in Grafana and can be returned from the Grafana API when fetching a dashboard under .dashboard.panels[].targets[].query. If the panel uses a complex filter, however, this field will be empty and the calling application will need to fully construct the query from the various parts - filters, complex filter, aggregation, time range, features, and dashboard variables.

This makes it difficult to use the Grafana API when a complex filter was used. We should construct the full query in the datasource and store it the same way that simple queries are stored.

grafana 7 queries error

when I upgrade to grafana 7 I get this error:
Unrecognized token 'queries': was expecting ('true', 'false' or 'null')

Support variable from Query

When trying to create a variable from a query, the UI throws:

Templating Template variables could not be initialized: this.metricFindQuery(...).then is not a function

and the query builder is just a simple text box, not the normal Heroic query builder.

Common tag suggestions

Certain tags like what are not being showing up in the suggestions. It would be good if we could artificially boost the more common tags if they exist.

With alien we always show the below suggestions when starting from nothing.

Screen Shot 2019-07-02 at 3 55 59 PM

Validate readme

Validate and improve the README.

DOD: Assignee has sat with someone who hasn't worked with the new Grafana plugin before and watched them go through the process of setting it up for local development to catch any gotchas and update the README based on them. Also, README has production installation instructions.

Provide feedback when incorrectly setting up an alert

  • If the resolution is larger than the alert query range show an error. Not sure how this will work when resolution could be a variable.
  • If the alert query range is smaller than the duration (for) show an error.

Switch from grunt-typescript

grunt-typescript is a dead project, it hasn't been updated in 4 years. As is tradition there are other JS projects that do the same thing. We should move to one of them - grunt-ts looks pretty well mantained.

Move builds off of travis

Spotify is slowly moving over to Circl CI as the primary open source build tool. We should see if it makes sense for this project, and if so migrate.

Variable Lookup Query Builder

DOD: If possible, when adding a dashboard variable by query (i.e., select tags for this timeseries), we support some portion of the query builder we use for dashboards and annotations so users do not have to input raw JSON filters.

Add query context to /query/batch

When a query is made to heroic, it should add context to the request around what dashboard and graph is sending the query.

Alien does something like...

Screen Shot 2019-08-06 at 9 54 30 AM

As part of the query payload clientContext can be added to achieve this. Heroic accepts arbitrary json fields.

Adding this to the plugin makes it easier to discovery where potential "bad" queries are being made, as clientContext gets added to the heroic query logs.

Support complex filters in variables

Currently the ad-hoc filter variable doesn't support heroic's complex filter syntax.

Users of this plugin would like to set filter for things like role = foo or role = bar.

We need to investigate more into how the ad-hoc filter variable works and potentially work with Grafana in extending this (or maybe its poorly documented and actually implemented). Or use a different type of variable (custom variable?) and use that in our plugin.

Editing tags refreshes query

Grafana refreshes when tags are added/changed.

DoD: Query should only refresh when reordering an aggregation or manually refreshing.

update & document how new versions are published

the readme should have documentation on how to make a release and upload to Grafana.

-- plugin datasource public repo should have this info

might need to make a grafana.com account to make changes?

[query-builder] aggregation change function

Currently when you set an aggregation like max for-each you cannot change max to something else. This requires you to delete the aggregation and then add it again. If you have many aggregations you have to delete them all since you cannot click and drag the aggregations around.

Screen Shot 2019-07-02 at 3 52 23 PM

Display the $key tag along with the other tags

Right now the key is not displayed with the other tags which can lead to confusion where metrics are coming from.

This just came up with someone wondering where the heartbeat metric was coming from.

DOD: display the key along with the other tags.

Support "Explore"

Currently the Heroic Datasource does not support "Explore" in grafana. Should be supported and functional for Grafana 7.x

global filters should replace panel filters

Currently when a global filter is used, it is appended to the query filter instead of replacing the value if one exists. This causes the query not to match any timeseries.

Aggregation error doesn't show up when navigating from dashboard

Aggregation limits (and possibly errors) are ignored when navigating to a panel from a dashboard. The graph will show No data points without any error message, which is very confusing.

Changing the resolution or refreshing the dashboard will cause the error to appear. Navigating directly to the panel by the URL will also make the error message appear.

Query builder only allows `=` for $key

When setting $key in the query builder, all operations are available - =, !=, ^, and !^. However, setting it to anything other than = does not parse correctly.

For example, setting the builder to $key != apollo will build a JSON query of ["key", "apollo"] without wrapping it in a not filter. Other tag/value pairs work as expected, its just $key with the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.