From 43cc6db7d677de5f089d5717f76d4b63859b3b21 Mon Sep 17 00:00:00 2001 From: Nurlan Moldomurov Date: Mon, 28 Oct 2024 17:44:02 +0300 Subject: [PATCH] PMM-12593 Run grafana renderer to render images. (#3232) --- build/ansible/roles/grafana/files/grafana.ini | 2 ++ build/ansible/roles/nginx/files/conf.d/pmm.conf | 1 - docker-compose.yml | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build/ansible/roles/grafana/files/grafana.ini b/build/ansible/roles/grafana/files/grafana.ini index e7b1bd41c2..737a0a438f 100644 --- a/build/ansible/roles/grafana/files/grafana.ini +++ b/build/ansible/roles/grafana/files/grafana.ini @@ -37,6 +37,8 @@ format = console enable_gzip = true # The full public facing url root_url = https://%(domain)s/graph +# Serve Grafana from subpath specified in `root_url` setting. By default it is set to false for compatibility reasons. +serve_from_sub_path = true #################################### Snapshots ########################### [snapshots] diff --git a/build/ansible/roles/nginx/files/conf.d/pmm.conf b/build/ansible/roles/nginx/files/conf.d/pmm.conf index c4ac6155bd..9ff152c851 100644 --- a/build/ansible/roles/nginx/files/conf.d/pmm.conf +++ b/build/ansible/roles/nginx/files/conf.d/pmm.conf @@ -125,7 +125,6 @@ location /graph { proxy_cookie_path / "/;"; proxy_pass http://127.0.0.1:3000; - rewrite ^/graph/(.*) /$1 break; proxy_read_timeout 600; proxy_http_version 1.1; proxy_set_header Connection $connection_upgrade; diff --git a/docker-compose.yml b/docker-compose.yml index 8ae3910cc3..6f5ea0b895 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,6 +25,8 @@ services: - PMM_WATCHTOWER_HOST=${PMM_WATCHTOWER_HOST:-http://watchtower:8080} - PMM_WATCHTOWER_TOKEN=${PMM_WATCHTOWER_TOKEN:-INSECURE_TOKEN} - PMM_RELEASE_VERSION=3.0.0-alpha + - GF_RENDERING_SERVER_URL=http://renderer:8081/render + - GF_RENDERING_CALLBACK_URL=https://pmm-server:8443/graph/ # - PMM_DISTRIBUTION_METHOD=${PMM_DISTRIBUTION_METHOD:-docker} - PMM_DEV_UPDATE_DOCKER_IMAGE=${PMM_DEV_UPDATE_DOCKER_IMAGE:-} # - PMM_DEV_VERSION_SERVICE_URL=http://localhost:11000 @@ -98,7 +100,16 @@ services: # /opt/entrypoint.sh # " -# docker run -v /var/run/docker.sock:/var/run/docker.sock -e WATCHTOWER_HTTP_API_UPDATE=1 -e WATCHTOWER_HTTP_API_TOKEN=123 --hostname=watchtower --network=pmm_default docker.io/bupychuk/watchtower + renderer: + image: grafana/grafana-image-renderer:latest + ports: + - 8081:8081 + environment: + - RENDERING_VERBOSE_LOGGING=true + - RENDERING_DUMPIO=true + - IGNORE_HTTPS_ERRORS=true + - LOG_LEVEL=debug + watchtower: profiles: - pmm @@ -113,7 +124,7 @@ services: networks: - ${NETWORK:-default} volumes: - - /var/run/docker.sock:${DOCKER_PATH:-/var/run/docker.sock} + - ${DOCKER_PATH:-/var/run/docker.sock}:/var/run/docker.sock # PMM with external DBs ch: