Skip to content

Commit 0833db1

Browse files
committed
Update to grafana-client 4.0.0
1 parent 6dd8b91 commit 0833db1

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
runs-on: ${{ matrix.os }}
2424

2525
strategy:
26+
fail-fast: false
2627
matrix:
2728
os: [ "ubuntu-latest" ]
2829
python-version: [ "3.7", "3.11" ]

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ grafana-wtf changelog
55

66
in progress
77
===========
8+
- Updated to grafana-client 4.0.0.
89

910
2024-03-07 0.18.0
1011
=================

grafana_wtf/core.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from urllib.parse import parse_qs, urljoin, urlparse
1212

1313
import colored
14-
import requests
14+
import niquests
1515
import requests_cache
1616
from grafana_client.api import GrafanaApi
1717
from grafana_client.client import GrafanaClientError, GrafanaUnauthorizedError
@@ -107,9 +107,7 @@ def setup(self):
107107
# Todo: Review the pool settings and eventually adjust according to concurrency level or other parameters.
108108
# https://urllib3.readthedocs.io/en/latest/advanced-usage.html#customizing-pool-behavior
109109
# https://laike9m.com/blog/requests-secret-pool_connections-and-pool_maxsize,89/
110-
adapter = requests.adapters.HTTPAdapter(pool_connections=100, pool_maxsize=100, max_retries=5, pool_block=True)
111-
self.grafana.client.s.mount("http://", adapter)
112-
self.grafana.client.s.mount("https://", adapter)
110+
self.grafana.client.s = niquests.Session(pool_connections=100, pool_maxsize=100, retries=5)
113111

114112
return self
115113

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
f"pandas<2.3; {no_linux_on_arm}",
2020
f"duckdb<0.11; {no_linux_on_arm}",
2121
# Grafana
22-
"requests>=2.26,<3",
23-
"grafana-client>=3.9.1,<4",
22+
"grafana-client>=4,<5",
2423
"jsonpath-rw>=1.4.0,<2",
2524
# Caching
2625
"requests-cache>=0.8.0,<2",

0 commit comments

Comments
 (0)