Skip to content

Commit

Permalink
Merge branch 'main' into PMM-12151-12273-explain
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriCtvrtka authored Jul 28, 2023
2 parents 2cd4646 + 5a88533 commit d3afd2f
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 41 deletions.
9 changes: 1 addition & 8 deletions build/ansible/roles/pmm2-images/files/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/packages/deb/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/build-server-rpm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
18 changes: 10 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
8 changes: 1 addition & 7 deletions managed/services/supervisord/supervisord.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions managed/testdata/supervisord.d/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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="",
Expand Down
2 changes: 1 addition & 1 deletion update/ansible/playbook/tasks/files/change-admin-password
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 18 additions & 0 deletions update/ansible/playbook/tasks/roles/grafana/files/grafana.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions update/ansible/playbook/tasks/roles/grafana/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
state: directory
owner: grafana
group: grafana
mode: '0775'
mode: "0775"
loop:
- /srv/grafana
- /srv/grafana/plugins

- 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:
src: grafana.ini
dest: /etc/grafana/grafana.ini
owner: grafana
group: grafana
mode: '0444'
mode: "0444"

- name: Create provisioning directory
file:
Expand All @@ -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

0 comments on commit d3afd2f

Please sign in to comment.