Skip to content

Commit

Permalink
Publish 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobcolvin-8451 committed Nov 22, 2019
1 parent 290d754 commit cf24374
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 2 deletions.
33 changes: 33 additions & 0 deletions dist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# macropower-analytics-panel
Grafana panel that forwards user data on mount & unmount

## Features
Have you ever found yourself wanting to know who is using your dashboards, and how frequently they are being used?

Grafana has some built in support with Google Analytics, but nothing that will actually define **who** is using a dashboard. Missing this data is big problem, because the resulting statistics hardly answer any questsions you might have. Questions like, "Who should I be catering to" or "What data should I be focusing on". Additionally, Google Analytics data can be quite inaccurate as you can't easily distinguish admins from end users.

This panel will forward data each time a panel is loaded or exited, including:

- Timestamps
- Username
- Dashboard ID
- Instance info

You might want to consider this plugin until official support is implemented!

## Getting Started
You will need a server that accepts a JSON body identical to that provided by this plugin. This data will be sent to whatever URL you place in the plugin's settings.

I used Kotlin w/ Spring, but you may use anything you want.

Your server should reply with `{location: <id>}` on record creation, where `id` is some unique value your backend associates to records. Your server will also need to accept the same JSON body at `youraddress/yourpath/{id}`. This signals that the user's connection has ended. You can use this to write a new entry, or append your last entry with an END timestamp. Note that this will not be sent if the user closes the tab/browser. If you don't want this functionality, you can disable it on the Visualization page.

The panel itself will display the JSON body that will be sent (until it is hidden), so you should be able to write your models around that data.

The other settings, "Unique ID" and "Description" are used to distinguish one dashboard from another. They will be auto populated when you load the Visualization page. Feel free to change them.

## Hiding the panel
- In Visualization, set Hidden to True.
- In General Settings, set Transparent to True.
- In General Settings, set Title/Description to nothing.
- Save and make the panel as small as you want. I found that 0 height, 100% width works well.
85 changes: 85 additions & 0 deletions dist/img/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions dist/module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions dist/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"type": "panel",
"name": "Analytics Panel",
"id": "macropower-analytics-panel",
"info": {
"description": "Grafana Dashboard Analytics Panel",
"author": {
"name": "Jacob Colvin"
},
"keywords": ["dashboard","analytics","user","username"],
"logos": {
"small": "img/logo.svg",
"large": "img/logo.svg"
},
"links": [
{"name": "Website", "url": "https://github.com/MacroPower/macropower-analytics-panel"}
],
"screenshots": [],
"version": "0.0.1",
"updated": "2019-11-22"
},
"dependencies": {
"grafanaVersion": "6.3.x",
"plugins": []
}
}
7 changes: 5 additions & 2 deletions src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
"small": "img/logo.svg",
"large": "img/logo.svg"
},
"links": [
{"name": "Website", "url": "https://github.com/MacroPower/macropower-analytics-panel"}
],
"screenshots": [],
"version": "%VERSION%",
"updated": "%TODAY%"
"version": "0.0.1",
"updated": "2019-11-22"
},
"dependencies": {
"grafanaVersion": "6.3.x",
Expand Down

0 comments on commit cf24374

Please sign in to comment.