Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yesoreyeram committed Aug 13, 2021
1 parent fef45d0 commit cf2a75e
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 47 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Change history of the project. All the feature updates, bug fixes, breaking changes will be documented here.

## [ 0.7.7 ]

- Bug fixes and docs update
- DEPRECATED : URL field in the datasource config is now deprecated. Use URL in the Query Editor.
- DEPRECATED : Global queries are now deprecated in favour of Grafana's panel library

## [ 0.7.6 ]

- UnixTimeStamp variable added (alpha)
Expand Down
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Contributing

If you want to contribute to the plugin, you can contribute in one of the following ways

- [Test different APIs](https://github.com/yesoreyeram/grafana-infinity-datasource/discussions/categories/specific-apis) and create bugs if not working as expected
- If you find any interesting APIs, [showcase](https://github.com/yesoreyeram/grafana-infinity-datasource/discussions/categories/show-and-tell) how you are using the API with Infinity datasource so that other community members will get benefit out of it.

## Setting up locally for development

You need following tools in your local machine for development

- NodeJS v12.0+
- Go 1.16
- Mage

Once you clone the repo locally in the grafana's plugin folder. Do the following steps

- `yarn` - This will install the frontend dependencies. Do this once
- `mage -v` - This will help to build the backend part of the plugin. Do this once if you are contributing only the frontend. There is no significant code is in the backend. So no much changes expected
- `yarn watch` - For continuously watching the front-end changes and build
- `yarn test` - To make sure all the existing tests passed
- `yarn docs:dev` - To build and see the changes of docs website
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
# Grafana Infinity Datasource

Visualize data from JSON,CSV,XML,GraphQL and HTML endpoints.
Visualize data from JSON, CSV, XML, GraphQL and HTML endpoints.

[![click here for documentation](https://user-images.githubusercontent.com/153843/122958390-b4ef8900-d37a-11eb-9bb9-d8e32965507f.png)](https://yesoreyeram.github.io/grafana-infinity-datasource)

## Try before installing

Using the following links,You can try **Infinity datasource plugin** without installing grafana/plugin. You can change the URL, customize headers to get the results of your API

### [Try before installing - JSON](https://yesoreyeram-grafana.herokuapp.com/d/try/try?orgId=1&editPanel=2)

### [Try before installing - CSV](https://yesoreyeram-grafana.herokuapp.com/d/try/try?orgId=1&editPanel=3)

### [Demo](https://yesoreyeram-grafana.herokuapp.com)

## Documentation

Detailed documentation and examples are available in plugin [website](https://yesoreyeram.github.io/grafana-infinity-datasource)
Detailed documentation and examples are available in [plugin website](https://yesoreyeram.github.io/grafana-infinity-datasource)

Docs on how to use JSON API - [Docs](https://yesoreyeram.github.io/grafana-infinity-datasource/wiki/json)

### [Demo video](https://youtu.be/Wmgs1E9Ry-s)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "grafana-infinity-datasource",
"version": "0.7.6",
"version": "0.7.7",
"description": "JSON, CSV, XML, GraphQL & HTML datasource for Grafana. Do infinite things with Grafana.",
"main": "dist/module.js",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
"name": "Wiki",
"url": "https://yesoreyeram.github.io/grafana-infinity-datasource"
},
{
"name": "Demo",
"url": "https://yesoreyeram-grafana.herokuapp.com"
},
{
"name": "Try before installing",
"url": "https://yesoreyeram-grafana.herokuapp.com/explore"
},
{
"name": "Github",
"url": "https://github.com/yesoreyeram/grafana-infinity-datasource"
Expand Down
82 changes: 42 additions & 40 deletions src/wiki/global-queries.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
---
slug: "/wiki/global-queries"
title: "Global Queries / Registered Queries"
previous_page_title: "Provisioning"
previous_page_slug: "/wiki/provisioning"
next_page_title: "Configuration"
next_page_slug: "/wiki/configuration"
slug: '/wiki/global-queries'
title: 'Global Queries / Registered Queries'
previous_page_title: 'Provisioning'
previous_page_slug: '/wiki/provisioning'
next_page_title: 'Configuration'
next_page_slug: '/wiki/configuration'
---

> DEPRECATED. From v0.7.7, This feature is deprecated in favour of Grafana panel library. From v0.8 this feature may be removed.
Working with same queries in multiple dashboards might be hard some times. To change a query, you need to update all the dashboards. So Infinity datasource gives an option to register queries globally and then allows to reuse the queries across dashboards.

### Registering Query

To register a query, in the datasource instance settings perform the following actions

* Click **Add Global Query** button
* Change the name and id of the query. Id should be unique per datasource instance.
* Enter the query fields.
* Click `Save`
- Click **Add Global Query** button
- Change the name and id of the query. Id should be unique per datasource instance.
- Enter the query fields.
- Click `Save`

![image](https://user-images.githubusercontent.com/153843/93780448-1635d080-fc20-11ea-8c92-d6e91dbcf003.png#center)

Expand All @@ -35,37 +37,37 @@ You can also provision the global queries in the datasource provisioning. Below
```yaml
apiVersion: 1
datasources:
- name: ProvisionedQueries
type: yesoreyeram-infinity-datasource
access: proxy
isDefault: false
basicAuth: false
jsonData:
datasource_mode: "basic"
global_queries:
- name: Countries
id: countries
query:
type: csv
source: inline
format: table
data : |
country,continent
india,asia
china,asia
uk,europe
columns:
- selector: country
text: Country
type: string
- selector: continent
text: Continent
type: string
version: 1
readOnly: true
- name: ProvisionedQueries
type: yesoreyeram-infinity-datasource
access: proxy
isDefault: false
basicAuth: false
jsonData:
datasource_mode: 'basic'
global_queries:
- name: Countries
id: countries
query:
type: csv
source: inline
format: table
data: |
country,continent
india,asia
china,asia
uk,europe
columns:
- selector: country
text: Country
type: string
- selector: continent
text: Continent
type: string
version: 1
readOnly: true
```
#### Note
* When using global queries, queries will be loaded from the datasource setting when loading the dashboard only. If the query changed, dashboards will get reflected only when they are reloaded. (Query refresh won't fetch the latest query)
* When provisioning, grafana variables / tokens like `${__from}` are not supported yet.
- When using global queries, queries will be loaded from the datasource setting when loading the dashboard only. If the query changed, dashboards will get reflected only when they are reloaded. (Query refresh won't fetch the latest query)
- When provisioning, grafana variables / tokens like `${__from}` are not supported yet.
8 changes: 4 additions & 4 deletions src/wiki/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ grafana-cli --pluginUrl <ZIP_FILE_URL> plugins install yesoreyeram-infinity-data
Example:

```shell
grafana-cli --pluginUrl https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.7.4/yesoreyeram-infinity-datasource-0.7.4.zip plugins install yesoreyeram-infinity-datasource
grafana-cli --pluginUrl https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.7.7/yesoreyeram-infinity-datasource-0.7.7.zip plugins install yesoreyeram-infinity-datasource
```

### Install using helm chart
Expand All @@ -57,19 +57,19 @@ Example:
```yml
plugins:
- https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.7.4/yesoreyeram-infinity-datasource-0.7.4.zip;yesoreyeram-infinity-datasource
- https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.7.7/yesoreyeram-infinity-datasource-0.7.7.zip;yesoreyeram-infinity-datasource
```
### Install using docker
With docker, you can install the plugin using the following command. This will download the latest published version of the plugin from grafana plugins directory.
```shell
docker run -p 3000:3000 -e "GF_INSTALL_PLUGINS=yesoreyeram-infinity-datasource" grafana/grafana:8.0.3
docker run -p 3000:3000 -e "GF_INSTALL_PLUGINS=yesoreyeram-infinity-datasource" grafana/grafana:8.1.1
```

If you need to install a custom version of the plugin with docker, use the following command.

```shell
docker run -p 3000:3000 -e "GF_INSTALL_PLUGINS=https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.7.4/yesoreyeram-infinity-datasource-0.7.4.zip;yesoreyeram-infinity-datasource" grafana/grafana:8.0.3
docker run -p 3000:3000 -e "GF_INSTALL_PLUGINS=https://github.com/yesoreyeram/grafana-infinity-datasource/releases/download/v0.7.7/yesoreyeram-infinity-datasource-0.7.7.zip;yesoreyeram-infinity-datasource" grafana/grafana:8.1.1
```

1 comment on commit cf2a75e

@vercel
Copy link

@vercel vercel bot commented on cf2a75e Aug 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.