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
run: if [ "v${{ steps.metadata.outputs.plugin-version }}" != "${{ steps.metadata.outputs.github-tag }}" ]; then printf "\033[0;31mPlugin version doesn't match tag name\033[0m\n"; exit 1; fi
110
+
111
+
- name: Package plugin
112
+
id: package-plugin
113
+
run: |
114
+
mv dist ${{ steps.metadata.outputs.plugin-id }}
115
+
zip ${{ steps.metadata.outputs.archive }} ${{ steps.metadata.outputs.plugin-id }} -r
echo A draft release has been created for your plugin. Please review and publish it. Then submit your plugin to grafana.com/plugins by opening a PR to https://github.com/grafana/grafana-plugin-repository with the following entry:
This template is a starting point for building a Data Source Plugin for Grafana.
3
+
This data source plugin allows you to query and visualize log data stored in Parseable server.
4
4
5
-
## What are Grafana data source plugins?
5
+
## Pre-requisites
6
6
7
-
Grafana supports a wide range of data sources, including Prometheus, MySQL, and even Datadog. There’s a good chance you can already visualize metrics from the systems you have set up. In some cases, though, you already have an in-house metrics solution that you’d like to add to your Grafana dashboards. Grafana Data Source Plugins enables integrating such solutions with Grafana.
7
+
[Parseable server](https://github.com/parseablehq/parseable) setup and receiving logs from your application. Read more on [Parseable documentation](https://www.parseable.io/docs/quick-start).
8
8
9
-
## Getting started
9
+
## Installation
10
10
11
-
### Frontend
11
+
- Install the plugin using the Grafana CLI, using the command `grafana-cli plugins install parseable-datasource`. Then restart Grafana. Alternatively, you can install the plugin from your Grafana instance (Configuration > Data sources > Add Data source).
12
12
13
-
1. Install dependencies
13
+
- Add Parseable as a data source at the data source configuration page.
14
14
15
-
```bash
16
-
yarn install
17
-
```
15
+
- Configure the data source specifying URL and port like `https://demo.parseable.io:443`. Parseable supports basic auth currently, so toggle the "Basic Auth" option under "Auth" section and enter the username and password under "Basic Auth Details" section. For Parseable demo server use `parseable` as both, username and password.
18
16
19
-
2. Build plugin in development mode or run in watch mode
17
+
- Push the `Save and Test` button, if there is an error message, check the credentials and connection.
Once the plugin is configured with correct Parseable server instance. You can start using it to query logs and visualize them. You can use the query editor to write your own queries.
28
24
29
-
3. Build plugin in production mode
25
+
## Screenshots
30
26
31
-
```bash
32
-
yarn build
33
-
```
34
-
35
-
4. Run the tests (using Jest)
36
-
37
-
```bash
38
-
# Runs the tests and watches for changes
39
-
yarn test
40
-
41
-
# Exists after running all the tests
42
-
yarn lint:ci
43
-
```
44
-
45
-
5. Spin up a Grafana instance and run the plugin inside it (using Docker)
46
-
47
-
```bash
48
-
yarn server
49
-
```
50
-
51
-
6. Run the E2E tests (using Cypress)
52
-
53
-
```bash
54
-
# Spin up a Grafana instance first that we tests against
55
-
yarn server
56
-
57
-
# Start the tests
58
-
yarn e2e
59
-
```
60
-
61
-
7. Run the linter
62
-
63
-
```bash
64
-
yarn lint
65
-
66
-
# or
67
-
68
-
yarn lint:fix
69
-
```
70
-
71
-
72
-
73
-
# Distributing your plugin
74
-
75
-
When distributing a Grafana plugin either within the community or privately the plugin must be signed so the Grafana application can verify its authenticity. This can be done with the `@grafana/sign-plugin` package.
76
-
77
-
_Note: It's not necessary to sign a plugin during development. The docker development environment that is scaffolded with `@grafana/create-plugin` caters for running the plugin without a signature._
78
-
79
-
## Initial steps
80
-
81
-
Before signing a plugin please read the Grafana [plugin publishing and signing criteria](https://grafana.com/docs/grafana/latest/developers/plugins/publishing-and-signing-criteria/) documentation carefully.
82
-
83
-
`@grafana/create-plugin` has added the necessary commands and workflows to make signing and distributing a plugin via the grafana plugins catalog as straightforward as possible.
84
-
85
-
Before signing a plugin for the first time please consult the Grafana [plugin signature levels](https://grafana.com/docs/grafana/latest/developers/plugins/sign-a-plugin/#plugin-signature-levels) documentation to understand the differences between the types of signature level.
86
-
87
-
1. Create a [Grafana Cloud account](https://grafana.com/signup).
88
-
2. Make sure that the first part of the plugin ID matches the slug of your Grafana Cloud account.
89
-
-_You can find the plugin ID in the plugin.json file inside your plugin directory. For example, if your account slug is `acmecorp`, you need to prefix the plugin ID with `acmecorp-`._
90
-
3. Create a Grafana Cloud API key with the `PluginPublisher` role.
91
-
4. Keep a record of this API key as it will be required for signing a plugin
92
-
93
-
## Signing a plugin
94
-
95
-
### Using Github actions release workflow
96
-
97
-
If the plugin is using the github actions supplied with `@grafana/create-plugin` signing a plugin is included out of the box. The [release workflow](./.github/workflows/release.yml) can prepare everything to make submitting your plugin to Grafana as easy as possible. Before being able to sign the plugin however a secret needs adding to the Github repository.
98
-
99
-
1. Please navigate to "settings > secrets > actions" within your repo to create secrets.
100
-
2. Click "New repository secret"
101
-
3. Name the secret "GRAFANA_API_KEY"
102
-
4. Paste your Grafana Cloud API key in the Secret field
103
-
5. Click "Add secret"
104
-
105
-
#### Push a version tag
106
-
107
-
To trigger the workflow we need to push a version tag to github. This can be achieved with the following steps:
108
-
109
-
1. Run `npm version <major|minor|patch>`
110
-
2. Run `git push origin main --follow-tags`
111
-
112
-
113
-
## Learn more
114
-
115
-
Below you can find source code for existing app plugins and other related documentation.
116
-
117
-
-[Basic data source plugin example](https://github.com/grafana/grafana-plugin-examples/tree/master/examples/datasource-basic#readme)
0 commit comments