@@ -10,8 +10,8 @@ when you want to monitor many feeds on a single dashboard.
10
10
11
11
With the Dataset plugin, you will be able to create and visualize your log-based
12
12
metrics along side all of your other data sources. It's a great way to have a
13
- single pane of glass for today's complex systems. You can leverage Grafana alerts
14
- based on Dataset data to notify you when there are possible issues. More
13
+ single pane of glass for today's complex systems. You can leverage Grafana
14
+ alerts based on Dataset data to notify you when there are possible issues. More
15
15
importantly, you'll soon be able to jump to Dataset's fast, easy and intuitive
16
16
platform to quickly identify the underlying causes of issues that may arise.
17
17
@@ -21,140 +21,41 @@ platform to quickly identify the underlying causes of issues that may arise.
21
21
assumes that an existing instance of Grafana already exists. If you need help
22
22
bringing up a Grafana instance, please refer to the [ documentation provided by
23
23
Grafana] ( https://grafana.com/docs/installation/ ) .
24
- * ** A Dataset read log API Key** : A Dataset API key is required for Grafana to pull
25
- data from Dataset. You can obtain one by going to your account in the Dataset
26
- product and selecting the “API Keys” from the menu in the top right corner. You
27
- can find documentation on API Keys [ here] ( https://www.scalyr.com/help/api#scalyr-api-keys ) .
24
+ * ** A Dataset read log API Key** : A Dataset API key is required for Grafana to
25
+ pull data from Dataset. You can obtain one by going to your account in the
26
+ Dataset product and selecting the “API Keys” from the menu in the top right
27
+ corner. You can find documentation on API Keys
28
+ [ here] ( https://www.scalyr.com/help/api#scalyr-api-keys ) .
28
29
29
- ## Getting started
30
+ ## Installation
30
31
31
- ### Installing the latest / stable version with grafana-cli
32
+ Using grafana-cli: ` grafana-cli plugins install sentinelone-dataset-datasource `
32
33
33
- 1 . To install the stable version of the plugin using grafana-cli, run the following command:
34
+ Alternatively can download it
35
+ [ here] ( https://github.com/scalyr/scalyr-grafana-datasource-plugin/releases/latest/ )
36
+ and unzip it manually into the Grafana plugins directory (eg
37
+ ` /var/lib/grafana/plugins ` ). A restart of the Grafana server is required
38
+ afterwards.
34
39
35
- ``` bash
36
- grafana-cli --pluginUrl \
37
- https://github.com/scalyr/scalyr-grafana-datasource-plugin/releases/download/3.0.1/sentinelone-dataset-datasource.zip \
38
- plugins install sentinelone-dataset-datasource
39
- ```
40
+ ## Configuration
40
41
41
- Older versions can be downloaded from [ github releases] ( https://github.com/scalyr/scalyr-grafana-datasource-plugin/releases ) .
42
-
43
- 2 . Adding plugins requires a restart of your grafana server.
44
-
45
- For init.d based services you can use the command:
46
-
47
- ``` bash
48
- sudo service grafana-server restart
49
- ```
50
-
51
- For systemd based services you can use the following:
52
-
53
- ` ` ` bash
54
- systemctl restart grafana-server
55
- ` ` `
56
-
57
- # ## Building a development version and installing manually
58
-
59
- 1. To build and install the ` development` version of the plugin, clone the
60
- [plugin repository](https://github.com/scalyr/scalyr-grafana-datasource-plugin) from GitHub.
61
-
62
- ` ` ` bash
63
- git clone https://github.com/scalyr/scalyr-grafana-datasource-plugin.git
64
- ` ` `
65
-
66
- 2. Build the Golang backend (with the version defined in go.mod, currently 1.16) using Mage
67
-
68
- ` ` ` bash
69
- mage
70
- ` ` `
71
-
72
- This will build the executables in ` dist/`
73
-
74
- To install Mage (Golang make-like build tool):
75
-
76
- ` ` ` bash
77
- git clone https://github.com/magefile/mage $GOPATH /src/github.com/magefile/mage
78
- cd $GOPATH /src/github.com/magefile/mage
79
- git checkout tags/v1.12.1 # Specified in go.mod
80
- go run bootstrap.go
81
- ` ` `
82
-
83
- A ` mage` executable should now be in ` $GOPATH /bin/` .
84
-
85
- 3. Build the Typescript frontend using LTS Node (> = v14) and Yarn
86
-
87
- ` ` ` bash
88
- yarn install --pure-lockfile # Install dependencies into node_modules
89
- yarn build
90
- ` ` `
91
-
92
- This will build and the frontend files in ` dist/`
93
-
94
- To install Yarn: ` npm install --global yarn`
95
-
96
-
97
- 5. For development versions, simply copy the files to the Grafana server plugin directory
98
-
99
- ` ` ` bash
100
- mkdir /var/lib/grafana/plugins/dataset
101
- # copy files from dist/ into /var/lib/grafana/plugins/dataset
102
- ` ` `
103
-
104
- Note that this is an unsigned plugin, and you must update your ` grafana.ini` file to allow it adding the following line:
105
-
106
- ` ` ` bash
107
- allow_loading_unsigned_plugins = sentinelone-dataset-datasource
108
- ` ` `
109
-
110
- 6. Adding plugins requires a restart of your grafana server.
111
-
112
- For init.d based services you can use the command:
113
-
114
- ` ` ` bash
115
- sudo service grafana-server restart
116
- ` ` `
117
-
118
- For systemd based services you can use the following:
119
-
120
- ` ` ` bash
121
- systemctl restart grafana-server
122
- ` ` `
123
-
124
- # ## Package and sign the plugin
125
-
126
- To sign and package the plugin for distribution:
127
-
128
- ` ` ` bash
129
- export GRAFANA_API_KEY=< YOUR_API_KEY>
130
- npx @grafana/toolkit plugin:sign # This creates dist/MANIFEST.txt
131
-
132
- cp -r dist sentinelone-dataset-datasource
133
- zip -r sentinelone-dataset-datasource-$(jq -r .info.version sentinelone-dataset-datasource/plugin.json).zip sentinelone-dataset-datasource
134
- rm -rf sentinelone-dataset-datasource # Cleanup
135
- ` ` `
136
-
137
- References
138
- - https://grafana.com/docs/grafana/latest/developers/plugins/package-a-plugin/
139
- - https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/
140
-
141
- # ## Verify the Plugin was Installed
142
-
143
- 1. In order to verify proper installation you must log in to your grafana instance
144
- and navigate to ** Configuration Settings -> Data Sources** .
42
+ 1 . Log in to your grafana instance and navigate to ** Configuration Settings ->
43
+ Data sources** .
145
44
146
45
![ ConfigDataSource] ( https://raw.githubusercontent.com/scalyr/scalyr-grafana-datasource-plugin/go-rewrite-v2/src/img/ConfigDataSource.png )
147
46
148
- 2. This will take you into the configuration page. If you already have other data
149
- sources installed, you will see them show up here. Click on the ** Add data source** button:
47
+ 2 . This will take you into the configuration page. If you already have other
48
+ data sources installed, you will see them show up here. Click on the ** Add
49
+ data source** button:
150
50
151
51
![ DatasetConfig] ( https://raw.githubusercontent.com/scalyr/scalyr-grafana-datasource-plugin/go-rewrite-v2/src/img/DatasetConfig.png )
152
52
153
- 3. If you enter " Dataset" in the search bar on the resulting page you should see " Dataset" grafana plugin show up as an option.
53
+ 3 . If you enter "Dataset" in the search bar on the resulting page you should see
54
+ "Dataset" grafana plugin show up as an option.
154
55
155
56
![ SearchForPlugin] ( https://raw.githubusercontent.com/scalyr/scalyr-grafana-datasource-plugin/go-rewrite-v2/src/img/SearchForPlugin.png )
156
57
157
- 4. Click on *** “ Select” * ** . This will take you to a configuration page where you
58
+ 4 . Click on ** Select** . This will take you to a configuration page where you
158
59
insert your API key mentioned in the prerequisite section.
159
60
160
61
![ PluginConfig] ( https://raw.githubusercontent.com/scalyr/scalyr-grafana-datasource-plugin/go-rewrite-v2/src/img/PluginConfig.png )
@@ -166,49 +67,59 @@ References
166
67
| Dataset API Key | Your Scalyr Read Logs API Key|
167
68
| Dataset URL | ` https://www.scalyr.com ` or ` https://eu.scalyr.com ` for EU users.|
168
69
169
- 6. Click *** Save & Test*** to verify these settings are correct.
70
+ 6 . Click ** Save & Test** to verify these settings are correct.
71
+
170
72
## Using the Dataset Datasource
171
73
172
- Now that you’ve completed installing and configuring the Dataset data source plugin,
173
- lets go through an example of how you can start using it to create a dashboard
174
- using Scalyr data.
74
+ Now that you’ve completed installing and configuring the Dataset data source
75
+ plugin, lets go through an example of how you can start using it to create a
76
+ dashboard using Scalyr data.
175
77
176
- 1. Create a new dashboard by click Create > dashboard
78
+ 1 . Create a new dashboard by click ** Create -> Dashboard ** .
177
79
178
80
![ CreateDashboard] ( https://raw.githubusercontent.com/scalyr/scalyr-grafana-datasource-plugin/go-rewrite-v2/src/img/CreateDashboard.png )
179
81
180
- 2. In the ** “ New dashboard” ** box, select the ** “ Add a new panel** icon
82
+ 2 . In the ** New dashboard** box, select the ** Add a new panel** icon.
181
83
182
- 3. From the Data source dropdown, select **" Dataset" **.
84
+ 3 . From the Data source dropdown, select ** Dataset** .
183
85
184
86
![ DataSetPlugin] ( https://raw.githubusercontent.com/scalyr/scalyr-grafana-datasource-plugin/go-rewrite-v2/src/img/DatasetPlugin.png )
185
87
186
- 4. A ' Query Type' field allows to choose the type of query you wanted to search for
88
+ 4 . A ** Query Type** field allows to choose the type of query you wanted to
89
+ search for.
187
90
188
91
![ QueryType] ( https://raw.githubusercontent.com/scalyr/scalyr-grafana-datasource-plugin/go-rewrite-v2/src/img/QueryType.png )
189
92
190
- 5. ' Standard Query' - A standard query allows to search on Graph view,
191
- You can enter Graph Functions into the expression box and visualize the results. You can even enter and visualize Complex Expressions
192
- Dataset [graphFunctions documentation](https://www.scalyr.com/help/dashboards#graphFunctions)
193
- is a good resource to see the list of supported functions.
194
- Enter expression and click the save button. In the image below, we' ve added a query to graph visualized the
195
- number of log messages that contain the word "error"
93
+ 5 . ** Standard Query** - A standard query allows to search on Graph view. You can
94
+ enter graph functions into the expression box and visualize the results. You
95
+ can even enter and visualize complex expressions.
96
+ [ This] ( https://www.scalyr.com/help/dashboards#graphFunctions ) is a good
97
+ resource to see the list of supported functions.
98
+
99
+ Enter an expression and click the save button. In the image below, we've
100
+ added a query to graph the number of log messages that contain the word
101
+ "error".
196
102
197
103
![ StandardQuery] ( https://raw.githubusercontent.com/scalyr/scalyr-grafana-datasource-plugin/go-rewrite-v2/src/img/StandardQuery.png )
198
104
199
- 6. ' Power Query' - Works similar to PQ search in Dataset app. You can enter rich set of commands for transforming
200
- and manipulating data. Data can be viewed in Table format
201
- Visit [this documentation](https://app.scalyr.com/help/power-queries) for more information on building Power Queries
105
+ 6 . ** Power Query** - Works similar to PQ search in Dataset app. You can enter
106
+ rich set of commands for transforming and manipulating data. Data can be
107
+ viewed in table format. Visit
108
+ [ this page] ( https://app.scalyr.com/help/power-queries ) for more information
109
+ on building Power Queries.
202
110
203
111
![ PowerQuery] ( https://raw.githubusercontent.com/scalyr/scalyr-grafana-datasource-plugin/go-rewrite-v2/src/img/PowerQuery.png )
204
112
205
- You’ve successfully installed, configured and created a graph in Grafana using Dataset data!
113
+ You’ve successfully installed, configured and created a graph in Grafana using
114
+ Dataset data!
206
115
207
- Note: you can add multiple queries to a visualization to plot multiple series on the same graph.
116
+ Note: you can add multiple queries to a visualization to plot multiple series on
117
+ the same graph.
208
118
209
119
## Variables
210
120
211
- For general information on Grafana variables see the [Grafana documentation](https://grafana.com/docs/grafana/latest/reference/templating/)
121
+ For general information on Grafana variables see the
122
+ [ Grafana documentation] ( https://grafana.com/docs/grafana/latest/reference/templating/ )
212
123
213
124
Queries support all Grafana variable substitution syntaxes, for example:
214
125
@@ -218,8 +129,8 @@ $varname
218
129
${varname: option}
219
130
```
220
131
221
- For multi-value variables there is a custom default substitution method, the values will be quoted and separated with
222
- commas, for example:
132
+ For multi-value variables there is a custom default substitution method, the
133
+ values will be quoted and separated with commas, for example:
223
134
224
135
``` bash
225
136
" value1" ," value2" ," value3"
0 commit comments