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
|
if (metricExporterFactory
|
||||||
.getClass()
|
.getClass()
|
||||||
.getSimpleName()
|
.getSimpleName()
|
||||||
.replace("_", "")
|
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.startsWith(exporterName.toLowerCase())) {
|
.startsWith(exporterName(exporterName).toLowerCase())) {
|
||||||
return metricExporterFactory;
|
return metricExporterFactory;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,9 +109,8 @@ public class TracerInstaller {
|
||||||
if (metricServer
|
if (metricServer
|
||||||
.getClass()
|
.getClass()
|
||||||
.getSimpleName()
|
.getSimpleName()
|
||||||
.replace("_", "")
|
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.startsWith(exporterName.toLowerCase())) {
|
.startsWith(exporterName(exporterName).toLowerCase())) {
|
||||||
return metricServer;
|
return metricServer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,15 +125,18 @@ public class TracerInstaller {
|
||||||
if (spanExporterFactory
|
if (spanExporterFactory
|
||||||
.getClass()
|
.getClass()
|
||||||
.getSimpleName()
|
.getSimpleName()
|
||||||
.replace("_", "")
|
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.startsWith(exporterName.toLowerCase())) {
|
.startsWith(exporterName(exporterName).toLowerCase())) {
|
||||||
return spanExporterFactory;
|
return spanExporterFactory;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
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) {
|
private static synchronized void installExportersFromJar(String exporterJar, Properties config) {
|
||||||
URL url;
|
URL url;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue