Skip to content
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

Update Documentation #22

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 2.3.0 (2023-04-04)
## 2.3.0 (2023-04-05)

### Features / Enhancements

Expand All @@ -9,6 +9,7 @@
- Update to Grafana 9.3.6 (#19)
- Update to Grafana 9.4.7 (#20)
- Update backend and workflows to Go 1.19 (#21)
- Update Documentation (#22)

## 2.2.0 (2022-11-06)

Expand Down
92 changes: 18 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@

## Introduction

The Environment Data Source is a plugin for Grafana that returns environment variables to display on your dashboard or use as Variables to retrieve data.
The Environment Data Source is a plugin for Grafana that returns environment variables to display on your dashboard or use as Variables in your code.

[![Grafana variables | Dashboard, Global and Environment variables | Environment Data Source](https://raw.githubusercontent.com/volkovlabs/volkovlabs-env-datasource/main/img/video.png)](https://youtu.be/sczRq2lI3e4)

### Requirements
## Requirements

- **Grafana 8.5+**, **Grafana 9.0+** is required for version 2.X.
- **Grafana 8.0+** is required for version 1.X.
- **Grafana 8.5+**, **Grafana 9.0+** is required for major version 2.
- **Grafana 8.0+** is required for major version 1.

## Getting Started

Environment Data Source is not included in the Grafana Catalog and signed as Private plugin. It can be installed manually from our Private Repository or downloaded directly from the GitHub:
Environment Data Source is not included in the Grafana Catalog. It can be installed manually from our Private Repository or downloaded directly from GitHub.

```bash
grafana-cli --repo https://volkovlabs.io/plugins plugins install volkovlabs-env-datasource
Expand All @@ -29,82 +29,26 @@ grafana-cli --repo https://volkovlabs.io/plugins plugins install volkovlabs-env-
## Features

- Returns Environment Variables.
- Allows to filter unnecessary or secured variables using Regex.

## Private plugin

Plugin is signed as a Private plugin for Grafana using the default domain `http://localhost:3000`. If you are using custom domain URL, there are various options depends on your deployment:

### NGINX Reverse proxy

We recommend using NGINX in front of the Grafana for an extra level of protection. It allows keeping the default domain and redirect requests.

Here is the quick example for Docker Compose. You can find full example in the repository.

```docker
version: '3.4'

services:
grafana:
container_name: grafana
image: grafana/grafana:latest
ports:
- 3000:3000/tcp
environment:
- GF_INSTALL_PLUGINS=https://github.com/VolkovLabs/volkovlabs-env-datasource/releases/download/v2.2.0/volkovlabs-env-datasource-2.2.0.zip;volkovlabs-env-datasource
volumes:
- ./provisioning:/etc/grafana/provisioning

nginx:
container_name: nginx
build: ./nginx
restart: always
environment:
- GRAFANA_HOST=localhost
ports:
- 80:80/tcp
- 443:443/tcp
depends_on:
- grafana
```

### Unsigned plugin

Take a look at [Allow Unsigned Plugins](https://volkovlabs.io/plugins/grafana/allow-unsigned/) section in the documentation.
- Allows filtering unnecessary or secured variables using Regex.
- Supports Dashboard Variables.

### Build plugin and sign
## Documentation

Alternatively, you can build and sign plugin manually following instructions. **Go and Node.js are required**.
| Section | Description |
| ---------------------------- | ------------------------------------------------------------ |
| [Deployment](https://volkovlabs.io/plugins/volkovlabs-env-datasource/deployment/) | Explains deployment options for the data source. |
| [Provisioning](https://volkovlabs.io/plugins/volkovlabs-env-datasource/provisioning/) | Demonstrates how to automatically provision the data Source. |
| [Release Notes](https://volkovlabs.io/plugins/volkovlabs-env-datasource/release/) | Stay up to date with the latest features and updates. |

```
yarn install
yarn build
yarn build:backend
grafana-toolkit plugin:sign --rootUrls http://XXX/
```
### Features

## Provisioning

Grafana supports managing data sources by adding one or more YAML config files in the `provisioning/datasources` folder.

Example of provisioning the Environment Data Source with a filter `GF_` to return only Grafana related variables.

```yaml
datasources:
- name: Environment
type: volkovlabs-env-datasource
access: proxy
isDefault: true
orgId: 1
version: 1
editable: true
jsonData:
filter: GF_
```
| Section | Description |
| -------------------------------- | -------------------------------------------- |
| [Dashboard Variables](https://volkovlabs.io/plugins/volkovlabs-env-datasource/variables/) | Demonstrates how to use Dashboard variables. |

## Feedback

We love to hear from you. There are various ways to get in touch with us:
We love to hear from you. There are various ways to get in touch with us.

- Ask a question, request a new feature, and file a bug with [GitHub issues](https://github.com/volkovlabs/volkovlabs-env-datasource/issues/new/choose).
- Sponsor our open-source plugins for Grafana with [GitHub Sponsor](https://github.com/sponsors/VolkovLabs).
Expand Down
2 changes: 1 addition & 1 deletion docker-compose-nginx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
ports:
- 3000:3000/tcp
environment:
- GF_INSTALL_PLUGINS=https://github.com/VolkovLabs/volkovlabs-env-datasource/releases/download/v2.2.0/volkovlabs-env-datasource-2.2.0.zip;volkovlabs-env-datasource
- GF_INSTALL_PLUGINS=https://github.com/VolkovLabs/volkovlabs-env-datasource/releases/download/v2.3.0/volkovlabs-env-datasource-2.3.0.zip;volkovlabs-env-datasource
volumes:
- ./provisioning:/etc/grafana/provisioning

Expand Down
2 changes: 1 addition & 1 deletion pkg/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func NewDatasource(dis backend.DataSourceInstanceSettings) (instancemgmt.Instanc

err := json.Unmarshal(dis.JSONData, &settings)
if err != nil {
return nil, fmt.Errorf("could not unmarshal PluginSettings json: %w", err)
return nil, fmt.Errorf("Could not unmarshal PluginSettings json: %w", err)
}

return &Datasource{Settings: &settings}, nil
Expand Down
Binary file modified src/img/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/img/variables.png
Binary file not shown.
4 changes: 0 additions & 4 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
{
"name": "Dashboard",
"path": "img/dashboard.png"
},
{
"name": "Variables",
"path": "img/variables.png"
}
],
"updated": "%TODAY%",
Expand Down