SoftInstigate / restheart

Rapid API Development with MongoDB
https://restheart.org
GNU Affero General Public License v3.0
807 stars 171 forks source link

Quotes in Prometheus metrics are not escaped #379

Closed christiangroth closed 4 years ago

christiangroth commented 4 years ago

The metrics in format for Prometheus might break, if the database name and/or collection name contains quotes. Unfortunately we sometimes have this sutation with our customers.

Expected Behavior

The metrics should contain correct escaping for quotes. We would also need this fix as part of the platform edition.

Current Behavior

Quotes are not escaped and prematurely end the metrics properties. This leads to a situation where Prometheus can't parse the metrics anymore and the Prometheus Target as a whole does not get collected anymore.

Context

We have missing metrics for pods in kubernetes with this kind of database / collection names.

Possible Implementation

I'll provide a PR shortly and link it to this issue.

mkjsix commented 4 years ago

4.1.9 has been released https://github.com/SoftInstigate/restheart/releases/tag/4.1.9

You need to wait Maven propagation before you can use this in your builds, unless you build the code by yourself.