Incorrect variable interpolation for Performance queries when multiple variables have similar names

Description

When you have 2 variables defined in a Dashboard that have the same beginning of the name such as $node and $nodeId in a Performance query, the interpolation (replacing variables with actual values) may be incorrect.

If you use the one with the longer name, e.g. $nodeId, in a query, the interpolation may first match on the one with the shorter name ($node in this case). If the $nodeId value is 1, the interpolated value will end up being 1Id, i.e. $node being substituted with 1, then Id left as is.

The ends up causing the query to fail, e.g. looking for a resource with a node ID of 1Id instead of 1.

Solution is to add \b (word boundary) at the end of the regex, so that trying to match /\$node\b/ in "$nodeId" doesn’t match.

Activity

Show:
Unresolved

Assignee

Scott Theleman

Reporter

Fix versions

Affects versions

Sprint

Priority

Created December 10, 2024 at 12:08 AM
Updated February 11, 2025 at 4:08 PM
Loading...