Add urlQueryEscape to template functions

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
This commit is contained in:
Sylvain Rabot 2025-10-27 10:41:29 +01:00
parent 817dde743c
commit 50de066a7e
No known key found for this signature in database
GPG Key ID: 13D27DFB503A8D91
3 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,8 @@
## main / unreleased
* [FEATURE] Templates: Add urlQueryEscape to template functions. #17403
## 3.7.2 / 2025-10-22
* [BUGFIX] AWS SD: Fix AWS SDK v2 credentials handling for EC2 and Lightsail discovery. #17355

View File

@ -78,6 +78,7 @@ versions.
| tableLink | expr | string | Returns path to tabular ("Table") view in the [expression browser](https://prometheus.io/docs/visualization/browser/) for the expression. |
| parseDuration | string | float | Parses a duration string such as "1h" into the number of seconds it represents. |
| stripDomain | string | string | Removes the domain part of a FQDN. Leaves port untouched. |
| urlQueryEscape | string | string | [url.QueryEscape](https://pkg.go.dev/net/url#QueryEscape) Escapes the string so it can be safely placed inside a URL query. |
### Others

View File

@ -288,6 +288,7 @@ func NewTemplateExpander(
}
return float64(time.Duration(v)) / float64(time.Second), nil
},
"urlQueryEscape": url.QueryEscape,
},
options: options,
}