Page MenuHomePhabricator

puppetization of check_prometheus is not robust to the use of single quotes
Closed, ResolvedPublic

Description

The monitoring::check_prometheus defined type takes a query as argument. Prometheus itself allows single quotes to be used, like scalar(time() - blazegraph_lastupdated{instance='${::hostname}:9193'}). When passed to the check_prometheus_metric script, this argument is itself surrounded by single quotes (-q 'scalar(time() - blazegraph_lastupdated{instance='wdqs1003:9193'})', which makes it invalid.

The monitoring::check_prometheus defined type should check for those unescaped single quotes, or escape them automagically.

Details

Related Gerrit Patches:

Event Timeline

Gehel created this task.Mar 5 2018, 2:58 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 5 2018, 2:58 PM

Change 556200 had a related patch set uploaded (by Filippo Giunchedi; owner: Filippo Giunchedi):
[operations/puppet@production] monitoring: fail on single-quote Prometheus query

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

Change 556200 merged by Filippo Giunchedi:
[operations/puppet@production] monitoring: fail on single-quote Prometheus query

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

fgiunchedi closed this task as Resolved.Dec 11 2019, 11:49 AM
fgiunchedi claimed this task.

Complete! check_prometheus will fail on queries with single quotes