mirror of
https://github.com/prometheus/prometheus.git
synced 2025-11-29 14:41:01 +01:00
Add urlQueryEscape to template functions
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
This commit is contained in:
parent
817dde743c
commit
50de066a7e
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## main / unreleased
|
## main / unreleased
|
||||||
|
|
||||||
|
* [FEATURE] Templates: Add urlQueryEscape to template functions. #17403
|
||||||
|
|
||||||
## 3.7.2 / 2025-10-22
|
## 3.7.2 / 2025-10-22
|
||||||
|
|
||||||
* [BUGFIX] AWS SD: Fix AWS SDK v2 credentials handling for EC2 and Lightsail discovery. #17355
|
* [BUGFIX] AWS SD: Fix AWS SDK v2 credentials handling for EC2 and Lightsail discovery. #17355
|
||||||
|
|||||||
@ -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. |
|
| 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. |
|
| 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. |
|
| 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
|
### Others
|
||||||
|
|
||||||
|
|||||||
@ -288,6 +288,7 @@ func NewTemplateExpander(
|
|||||||
}
|
}
|
||||||
return float64(time.Duration(v)) / float64(time.Second), nil
|
return float64(time.Duration(v)) / float64(time.Second), nil
|
||||||
},
|
},
|
||||||
|
"urlQueryEscape": url.QueryEscape,
|
||||||
},
|
},
|
||||||
options: options,
|
options: options,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user