Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

[exporter-prometheus] Sanitize metric names in getPrometheusMetricName. #167

Closed
songy23 opened this issue Oct 26, 2018 · 1 comment
Closed

Comments

@songy23
Copy link
Contributor

songy23 commented Oct 26, 2018

private getPrometheusMetricName(view: View): string {
return `${this.prefix}_${view.name}_${this.getUnit(view)}`;
}
.

See the original discussion on #165 (comment).

We should replace all unsupported characters (e.g '/') with '_' for Prometheus metric names. Example in Go: https://github.com/census-instrumentation/opencensus-go/blob/master/internal/sanitize.go. Java: https://github.com/prometheus/client_java/blob/master/simpleclient/src/main/java/io/prometheus/client/Collector.java#L186-L196.

@mayurkale22
Copy link
Member

Fixed in #217

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants