Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: A bit more maintenance #134

Merged
merged 3 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ in progress
behaviour. Thanks, @JensRichnow and @JWCook.
- Improve error reporting and exit behavior when connecting to Grafana
instance fails. Thanks, @interfan7.
- Set ``User-Agent`` HTTP header like ``grafana-wtf/0.18.0``

2024-03-07 0.18.0
=================
Expand Down
4 changes: 2 additions & 2 deletions doc/backlog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ Iteration +1

- https://swarm.hiveeyes.org/grafana/dashboards/f/ODVFg50mz/arnas
- https://swarm.hiveeyes.org/grafana/dashboards/f/VM-KxXvWk/ruhrgebiet
- [o] Does it croak on play.grafana.org?
- [o] Why are there two newlines on stdout output?
- [o] Query dashboard edit history by dashboard tag(s)
- [o] Set user agent to ``grafana-wtf``


************
Expand Down Expand Up @@ -94,3 +92,5 @@ Done
- [x] Add JSON and YAML output formats for ``find`` subcommand
- [x] History: Group edits by dashboard, to be able to count them
- [x] History: Add a feature to filter dashboards by ``COUNT(edits) = 1``
- [x] Does it croak on play.grafana.org? No.
- [x] Set user agent to ``grafana-wtf``
5 changes: 3 additions & 2 deletions grafana_wtf/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from tqdm.contrib.logging import tqdm_logging_redirect
from urllib3.exceptions import InsecureRequestWarning

from grafana_wtf import __appname__
from grafana_wtf import __appname__, __version__
from grafana_wtf.model import (
DashboardDetails,
DashboardExplorationItem,
Expand Down Expand Up @@ -103,7 +103,8 @@ def grafana_client_factory(cls, grafana_url, grafana_token=None):
verify=verify,
)
if cls.session:
cls.session.headers["User-Agent"] = grafana.client.user_agent
user_agent = f"{__appname__}/{__version__}"
cls.session.headers["User-Agent"] = user_agent
grafana.client.s = cls.session

return grafana
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# Output
"tabulate>=0.8.5,<0.10",
"colored>=1.4.3,<3",
"Pygments>=2.7.4,<3",
"Pygments>=2.15.1,<3",
"PyYAML>=5,<7",
]

Expand Down