-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## Sample Dashboard | ||
|
||
For documentation on importing dashboards, check out the documentation on [grafana.com](https://grafana.com/docs/grafana/latest/reference/export_import/#importing-a-dashboard) | ||
|
||
The sample dashboard can be obtained from either of two places. | ||
|
||
1. From the Grafana dashboards page [located here](https://grafana.com/grafana/dashboards/14000) | ||
|
||
2. From the official [repository](https://github.com/grafana/github-datasource/) | ||
|
||
If loading it from the official repository, open Grafana and click "Import Dashboard". | ||
|
||
Copy the JSON in `./src/dashboards/dashboard.json`, and paste it into the "Import via panel json" box. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Access Token Permissions | ||
|
||
For all repositories: | ||
|
||
- `public_repo` | ||
- `repo:status` | ||
- `repo_deployment` | ||
- `read:packages` | ||
- `read:user` | ||
- `user:email` | ||
|
||
For Github projects: | ||
|
||
- `read:org` | ||
- `read:project` | ||
|
||
An extra setting is required for private repositories | ||
|
||
- `repo (Full control of private repositories)` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
### Provisioning | ||
|
||
[It’s possible to configure data sources using config files with Grafana’s provisioning system](https://grafana.com/docs/grafana/latest/administration/provisioning/#data-sources). | ||
|
||
#### With the [prom-operator](https://github.com/prometheus-operator/prometheus-operator) | ||
|
||
```yaml | ||
promop: | ||
grafana: | ||
additionalDataSources: | ||
- name: GitHub Repo Insights | ||
type: grafana-github-datasource | ||
jsonData: | ||
owner: '' | ||
repository: '' | ||
secureJsonData: | ||
accessToken: '<github api token>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Variables | ||
|
||
[Variables](https://grafana.com/docs/grafana/latest/variables/) allow you to substitute values in a panel with pre-defined values. | ||
|
||
![Creating Variables](https://github.com/grafana/github-datasource/raw/main/docs/screenshots/variables-create.png) | ||
|
||
You can reference them inside queries, allowing users to configure parameters such as `Query` or `Repository`. | ||
|
||
![Using Variables inside queries](https://github.com/grafana/github-datasource/raw/main/docs/screenshots/using-variables.png) | ||
|
||
## Macros | ||
|
||
You can use the following macros in your queries | ||
|
||
| Macro Name | Syntax | Description | Example | | ||
| ---------- | -------------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | | ||
| multiVar | `$__multiVar(prefix,$var)` | Expands a multi value variable into github query string | `$__multiVar(label,$labels)` will expand into `label:first-label label:second-label` | | ||
| | | When using **all** in multi variable, use **\*** as custom all value | | | ||
| day | `$__toDay(diff)` | Returns the day according to UTC time, a difference in days can be added | `created:$__toDay(-7)` on 2022-01-17 will expand into `created:2022-01-10` | |