Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Dec 8, 2021
1 parent f27644e commit 54828b6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
38 changes: 33 additions & 5 deletions README.rst
Expand Up @@ -93,16 +93,20 @@ Please take these steps to create an API key with your Grafana instance:
please take note of the Bearer token. This is your Grafana API key.


*******
Running
*******
*****
Usage
*****

Before running ``grafana-wtf``, define URL and access token of your Grafana instance::

export GRAFANA_URL=https://daq.example.org/grafana/
export GRAFANA_TOKEN=eyJrIjoiWHg...dGJpZCI6MX0=

Then::

Searching for strings
=====================

Find the string ``weatherbase`` throughout all dashboards and data sources::

grafana-wtf find weatherbase

Expand All @@ -112,10 +116,31 @@ Then::
When running it with the ``--drop-cache`` option, it will drop its cache upfront.


Replacing strings
=================

Replace all occurrences of ``ldi_v2`` with ``ldi_v3`` within dashboard with
UID ``_JJ22OZZk``::

grafana-wtf --select-dashboard=_JJ22OZZk replace ldi_v2 ldi_v3


Displaying changes / revision logs
==================================

Watching out for recent editing activity on any dashboards?::

# Display 50 most recent changes across all dashboards.
grafana-wtf log --number=50


********
Examples
********
See `grafana-wtf examples <https://github.com/panodata/grafana-wtf/blob/master/doc/examples.rst>`_.

For discovering more command line parameters and their arguments, please invoke
``grafana-wtf --help`` and have a look at `grafana-wtf examples`_.



***********
Expand All @@ -126,3 +151,6 @@ Development
git clone https://github.com/panodata/grafana-wtf
cd grafana-wtf
make test


.. _grafana-wtf examples: https://github.com/panodata/grafana-wtf/blob/master/doc/examples.rst
1 change: 1 addition & 0 deletions doc/backlog.rst
Expand Up @@ -34,3 +34,4 @@ Done
- [x] Introduce concurrent resource fetching using asyncio or grequests,
see https://github.com/kennethreitz/grequests
- [x] Add software tests
- [x] Document "replace" feature in README
2 changes: 0 additions & 2 deletions tests/test_commands.py
Expand Up @@ -99,8 +99,6 @@ def test_find_tabular_dashboard_success(docker_grafana, capsys):

def test_replace_dashboard_success(docker_grafana, capsys):

grafana_url = "http://localhost:3000"

# Rename references from "ldi_v2" to "ldi_v3".
set_command("replace ldi_v2 ldi_v3")
grafana_wtf.commands.run()
Expand Down

0 comments on commit 54828b6

Please sign in to comment.