Skip to content

Commit 58a0936

Browse files
authored
Documentation improvements (#41)
* Documentation improvements * Update bug link
1 parent b9c782f commit 58a0936

File tree

9 files changed

+72
-10
lines changed

9 files changed

+72
-10
lines changed

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ Note: you can add multiple queries to a visualization to plot multiple series on
149149
150150
## Variables
151151
152+
For general information on Grafana variables see the [Grafana documentation](https://grafana.com/docs/grafana/latest/reference/templating/)
153+
152154
Queries support all Grafana variable substitution syntaxes, for example:
153155
154156
```bash
@@ -157,7 +159,7 @@ $varname
157159
${varname:option}
158160
```
159161
160-
For multi-value variables there is a custom default substitution method, the values will be quoted and seperated with
162+
For multi-value variables there is a custom default substitution method, the values will be quoted and separated with
161163
commas, for example:
162164
163165
```bash
@@ -170,6 +172,34 @@ The expected use of multi-value variables is for `in` queries, for example:
170172
$serverHost=($host)
171173
```
172174
175+
## DataLinks
176+
177+
Your queries will automatically generate a URL you can use as a DataLink in Grafana,
178+
this link will take you to the logs used to generate your graph in the Scalyr UI
179+
180+
![GeneratedDataLink](images/QueryWithDataLink.png)
181+
182+
To set up the DataLink first click `Copy` to copy the link into your clipboard
183+
184+
![CopiedDataLink](images/CopiedDataLink.png)
185+
186+
Next go to the **Visualization** tab and scroll down to the **Data links** section
187+
188+
![DataLinksSection](images/DataLinksSection.png)
189+
190+
Click `Add link`, give it an appropriate title, and paste your URL into the `URL` field
191+
192+
![ExampleDataLink](images/ExampleDataLink.png)
193+
194+
Your Data Link is now ready! If you now go to your graph and click on the line you will
195+
have a new option, this will take you to Scalyr and show the logs your graph represents
196+
197+
![DataLinkDropdown](images/DataLinkDropdown.png)
198+
199+
Note: You will need to already be logged in to Scalyr for the DataLink to reach the UI,
200+
and variables are accepted in DataLinks but there are limitations due to a
201+
[Grafana bug](https://github.com/grafana/grafana/issues/22183)
202+
173203
## Limitations and Future Improvements
174204
175205
1. Breakdown graphs are currently not supported. These may be supported in the
@@ -181,7 +211,10 @@ $serverHost=($host)
181211
to ***“series”***.
182212
183213
3. Complex queries with multiple functions are currently not supported. These may
184-
be supported in the future
214+
be supported in the future.
215+
216+
4. The DataLinks feature currently only works for queries without variables due to
217+
a [Grafana bug](https://github.com/grafana/grafana/issues/22183).
185218
186219
## Contributing
187220

dist/README.md

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ Note: you can add multiple queries to a visualization to plot multiple series on
149149
150150
## Variables
151151
152+
For general information on Grafana variables see the [Grafana documentation](https://grafana.com/docs/grafana/latest/reference/templating/)
153+
152154
Queries support all Grafana variable substitution syntaxes, for example:
153155
154156
```bash
@@ -157,7 +159,7 @@ $varname
157159
${varname:option}
158160
```
159161
160-
For multi-value variables there is a custom default substitution method, the values will be quoted and seperated with
162+
For multi-value variables there is a custom default substitution method, the values will be quoted and separated with
161163
commas, for example:
162164
163165
```bash
@@ -170,6 +172,34 @@ The expected use of multi-value variables is for `in` queries, for example:
170172
$serverHost=($host)
171173
```
172174
175+
## DataLinks
176+
177+
Your queries will automatically generate a URL you can use as a DataLink in Grafana,
178+
this link will take you to the logs used to generate your graph in the Scalyr UI
179+
180+
![GeneratedDataLink](images/QueryWithDataLink.png)
181+
182+
To set up the DataLink first click `Copy` to copy the link into your clipboard
183+
184+
![CopiedDataLink](images/CopiedDataLink.png)
185+
186+
Next go to the **Visualization** tab and scroll down to the **Data links** section
187+
188+
![DataLinksSection](images/DataLinksSection.png)
189+
190+
Click `Add link`, give it an appropriate title, and paste your URL into the `URL` field
191+
192+
![ExampleDataLink](images/ExampleDataLink.png)
193+
194+
Your Data Link is now ready! If you now go to your graph and click on the line you will
195+
have a new option, this will take you to Scalyr and show the logs your graph represents
196+
197+
![DataLinkDropdown](images/DataLinkDropdown.png)
198+
199+
Note: You will need to already be logged in to Scalyr for the DataLink to reach the UI,
200+
and variables are accepted in DataLinks but there are limitations due to a
201+
[Grafana bug](https://github.com/grafana/grafana/issues/22125)
202+
173203
## Limitations and Future Improvements
174204
175205
1. Breakdown graphs are currently not supported. These may be supported in the
@@ -181,11 +211,10 @@ $serverHost=($host)
181211
to ***“series”***.
182212
183213
3. Complex queries with multiple functions are currently not supported. These may
184-
be supported in the future
185-
186-
4. Generated DataLinks only support variables in their default format (With no
187-
option passed in) due to limitations in format during variable substitution
188-
in DataLinks.
214+
be supported in the future.
215+
216+
4. The DataLinks feature currently only works for queries without variables due to
217+
a [Grafana bug](https://github.com/grafana/grafana/issues/22125).
189218
190219
## Contributing
191220

dist/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"annotations": false,
55
"category": "logging",
66
"name": "Scalyr",
7-
"id": "scalyr-grafana-datasource",
7+
"id": "scalyr-datasource",
88
"info": {
99
"version": "1.0.0",
1010
"description": "Scalyr Observability Platform",

images/CopiedDataLink.png

23.5 KB
Loading

images/DataLinkDropdown.png

35.6 KB
Loading

images/DataLinksSection.png

112 KB
Loading

images/ExampleDataLink.png

110 KB
Loading

images/QueryWithDataLink.png

333 KB
Loading

src/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"annotations": false,
55
"category": "logging",
66
"name": "Scalyr",
7-
"id": "scalyr-grafana-datasource",
7+
"id": "scalyr-datasource",
88
"info": {
99
"version": "1.0.0",
1010
"description": "Scalyr Observability Platform",

0 commit comments

Comments
 (0)