Skip to content

Commit

Permalink
fix(monitoring): add kiosk for automatic height calculation to work
Browse files Browse the repository at this point in the history
passing `height=-1` for automatic calculation of height, was broken
for a few releases, in this release it should work when `kisok` parameter
is also being passed
  • Loading branch information
fruch committed Aug 11, 2024
1 parent 1215819 commit 9282de2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sdcm/logcollector.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,11 @@ def get_grafana_screenshot(self, node, local_dst):
datetime.datetime.now().strftime("%Y%m%d_%H%M%S"),
node.name))
LOGGER.debug("Get screenshot for url %s, save to %s", grafana_url, screenshot_path)
# deliberately specifying params as string to be able to use kiosk mode
# since requests can put a param without value, if using dict
# https://github.com/psf/requests/issues/2651
with requests.get(grafana_url, stream=True,
params=dict(width=dashboard.resolution[0], height=dashboard.resolution[1])) as response:
params=f"width={dashboard.resolution[0]}&height=-1&kiosk") as response:
response.raise_for_status()
with open(screenshot_path, 'wb') as output_file:
for chunk in response.iter_content(chunk_size=8192):
Expand Down

0 comments on commit 9282de2

Please sign in to comment.