diff --git a/build/ansible/roles/pmm2-images/files/grafana.ini b/build/ansible/roles/pmm2-images/files/grafana.ini index c8ebe91b4b..0e8b05106c 100644 --- a/build/ansible/roles/pmm2-images/files/grafana.ini +++ b/build/ansible/roles/pmm2-images/files/grafana.ini @@ -4,16 +4,9 @@ [program:grafana] priority = 3 command = - /usr/sbin/grafana-server + /usr/sbin/grafana server --homepath=/usr/share/grafana --config=/etc/grafana/grafana.ini - cfg:default.paths.data=/srv/grafana - cfg:default.paths.plugins=/srv/grafana/plugins - cfg:default.paths.logs=/srv/logs - cfg:default.log.mode=console - cfg:default.log.console.format=console - cfg:default.server.root_url="https://%%(domain)s/graph" - user = grafana directory = /usr/share/grafana autorestart = true diff --git a/build/packages/deb/postinst b/build/packages/deb/postinst index 7db574a2bd..7e32b4bf93 100644 --- a/build/packages/deb/postinst +++ b/build/packages/deb/postinst @@ -25,7 +25,7 @@ case "$1" in ;; *) - echo "postinst called with unknown argument \`$1'" >&2 + echo "postinst called with unknown argument '$1'" >&2 exit 1 ;; esac diff --git a/build/scripts/build-server-rpm b/build/scripts/build-server-rpm index 09ddbb83c1..0ceccebb23 100755 --- a/build/scripts/build-server-rpm +++ b/build/scripts/build-server-rpm @@ -126,7 +126,7 @@ build() { sleep 1 done - sudo yum-builddep --randomwait=5 -y SOURCES/${spec_name}.spec + sudo yum-builddep --randomwait=1 -y SOURCES/${spec_name}.spec spectool -C SOURCES -g SOURCES/${spec_name}.spec rpmbuild --define '_rpmdir %{_topdir}/RPMS/${spec_name}-${rpm_version}' --define 'dist .${rpmbuild_dist}' -ba SOURCES/${spec_name}.spec diff --git a/go.mod b/go.mod index b72f50d70e..0f74f774f7 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ replace github.com/ClickHouse/clickhouse-go/151 => github.com/ClickHouse/clickho require ( github.com/AlekSi/pointer v1.2.0 github.com/ClickHouse/clickhouse-go/151 v0.0.0-00010101000000-000000000000 - github.com/ClickHouse/clickhouse-go/v2 v2.10.0 + github.com/ClickHouse/clickhouse-go/v2 v2.12.0 github.com/DATA-DOG/go-sqlmock v1.5.0 github.com/alecthomas/kong v0.8.0 github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 @@ -108,7 +108,7 @@ require ( github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-ini/ini v1.67.0 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/gnostic v0.6.9 // indirect @@ -132,6 +132,7 @@ require ( github.com/sergi/go-diff v1.2.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/xlab/treeprint v1.1.0 // indirect + go.opentelemetry.io/otel/metric v1.16.0 // indirect go.uber.org/atomic v1.10.0 // indirect golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1 // indirect golang.org/x/time v0.3.0 // indirect @@ -249,8 +250,8 @@ require ( github.com/xdg-go/scram v1.1.2 // indirect github.com/xdg-go/stringprep v1.0.4 // indirect github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect - go.opentelemetry.io/otel v1.14.0 // indirect - go.opentelemetry.io/otel/trace v1.14.0 // indirect + go.opentelemetry.io/otel v1.16.0 // indirect + go.opentelemetry.io/otel/trace v1.16.0 // indirect golang.org/x/mod v0.12.0 // indirect golang.org/x/net v0.12.0 // indirect golang.org/x/oauth2 v0.8.0 // indirect diff --git a/go.sum b/go.sum index 26ee0f7b04..ee78e3c92f 100644 --- a/go.sum +++ b/go.sum @@ -72,8 +72,8 @@ github.com/ClickHouse/clickhouse-go v1.5.1 h1:I8zVFZTz80crCs0FFEBJooIxsPcV0xfthz github.com/ClickHouse/clickhouse-go v1.5.1/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0= github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= -github.com/ClickHouse/clickhouse-go/v2 v2.10.0 h1:0w/A50D5MfsRUYBaV6rLKwZ4LXWKLZKJ1u31QXjTIO4= -github.com/ClickHouse/clickhouse-go/v2 v2.10.0/go.mod h1:teXfZNM90iQ99Jnuht+dxQXCuhDZ8nvvMoTJOFrcmcg= +github.com/ClickHouse/clickhouse-go/v2 v2.12.0 h1:k0Q0qiuwGeGZC7/6Ff9J3C9Od+rzy9FXgGOcAfIxrF0= +github.com/ClickHouse/clickhouse-go/v2 v2.12.0/go.mod h1:W/UQ/GchOF+Q0k5iv6ZanLKQNukA4Oiyt4sMFDsv8QY= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -249,8 +249,8 @@ github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNV github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.4 h1:g01GSCwiDw2xSZfjJ2/T9M+S6pFdcNtFYsp+Y43HYDQ= +github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.2.3 h1:a9vnzlIBPQBBkeaR9IuMUfmVOrQlkoC4YfPoFkX3T7A= @@ -820,11 +820,13 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM= -go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU= +go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= +go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= +go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= -go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M= -go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8= +go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= +go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.starlark.net v0.0.0-20230717150657-8a3343210976 h1:7ljYNcZU84T2N0tZdDgvL7U3M4iFmglAUUU1gRFE/2Q= go.starlark.net v0.0.0-20230717150657-8a3343210976/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= diff --git a/managed/services/supervisord/supervisord.go b/managed/services/supervisord/supervisord.go index 0efd48d76e..64401b5192 100644 --- a/managed/services/supervisord/supervisord.go +++ b/managed/services/supervisord/supervisord.go @@ -779,15 +779,9 @@ redirect_stderr = true [program:grafana] priority = 3 command = - /usr/sbin/grafana-server + /usr/sbin/grafana server --homepath=/usr/share/grafana --config=/etc/grafana/grafana.ini - cfg:default.paths.data=/srv/grafana - cfg:default.paths.plugins=/srv/grafana/plugins - cfg:default.paths.logs=/srv/logs - cfg:default.log.mode=console - cfg:default.log.console.format=console - cfg:default.server.root_url="https://%%(domain)s/graph" {{- if .PerconaSSODetails}} cfg:default.server.domain="{{ .PMMServerAddress }}" cfg:default.auth.generic_oauth.enabled=true diff --git a/managed/testdata/supervisord.d/grafana.ini b/managed/testdata/supervisord.d/grafana.ini index b3e4213506..c6a0788699 100644 --- a/managed/testdata/supervisord.d/grafana.ini +++ b/managed/testdata/supervisord.d/grafana.ini @@ -3,15 +3,9 @@ [program:grafana] priority = 3 command = - /usr/sbin/grafana-server + /usr/sbin/grafana server --homepath=/usr/share/grafana --config=/etc/grafana/grafana.ini - cfg:default.paths.data=/srv/grafana - cfg:default.paths.plugins=/srv/grafana/plugins - cfg:default.paths.logs=/srv/logs - cfg:default.log.mode=console - cfg:default.log.console.format=console - cfg:default.server.root_url="https://%%(domain)s/graph" environment = PERCONA_TEST_POSTGRES_ADDR="", PERCONA_TEST_POSTGRES_DBNAME="", diff --git a/update/ansible/playbook/tasks/files/change-admin-password b/update/ansible/playbook/tasks/files/change-admin-password index 60f2484470..1a8b9f8819 100644 --- a/update/ansible/playbook/tasks/files/change-admin-password +++ b/update/ansible/playbook/tasks/files/change-admin-password @@ -2,4 +2,4 @@ # # Change password for default admin user in PMM -grafana-cli --config=/etc/grafana/grafana.ini --homepath /usr/share/grafana --configOverrides cfg:default.paths.data=/srv/grafana admin reset-admin-password $1 +grafana cli --config=/etc/grafana/grafana.ini --homepath /usr/share/grafana admin reset-admin-password $1 diff --git a/update/ansible/playbook/tasks/roles/grafana/files/grafana.ini b/update/ansible/playbook/tasks/roles/grafana/files/grafana.ini index 73a6ed90e7..801ff835a9 100644 --- a/update/ansible/playbook/tasks/roles/grafana/files/grafana.ini +++ b/update/ansible/playbook/tasks/roles/grafana/files/grafana.ini @@ -4,11 +4,29 @@ [paths] # Directory where grafana will automatically scan and look for plugins plugins = /srv/grafana/plugins +# Directory where grafana can store logs +logs = /srv/logs +# Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used) +data = /srv/grafana + +#################################### Logging ########################## +[log] +# Either "console", "file", "syslog". Default is console and file +mode = console + +# For "console" mode only +[log.console] +# log line format, valid options are text, console and json +format = console #################################### Server #################################### [server] # enable gzip enable_gzip = true +# The public facing domain name used to access grafana from a browser +domain = 127.0.0.1 +# The full public facing url +root_url = https://%(domain)s/graph #################################### Snapshots ########################### [snapshots] diff --git a/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml b/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml index cce395aa28..405ed30a00 100644 --- a/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml +++ b/update/ansible/playbook/tasks/roles/grafana/tasks/main.yml @@ -5,7 +5,7 @@ state: directory owner: grafana group: grafana - mode: '0775' + mode: "0775" loop: - /srv/grafana - /srv/grafana/plugins @@ -13,7 +13,7 @@ - name: Set Grafana folder for plugins on /srv partition for all users lineinfile: path: /etc/bashrc - line: 'export GF_PLUGIN_DIR=/srv/grafana/plugins' + line: "export GF_PLUGIN_DIR=/srv/grafana/plugins" - name: Copy new version of grafana.ini copy: @@ -21,7 +21,7 @@ dest: /etc/grafana/grafana.ini owner: grafana group: grafana - mode: '0444' + mode: "0444" - name: Create provisioning directory file: @@ -46,5 +46,5 @@ - dashboards - name: Upgrade grafana database (Get the latest schema) - command: grafana-cli --homepath=/usr/share/grafana admin data-migration encrypt-datasource-passwords + command: grafana cli --homepath=/usr/share/grafana admin data-migration encrypt-datasource-passwords changed_when: True