Page MenuHomePhabricator

Move grafana-plugins from Gerrit to Gitlab to ease building the package
Closed, ResolvedPublic

Description

As of now, the source for grafana-plugins lives on Gerrit which requires several manual steps in order to build the package each time we add a new plugin or update the existing ones.

Migrating the repository to GitLab would allow us to use the GitLab CI pipeline [1] to ease the process which will be beneficial as now we'll have to update the Prometheus data source independently of the Grafana package due to T436045.

  • Add GitLab pipeline
  • Add project to GitLab trusted runners
  • Add it to the apt repo to promote from staging
  • Update Wikitech instructions
  • Add auto restart for grafana-server after grafana-plugins upgrade

[1] https://wikitech.wikimedia.org/wiki/Debian_packaging/Package_your_software_as_deb#GitLab_CI_pipeline

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Download full versions of plugins to have all datarepos/sre/grafana-plugins!17denisseT436056main
Only download Linux x64 versionsrepos/sre/grafana-plugins!16denisseT436056main
Add GitLab CI wmfdeb pipelinerepos/sre/grafana-plugins!15denisseT436056main
Add CHANGELOG as symlink for debian/changelogrepos/sre/grafana-plugins!14denisseT436056-2main
Add CHANGELOG as symlink for debian/changelogrepos/sre/grafana-plugins!13denisseT436056-2main
Add CHANGELOG as symlink for debian/changelogrepos/sre/grafana-plugins!12denisseT436056-2main
Add repos/sre/grafana-pluginsrepos/releng/gitlab-trusted-runner!185denisseT436056main
Add GitLab CI wmfdeb pipelinerepos/sre/grafana-plugins!2denisseT436056main
Update .gitreview to use GitLabrepos/sre/grafana-plugins!1denisseT436056main
Customize query in GitLab

Event Timeline

The project now lives on GitLab but the CI pipeline [1] is not published in the catalog, it may be a good idea to create a release for it and add it to the catalog so it's easier to re-use.

[1] https://gitlab.wikimedia.org/repos/sre/wmf-debci

Mentioned in SAL (#wikimedia-operations) [2026-09-08T05:07:28Z] <denisse> Add grafana-plugins 0.10 to bookworm-wikimedia - T436056

Mentioned in SAL (#wikimedia-operations) [2026-09-08T07:30:05Z] <denisse> Add grafana-plugins 0.15 to bookworm-wikimedia - T436056

Change #1338064 had a related patch set uploaded (by Andrea Denisse; author: Andrea Denisse):

[operations/puppet@production] aptrepo: Add grafana-plugins to apt-staging

https://gerrit.wikimedia.org/r/1338064

Change #1338064 merged by Andrea Denisse:

[operations/puppet@production] aptrepo: Add grafana-plugins to main apt repo

https://gerrit.wikimedia.org/r/1338064

Change #1338350 had a related patch set uploaded (by Andrea Denisse; author: Andrea Denisse):

[operations/puppet@production] grafana: Add grafana-plugins to grafana-server suscription

https://gerrit.wikimedia.org/r/1338350

While looking at CI build artifacts I noticed that for some plugins we're downloading the version for all targets:

'build/out/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe' -> '/builds/repos/sre/grafana-plugins/debian/grafana-plugins/var/lib/grafana/plugins/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe'

We certainly don't need the Windows, ARM, or MacOS versions, we can remove them and decrease the .deb size that is currently 186.7 MiB.

While looking at CI build artifacts I noticed that for some plugins we're downloading the version for all targets:

'build/out/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe' -> '/builds/repos/sre/grafana-plugins/debian/grafana-plugins/var/lib/grafana/plugins/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe'

We certainly don't need the Windows, ARM, or MacOS versions, we can remove them and decrease the .deb size that is currently 186.7 MiB.

Sent a patch for this and the .deb size went from 186.65 MiB to 44.76 MiB, testing the package...

While looking at CI build artifacts I noticed that for some plugins we're downloading the version for all targets:

'build/out/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe' -> '/builds/repos/sre/grafana-plugins/debian/grafana-plugins/var/lib/grafana/plugins/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe'

We certainly don't need the Windows, ARM, or MacOS versions, we can remove them and decrease the .deb size that is currently 186.7 MiB.

Sent a patch for this and the .deb size went from 186.65 MiB to 44.76 MiB, testing the package...

Tested in grafana-next, for some reason Loki is not present, investigating...

While looking at CI build artifacts I noticed that for some plugins we're downloading the version for all targets:

'build/out/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe' -> '/builds/repos/sre/grafana-plugins/debian/grafana-plugins/var/lib/grafana/plugins/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe'

We certainly don't need the Windows, ARM, or MacOS versions, we can remove them and decrease the .deb size that is currently 186.7 MiB.

Sent a patch for this and the .deb size went from 186.65 MiB to 44.76 MiB, testing the package...

Tested in grafana-next, for some reason Loki is not present, investigating...

So weird...

Sep 10 06:40:15 grafana2001 grafana[2801383]: logger=plugins.signature t=2026-09-10T06:40:15.922340198Z level=warn msg="Plugin file listed in the manifest was not found" plugin=loki path=gpx_grafana-loki-datasource_linux_arm64
Sep 10 06:40:15 grafana2001 grafana[2801383]: logger=plugins.signature.validation t=2026-09-10T06:40:15.922613479Z level=warn msg="Skipping loading plugin due to problem with signature" pluginId=loki status=modified
Sep 10 06:40:15 grafana2001 grafana[2801383]: logger=plugins.validation t=2026-09-10T06:40:15.922790847Z level=error msg="Plugin validation failed" pluginId=loki error="plugin 'loki' has an modified signature"

So even tho it's not required for Linux x64 the manifest looks for the arm64 file and if it can't find it it fails to install, I'll revert the change for it and possibly send a patch upstream to fix it.

Something interesting to note is that the plugins load much faster on grafana-next with this change, whereas in grafana they stay in "Loading..." for about a minute... I'm also not sure if I want to implement this change, it makes the .deb smaller and plugins load significantly faster but looking at what happened with Loki I guess they're prone to breaking if upstream makes a bad update or something so maybe it's better to download everything from the plugin, just in case...

While looking at CI build artifacts I noticed that for some plugins we're downloading the version for all targets:

'build/out/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe' -> '/builds/repos/sre/grafana-plugins/debian/grafana-plugins/var/lib/grafana/plugins/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe'

We certainly don't need the Windows, ARM, or MacOS versions, we can remove them and decrease the .deb size that is currently 186.7 MiB.

Sent a patch for this and the .deb size went from 186.65 MiB to 44.76 MiB, testing the package...

Tested in grafana-next, for some reason Loki is not present, investigating...

So weird...

Sep 10 06:40:15 grafana2001 grafana[2801383]: logger=plugins.signature t=2026-09-10T06:40:15.922340198Z level=warn msg="Plugin file listed in the manifest was not found" plugin=loki path=gpx_grafana-loki-datasource_linux_arm64
Sep 10 06:40:15 grafana2001 grafana[2801383]: logger=plugins.signature.validation t=2026-09-10T06:40:15.922613479Z level=warn msg="Skipping loading plugin due to problem with signature" pluginId=loki status=modified
Sep 10 06:40:15 grafana2001 grafana[2801383]: logger=plugins.validation t=2026-09-10T06:40:15.922790847Z level=error msg="Plugin validation failed" pluginId=loki error="plugin 'loki' has an modified signature"

So even tho it's not required for Linux x64 the manifest looks for the arm64 file and if it can't find it it fails to install, I'll revert the change for it and possibly send a patch upstream to fix it.

Something interesting to note is that the plugins load much faster on grafana-next with this change, whereas in grafana they stay in "Loading..." for about a minute... I'm also not sure if I want to implement this change, it makes the .deb smaller and plugins load significantly faster but looking at what happened with Loki I guess they're prone to breaking if upstream makes a bad update or something so maybe it's better to download everything from the plugin, just in case...

It also seems like they don't package plugins correctly for each architechture and they have dependencies that are not properly added, for ex. The README.md for the Prometheus datasource is absent from the Linux x64 version. I'm definitely reverting the change to download the full plugin and don't miss anything.

Screenshot From 2026-09-10 01-05-33.png (3,195×1,612 px, 400 KB)

While looking at CI build artifacts I noticed that for some plugins we're downloading the version for all targets:

'build/out/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe' -> '/builds/repos/sre/grafana-plugins/debian/grafana-plugins/var/lib/grafana/plugins/prometheus/gpx_grafana-prometheus-datasource_windows_arm64.exe'

We certainly don't need the Windows, ARM, or MacOS versions, we can remove them and decrease the .deb size that is currently 186.7 MiB.

Sent a patch for this and the .deb size went from 186.65 MiB to 44.76 MiB, testing the package...

Tested in grafana-next, for some reason Loki is not present, investigating...

So weird...

Sep 10 06:40:15 grafana2001 grafana[2801383]: logger=plugins.signature t=2026-09-10T06:40:15.922340198Z level=warn msg="Plugin file listed in the manifest was not found" plugin=loki path=gpx_grafana-loki-datasource_linux_arm64
Sep 10 06:40:15 grafana2001 grafana[2801383]: logger=plugins.signature.validation t=2026-09-10T06:40:15.922613479Z level=warn msg="Skipping loading plugin due to problem with signature" pluginId=loki status=modified
Sep 10 06:40:15 grafana2001 grafana[2801383]: logger=plugins.validation t=2026-09-10T06:40:15.922790847Z level=error msg="Plugin validation failed" pluginId=loki error="plugin 'loki' has an modified signature"

So even tho it's not required for Linux x64 the manifest looks for the arm64 file and if it can't find it it fails to install, I'll revert the change for it and possibly send a patch upstream to fix it.

Something interesting to note is that the plugins load much faster on grafana-next with this change, whereas in grafana they stay in "Loading..." for about a minute... I'm also not sure if I want to implement this change, it makes the .deb smaller and plugins load significantly faster but looking at what happened with Loki I guess they're prone to breaking if upstream makes a bad update or something so maybe it's better to download everything from the plugin, just in case...

It also seems like they don't package plugins correctly for each architechture and they have dependencies that are not properly added, for ex. The README.md for the Prometheus datasource is absent from the Linux x64 version. I'm definitely reverting the change to download the full plugin and don't miss anything.

Screenshot From 2026-09-10 01-05-33.png (3,195×1,612 px, 400 KB)

@MoritzMuehlenhoff , I think you may find this interesting. The specific versions for Linux x64 of the plugins released by Grafana are incomplete, they either don't work because they require other archs or have missing elements like no README.md. 🙃

Change #1338350 merged by Andrea Denisse:

[operations/puppet@production] grafana: Add grafana-plugins to grafana-server suscription

https://gerrit.wikimedia.org/r/1338350

andrea.denisse updated the task description. (Show Details)