Ballerina-lang: Prometheus monitoring break if using "" in client http string

Created on 25 Feb 2019  路  2Comments  路  Source: ballerina-platform/ballerina-lang

Description:

If using a http client and the request url contains "" it breaks the monitoring.
for example:
var response = solrClient->get("/" +collectionName+ "/select?hl.fl=body&hl.simple.post=</highlight>&hl.simple.pre=<highlight>&hl=on&q=_text_:\"" + untaint queryString)+ "\"";

This is working:
var response = solrClient->get("/" +collectionName+ "/select?hl.fl=body&hl.simple.post=</highlight>&hl.simple.pre=<highlight>&hl=on&q=_text_:" + untaint queryString);

Steps to reproduce:
Use "" in client url
See this slack thread: https://ballerina-platform.slack.com/archives/C47EAELR1/p1551112024024900?thread_ts=1551098753.020800&cid=C47EAELR1

Affected Versions:
Ballerina 0.990.2 as far as tested

AreObservability TeaObservability TypBug

All 2 comments

Hi @Tim-Schwalbe, thank you for reporting this. It seems quotes aren't valid characters for Prometheus metric names. Therefore, we have to escape invalid characters and replace them with underscores: https://prometheus.io/docs/instrumenting/writing_exporters/#naming

Fixed on:

  • master (https://github.com/ballerina-platform/ballerina-lang/pull/20582)
  • 1.1.x (https://github.com/ballerina-platform/ballerina-lang/pull/20583)

great! Thanks a lot! Closed!

Was this page helpful?
0 / 5 - 0 ratings