fix finding SpanExporterFactory by exporterName with underscore e.g. "otlp_span" (#1404)
* #1401 fix finding SpanExporterFactory by exporterName with underscore e.g. "otlp_span" Signed-off-by: Sergei Malafeev <sergei@malafeev.org> * #1401 change exporterName of "otlp_span" and "otlp_metric" only Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
This commit is contained in:
parent
a5aba2d8f5
commit
1674b46d4a
|
@ -93,9 +93,8 @@ public class TracerInstaller {
|
|||
if (metricExporterFactory
|
||||
.getClass()
|
||||
.getSimpleName()
|
||||
.replace("_", "")
|
||||
.toLowerCase()
|
||||
.startsWith(exporterName.toLowerCase())) {
|
||||
.startsWith(exporterName(exporterName).toLowerCase())) {
|
||||
return metricExporterFactory;
|
||||
}
|
||||
}
|
||||
|
@ -110,9 +109,8 @@ public class TracerInstaller {
|
|||
if (metricServer
|
||||
.getClass()
|
||||
.getSimpleName()
|
||||
.replace("_", "")
|
||||
.toLowerCase()
|
||||
.startsWith(exporterName.toLowerCase())) {
|
||||
.startsWith(exporterName(exporterName).toLowerCase())) {
|
||||
return metricServer;
|
||||
}
|
||||
}
|
||||
|
@ -127,15 +125,18 @@ public class TracerInstaller {
|
|||
if (spanExporterFactory
|
||||
.getClass()
|
||||
.getSimpleName()
|
||||
.replace("_", "")
|
||||
.toLowerCase()
|
||||
.startsWith(exporterName.toLowerCase())) {
|
||||
.startsWith(exporterName(exporterName).toLowerCase())) {
|
||||
return spanExporterFactory;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String exporterName(String exporterName) {
|
||||
return exporterName.replace("otlp_span", "otlpspan").replace("otlp_metric", "otlpmetric");
|
||||
}
|
||||
|
||||
private static synchronized void installExportersFromJar(String exporterJar, Properties config) {
|
||||
URL url;
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue