New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom datasources in v2.0 #1472

Closed
arussellsaw opened this Issue Feb 12, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@arussellsaw
Copy link

arussellsaw commented Feb 12, 2015

I apologize if i've just not found the answer, but i'm at a loss as to how to configure custom datasources in version 2.0 as changes made to src/config.js don't seem to be being used. ideally i'd like to be able to use the kairosdb datasource in version 2.0, but i'm not sure if this is possible.

@torkelo

This comment has been minimized.

Copy link
Member

torkelo commented Feb 12, 2015

no, support for plugins has not been added yet. config.js is not used in backend mode

@smartynov

This comment has been minimized.

Copy link

smartynov commented Feb 20, 2015

I second that, it would be really useful to have an ability to create and use custom datasources. At least an SQL data backend (e.g. a query that follows some guidelines on results format).

@torkelo torkelo added this to the 2.0 milestone Feb 22, 2015

torkelo added a commit that referenced this issue Feb 27, 2015

A lot of work on backend plugin model for frontend components, right …
…now for data sources, will enable dropin plugins for data sources and panels, #1472

torkelo added a commit that referenced this issue Feb 28, 2015

torkelo added a commit that referenced this issue Feb 28, 2015

torkelo added a commit that referenced this issue Feb 28, 2015

@torkelo

This comment has been minimized.

Copy link
Member

torkelo commented Feb 28, 2015

Fixed! All data sources are now plugins.

Plugins are scanned and discovered by the backend, they are found by a plugin.json file like this:

{
  "pluginType": "datasource",
  "name": "Graphite",

  "type": "graphite",
  "serviceName": "GraphiteDatasource",

  "module": "plugins/datasource/graphite/datasource",

  "partials": {
    "config": "app/plugins/datasource/graphite/partials/config.html",
    "query": "app/plugins/datasource/graphite/partials/query.editor.html",
    "annotations": "app/plugins/datasource/graphite/partials/annotations.editor.html"
  },

  "metrics": true,
  "annotations": true
}

This required some substantial changes because now data sources are loaded async (that is after application boot, similar to how panels are loaded, on demand). This will enable grafana to support more panels without effecting people who do not use them. Data sources can provide the own config partial to specify edit options (when you create/edit the datasource).

This change has put the Grafana 2.0 "standalone" mode in big trouble (a mode where you do not need the backend and it works pretty much as in grafana 1.9.1 where dashboards are loaded from elasticsearch or influxdb).

Considering scrapping the idea of a standalone mode, it creates to much complexity and strain on the frontend code to support both a backend mode and a standalone mode.

@torkelo

This comment has been minimized.

Copy link
Member

torkelo commented Feb 28, 2015

One thing remain related to #1276 , and that is to make the templating editor and feature more data source neutral and allow data sources to provide their own editor.

@torkelo torkelo closed this Feb 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment