未验证 提交 96788609 编写于 作者: Y yswdqz 提交者: GitHub

Change scapedMetricsNameCache method to support `/` (#10349)

上级 60b061f5
......@@ -88,6 +88,7 @@
* Remove handler scan in otel receiver, manual initialization instead
* Add aws-firehose-receiver to support collecting AWS CloudWatch metric(OpenTelemetry format)
* Avoid Antlr dependencies' versions might be different in compile time and runtime.
* Now `PrometheusMetricConverter#escapedName` also support converting `/` to `_`.
#### UI
......
......@@ -71,7 +71,7 @@ public class PrometheusMetricConverter {
public PrometheusMetricConverter(Rule rule, MeterSystem service) {
this.convert = new MetricConvert(rule, service);
this.metricsNameEscapePattern = Pattern.compile("\\.");
this.metricsNameEscapePattern = Pattern.compile("[/.]");
}
/**
......@@ -160,7 +160,7 @@ public class PrometheusMetricConverter {
return Optional.of(Tuple.of(escapedName(metric.getName()), SampleFamilyBuilder.newBuilder(ss).build()));
}
// Returns the escaped name of the given one, with "." replaced by "_"
// Returns the escaped name of the given one, with "." and "/" replaced by "_"
protected String escapedName(final String name) {
try {
return escapedMetricsNameCache.get(name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册