Skip to content

Fix Grafana chart label templates

Tristan Read requested to merge tr-fix-prom-label-processing into master

What does this MR do?

In some parts of the app we render chart labels that are sourced from Grafana. These labels may contain templates in Moustache style format.

Previously the underscore template function was used to replace these. Unfortunately it does not handle hyphenated variables well: https://stackoverflow.com/questions/16971282/backbone-underscore-template-not-working-dash-in-variable-name.

This MR fixes the issue by removing underscore and replacing with native JS.

Issue: #31376 (closed)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • [n/a] Label as security and @ mention @gitlab-com/gl-security/appsec
  • [n/a] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • [n/a] Security reports checked/validated by a reviewer from the AppSec team
Edited by Tristan Read

Merge request reports