Skip to content

Commit b73344f

Browse files
authored
Merge pull request #5 from hugovalente-pm/pre-release-readme-review
review screenshots and add installation instructions
2 parents a6e836e + 43c2341 commit b73344f

File tree

1 file changed

+127
-3
lines changed

1 file changed

+127
-3
lines changed

README.md

Lines changed: 127 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
_Enhanced high-fidelity troubleshooting data source for the Open Source community!_
66

7-
![chrome_czu5FR4B9k](https://user-images.githubusercontent.com/82235632/189611641-c1f9e4a9-0a86-41e2-b96e-9944d6b29339.png)
7+
![Image](https://user-images.githubusercontent.com/82235632/193311991-a6d167ab-b845-49b7-817c-976b780e427e.png)
88

99
## What is Netdata data source plugin for Grafana?
1010

@@ -23,9 +23,9 @@ With this data source plugin we expose the troubleshooting capabilities of Netda
2323

2424
Netdata’s data source plugin connects directly to our Netdata Cloud API’s, meaning that you’ll need to have your nodes (hosts) connected to [Netdata Cloud](https://app.netdata.cloud/?utm_source=grafana&utm_content=data_source_plugin) in order to be able to have them exposed on our plugin. For security purposes you will also need an API token for authentication (which you can get from within your Netdata profile).
2525

26-
Note: If you don't have an account [sign-up](https://app.netdata.cloud/?utm_source=grafana&utm_content=data_source_plugin) for free to get one!
26+
Note: If you don't have an account [sign-up](https://app.netdata.cloud/?utm_source=grafana&utm_content=data_source_plugin) for free to get one!
2727

28-
> Netdata Agent will need to be installed and running on your server, VM and/or cluster, so that it can start collecting all the relevant metrics you have from the server
28+
> Netdata Agent will need to be installed and running on your server, VM and/or cluster, so that it can start collecting all the relevant metrics you have from the server
2929
and applications running on it. More info at https://learn.netdata.cloud/docs/get-started.
3030

3131
### 2. Ensure you have an API Token for authentication purposes.
@@ -44,6 +44,130 @@ Once you have added your API token to Netdata data source plugin you’re ready
4444

4545
![image](https://user-images.githubusercontent.com/82235632/189398814-1efbf1c7-1a62-4d5f-abe8-6a9297a3f008.png)
4646

47+
## How to install the plugin?
48+
49+
To start using the Netdata data source plugin on your Grafana environment, local or Cloud, you need to install the plugin manually - it currently isn't signed. Here are some tips to get through this depending on your setup:
50+
* Docker
51+
* Linux (local)
52+
* Windows (local)
53+
* Building the plugin locally
54+
55+
### Docker
56+
57+
#### Pre-buit script - setup-demo-environment
58+
We provide you a script `setup-demo-environment.sh` that will help you setting this up real fast.
59+
To start the container with the Netdata datasource plugin already installed you just need to:
60+
> `setup-demo-environment.sh run`
61+
62+
To remove container:
63+
> `setup-demo-environment.sh remove`
64+
65+
This script will:
66+
1. Spin up a grafana container without starting grafana itself
67+
1. Retrieve the latest available release of the Netdata datasource plugin
68+
1. Install the Netdata datasource plugin in /var/lib/grafana/plugins
69+
1. Start grafana
70+
71+
#### Manual step-by-step
72+
73+
1. Setup your grafana docker container with the the permissions to load netdata plugin as unsinged
74+
75+
`docker run -d --env GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=netdata-datasource --name=grafana grafana/grafana`
76+
77+
2. Ensure you have the desired version of the plugin you want to install, get it from github releases
78+
79+
```curl -s https://api.github.com/repos/netdata/netdata-grafana-datasource-plugin/releases/latest \
80+
jq -r '.assets[] | select(.name|match("zip$")) | .browser_download_url'
81+
```
82+
83+
3. Grafana plugins, by default, should be under /var/lib/grafana/plugins. Create a folder for netdata inside the container. Enter in an interactive session
84+
85+
`docker exec -ti grafana bash`
86+
`mkdir /var/lib/grafana/plugins/netdata`
87+
88+
4. Copy the contents of the Netdata data source plugin to the new plugin folder created on step 2
89+
90+
`unzip netdata-datasource-<version_number>.zip`
91+
`docker cp netdata-datasource grafana:/var/lib/grafana/plugins/netdata/`
92+
93+
### Linux (local)
94+
95+
1. Ensure you have the desired version of the plugin you want to install, get it from github releases
96+
97+
```curl -s https://api.github.com/repos/netdata/netdata-grafana-datasource-plugin/releases/latest \
98+
jq -r '.assets[] | select(.name|match("zip$")) | .browser_download_url'
99+
```
100+
101+
2. Grafana plugins, by default, should be under /var/lib/grafana/plugins. Create a folder for netdata
102+
103+
`mkdir /var/lib/grafana/plugins/netdata`
104+
105+
3. Copy the contents of the Netdata data source plugin to the new plugin folder created on step 2
106+
107+
`unzip netdata-datasource-<version_number>.zip`
108+
`cp -rf netdata-datasource/ /var/lib/grafana/plugins/netdata`
109+
110+
4. Ensure that Netdata plugin which currently isn’t signed can be registered
111+
112+
`vi /etc/grafana/grafana.ini`
113+
114+
On `allow_loading_unsigned_plugins` entry add **netdata-datasource**
115+
116+
`allow_loading_unsigned_plugins = netdata-datasource`
117+
118+
5. After adding the plugin a restart of grafana server is needed
119+
120+
For init.d based services you can use the command:
121+
`sudo service grafana-server restart`
122+
123+
For systemd based services you can use the following:
124+
`systemctl restart grafana-server`
125+
126+
### Windows (local)
127+
128+
1. Ensure you have the desired version of the plugin you want to install, get it from github releases
129+
130+
```curl -s https://api.github.com/repos/netdata/netdata-grafana-datasource-plugin/releases/latest \
131+
jq -r '.assets[] | select(.name|match("zip$")) | .browser_download_url'
132+
```
133+
134+
2. Grafana plugins, by default, should be under C:\Program Files\GrafanaLabs\grafana\data\plugins. Create a folder for netdata
135+
136+
`mkdir ‘C:\Program Files\GrafanaLabs\grafana\data\plugins\netdata’`
137+
138+
3. Copy the contents of the Netdata data source plugin to the new plugin folder created on step 2
139+
140+
`wzunzip -d netdata-datasource-<version_number>.zip`
141+
or
142+
`gzip -d < netdata-datasource-<version_number>.zip `
143+
`cp .\netdata-datasource\* "C:\Program Files\GrafanaLabs\grafana\data\plugins\netdata"`
144+
145+
4. Ensure that Netdata plugin which currently isn’t signed can be registered
146+
147+
`notepad ‘C:\Program Files\GrafanaLabs\grafana\conf\default.ini’`
148+
149+
On `allow_loading_unsigned_plugins` entry add **netdata-datasource**
150+
151+
`allow_loading_unsigned_plugins = netdata-datasource`
152+
153+
5. After adding the plugin a restart of grafana server is needed
154+
155+
`net stop Grafana`
156+
`net start Grafana`
157+
158+
### Building the plugin locally
159+
160+
For any of the above steps if you prefer to build this plugin locally instead of retrieving it from from the releases you can:
161+
162+
1. Clone this repo
163+
`git clone https://github.com/netdata/netdata-grafana-datasource-plugin`
164+
165+
2. Build it locally
166+
`yarn`
167+
`yarn build`
168+
169+
3. Place the contents of the `/dist` folder under the netdata folder in Grafana plugins directory.
170+
47171
## Learn more
48172

49173
- What is Netdata? - https://learn.netdata.cloud/docs/overview/what-is-netdata

0 commit comments

Comments
 (0)