Skip to content

Commit 7fc53db

Browse files
committed
docs: revise repo README
* update wording * hide big yaml examples in shortcuts * update provisioning instructions
1 parent 4672032 commit 7fc53db

File tree

2 files changed

+51
-40
lines changed

2 files changed

+51
-40
lines changed

README.md

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ build:
77
# VictoriaLogs datasource for Grafana
88

99
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/).
1111

1212
* [Installation](#installation)
13-
* [Getting started development](#getting-started-development)
13+
* [Development](#getting-started-development)
1414
* [How to make new release](#how-to-make-new-release)
1515
* [Notes](#notes)
1616
* [License](#license)
1717

18+
Read more about plugin capabilities and application at [VictoriaLogs plugin page](https://grafana.com/grafana/plugins/victoriametrics-logs-datasource/).
19+
1820
## Installation
1921

2022
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/).
2224

2325
### Install via Docker
2426

@@ -28,7 +30,10 @@ See more details at [Configure a Grafana Docker image](https://grafana.com/docs/
2830

2931
### Grafana Provisioning
3032

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`:
3237

3338
```yaml
3439
apiVersion: 1
@@ -44,34 +49,26 @@ datasources:
4449
# <string> Sets URL for sending queries to VictoriaLogs server.
4550
# see https://docs.victoriametrics.com/victorialogs/querying/
4651
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
5052
```
5153
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:
5555

56-
1. Define Grafana installation via docker-compose:
57-
58-
```yaml
59-
version: '3.0'
60-
services:
61-
grafana:
62-
image: grafana/grafana:11.0.0
63-
environment:
64-
- GF_INSTALL_PLUGINS=victoriametrics-logs-datasource
65-
ports:
66-
- 3000:3000/tcp
67-
volumes:
68-
- ./provisioning:/etc/grafana/provisioning
69-
```
56+
```yaml
57+
services:
58+
grafana:
59+
image: grafana/grafana:12.0.2
60+
environment:
61+
- GF_INSTALL_PLUGINS=victoriametrics-logs-datasource
62+
ports:
63+
- 3000:3000/tcp
64+
volumes:
65+
- ./provisioning:/etc/grafana/provisioning
66+
```
7067

71-
1. Run docker-compose file:
68+
3. Run the docker-compose:
7269

73-
```
74-
docker-compose -f docker-compose.yaml up
70+
```sh
71+
docker compose -f docker-compose.yaml up
7572
```
7673

7774
After Grafana starts successfully, datasource should be available in the datasources tab
@@ -98,7 +95,9 @@ plugins:
9895
- victoriametrics-logs-datasource
9996
```
10097

101-
Option 3. Using init container:
98+
Option 3. Using init container.
99+
<details>
100+
<summary>extraInitContainers.yaml</summary>
102101

103102
``` yaml
104103
extraInitContainers:
@@ -124,6 +123,7 @@ extraInitContainers:
124123
- name: storage
125124
mountPath: /var/lib/grafana
126125
```
126+
</details>
127127
128128
For `grafana-operator` users, the above configuration should be done for the part `/spec/deployment/spec/template/spec/initContainers` of your `kind=Grafana` resource.
129129

@@ -138,11 +138,13 @@ sidecar:
138138

139139
See more about chart settings [here](https://github.com/grafana/helm-charts/blob/541d97051de87a309362e02d08741ffc868cfcd6/charts/grafana/values.yaml)
140140

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.
142142

143143
#### Grafana operator
144144

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>
146148

147149
```yaml
148150
apiVersion: grafana.integreatly.org/v1beta1
@@ -185,12 +187,16 @@ spec:
185187
- name: grafana-data
186188
mountPath: /var/lib/grafana
187189
```
190+
</details>
188191

189192
See [Grafana operator reference](https://grafana.github.io/grafana-operator/docs/grafana/) to find more about Grafana operator.
190193
This example uses init container to download and install plugin.
191194

192195
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+
194200
```yaml
195201
apiVersion: grafana.integreatly.org/v1beta1
196202
kind: GrafanaDatasource
@@ -262,10 +268,11 @@ spec:
262268
"weekStart": ""
263269
}
264270
```
271+
</details>
265272

266273
### Dev release installation
267274

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:
269276

270277
``` sh
271278
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:
274281
rm /var/lib/grafana/plugins/vl-plugin.tar.gz
275282
```
276283

277-
1. Restart Grafana
284+
After downloading is finished, restart Grafana to load the plugin.
278285

279286
## Getting started development
280287

281288
### 1. Install [Grafana](https://grafana.com/docs/grafana/latest/setup-grafana/installation/)
289+
282290
<details>
283291
<summary>Tip for Apple(arm64)</summary>
284292

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
apiVersion: 1
2-
32
datasources:
4-
- name: 'VictoriaLogs'
5-
type: 'victoriametrics-logs-datasource'
3+
# <string, required> Name of the VictoriaLogs datasource
4+
# displayed in Grafana panels and queries.
5+
- name: VictoriaLogs
6+
# <string, required> Sets the data source type.
7+
type: victoriametrics-logs-datasource
8+
# <string, required> Sets the access mode, either
9+
# proxy or direct (Server or Browser in the UI).
610
access: proxy
7-
isDefault: false
8-
orgId: 1
9-
version: 1
10-
editable: true
11+
# <string> Sets URL for sending queries to VictoriaLogs server.
12+
# see https://docs.victoriametrics.com/victorialogs/querying/
13+
url: http://victorialogs:9428

0 commit comments

Comments
 (0)