You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-33Lines changed: 41 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,18 +7,20 @@ build:
7
7
# VictoriaLogs datasource for Grafana
8
8
9
9
The VictoriaLogs datasource plugin allows you to query and visualize
10
-
[VictoriaLogs](https://docs.victoriametrics.com/victorialogs/) data in [Grafana](https://grafana.com).
10
+
[VictoriaLogs](https://docs.victoriametrics.com/victorialogs/) data in [Grafana](https://grafana.com/grafana/plugins/victoriametrics-logs-datasource/).
11
11
12
12
*[Installation](#installation)
13
-
*[Getting started development](#getting-started-development)
13
+
*[Development](#getting-started-development)
14
14
*[How to make new release](#how-to-make-new-release)
15
15
*[Notes](#notes)
16
16
*[License](#license)
17
17
18
+
Read more about plugin capabilities and application at [VictoriaLogs plugin page](https://grafana.com/grafana/plugins/victoriametrics-logs-datasource/).
19
+
18
20
## Installation
19
21
20
22
For detailed instructions on how to install the plugin in Grafana Cloud or locally,
21
-
please checkout the [Plugin installation docs](https://grafana.com/docs/grafana/latest/plugins/installation/).
23
+
please check out the [Plugin installation docs](https://grafana.com/docs/grafana/latest/plugins/installation/).
22
24
23
25
### Install via Docker
24
26
@@ -28,7 +30,10 @@ See more details at [Configure a Grafana Docker image](https://grafana.com/docs/
28
30
29
31
### Grafana Provisioning
30
32
31
-
Provisioning of Grafana plugin requires creating [datasource config file](http://docs.grafana.org/administration/provisioning/#datasources):
33
+
Provisioning of Grafana plugin requires creating [datasource config file](http://docs.grafana.org/administration/provisioning/#datasources).
34
+
See how to provision Grafana in docker compose environment below.
35
+
36
+
1. Create a file at `./provisioning/datasources/vl.yml`:
32
37
33
38
```yaml
34
39
apiVersion: 1
@@ -44,34 +49,26 @@ datasources:
44
49
# <string> Sets URL for sending queries to VictoriaLogs server.
45
50
# see https://docs.victoriametrics.com/victorialogs/querying/
46
51
url: http://victorialogs:9428
47
-
# <string> Sets the pre-selected datasource for new panels.
48
-
# You can set only one default data source per organization.
49
-
isDefault: true
50
52
```
51
53
52
-
Please find the example of provisioning Grafana instance with VictoriaLogs datasource below:
53
-
54
-
1. Create a file at `./provisioning/datasources/vm.yml` with datasource example file.
54
+
2. Create a `docker-compose.yaml` file:
55
55
56
-
1. Define Grafana installation via docker-compose:
After Grafana starts successfully, datasource should be available in the datasources tab
@@ -98,7 +95,9 @@ plugins:
98
95
- victoriametrics-logs-datasource
99
96
```
100
97
101
-
Option 3. Using init container:
98
+
Option 3. Using init container.
99
+
<details>
100
+
<summary>extraInitContainers.yaml</summary>
102
101
103
102
``` yaml
104
103
extraInitContainers:
@@ -124,6 +123,7 @@ extraInitContainers:
124
123
- name: storage
125
124
mountPath: /var/lib/grafana
126
125
```
126
+
</details>
127
127
128
128
For `grafana-operator` users, the above configuration should be done for the part `/spec/deployment/spec/template/spec/initContainers` of your `kind=Grafana` resource.
129
129
@@ -138,11 +138,13 @@ sidecar:
138
138
139
139
See more about chart settings [here](https://github.com/grafana/helm-charts/blob/541d97051de87a309362e02d08741ffc868cfcd6/charts/grafana/values.yaml)
140
140
141
-
Option 4. would be to build custom Grafana image with plugin based on same installation instructions.
141
+
Option 4. would be to build custom Grafana image with plugin based on the same installation instructions.
142
142
143
143
#### Grafana operator
144
144
145
-
Example with Grafana [operator](https://github.com/grafana-operator/grafana-operator):
145
+
Example with Grafana [operator](https://github.com/grafana-operator/grafana-operator).
146
+
<details>
147
+
<summary>deployment.yaml</summary>
146
148
147
149
```yaml
148
150
apiVersion: grafana.integreatly.org/v1beta1
@@ -185,12 +187,16 @@ spec:
185
187
- name: grafana-data
186
188
mountPath: /var/lib/grafana
187
189
```
190
+
</details>
188
191
189
192
See [Grafana operator reference](https://grafana.github.io/grafana-operator/docs/grafana/) to find more about Grafana operator.
190
193
This example uses init container to download and install plugin.
191
194
192
195
It is also possible to request plugin at `GrafanaDatasource` or `GrafanaDashboard` CRDs.
193
-
For example:
196
+
197
+
<details>
198
+
<summary>datasource-crd.yaml</summary>
199
+
194
200
```yaml
195
201
apiVersion: grafana.integreatly.org/v1beta1
196
202
kind: GrafanaDatasource
@@ -262,10 +268,11 @@ spec:
262
268
"weekStart": ""
263
269
}
264
270
```
271
+
</details>
265
272
266
273
### Dev release installation
267
274
268
-
1. To download plugin build and move contents into Grafana plugins directory:
275
+
To download plugin build and move contents into Grafana plugins directory:
269
276
270
277
``` sh
271
278
ver=$(curl -s https://api.github.com/repos/VictoriaMetrics/victorialogs-datasource/releases/latest | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+' | head -1)
@@ -274,11 +281,12 @@ spec:
274
281
rm /var/lib/grafana/plugins/vl-plugin.tar.gz
275
282
```
276
283
277
-
1. Restart Grafana
284
+
After downloading is finished, restart Grafana to load the plugin.
0 commit comments