From ffe57962eac595b46f38f8bbd34c128703d673e3 Mon Sep 17 00:00:00 2001 From: Heiko Holz Date: Thu, 13 Jan 2022 13:58:14 +0100 Subject: [PATCH] #1269: Moved DynamicMultiSpanExporter --- .../DynamicMultiSpanExporter.java | 2 +- .../core/opentelemetry/OpenTelemetryControllerImpl.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) rename inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/{exporter => opentelemetry}/DynamicMultiSpanExporter.java (98%) diff --git a/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/exporter/DynamicMultiSpanExporter.java b/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/opentelemetry/DynamicMultiSpanExporter.java similarity index 98% rename from inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/exporter/DynamicMultiSpanExporter.java rename to inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/opentelemetry/DynamicMultiSpanExporter.java index 8469cbe78b..8e7191f39c 100644 --- a/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/exporter/DynamicMultiSpanExporter.java +++ b/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/opentelemetry/DynamicMultiSpanExporter.java @@ -1,4 +1,4 @@ -package rocks.inspectit.ocelot.core.exporter; +package rocks.inspectit.ocelot.core.opentelemetry; import io.opentelemetry.sdk.common.CompletableResultCode; import io.opentelemetry.sdk.trace.SpanProcessor; diff --git a/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/opentelemetry/OpenTelemetryControllerImpl.java b/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/opentelemetry/OpenTelemetryControllerImpl.java index 9c581ea31e..0858d24702 100644 --- a/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/opentelemetry/OpenTelemetryControllerImpl.java +++ b/inspectit-ocelot-core/src/main/java/rocks/inspectit/ocelot/core/opentelemetry/OpenTelemetryControllerImpl.java @@ -37,7 +37,6 @@ import rocks.inspectit.ocelot.config.model.InspectitConfig; import rocks.inspectit.ocelot.core.config.InspectitConfigChangedEvent; import rocks.inspectit.ocelot.core.config.InspectitEnvironment; -import rocks.inspectit.ocelot.core.exporter.DynamicMultiSpanExporter; import rocks.inspectit.ocelot.core.exporter.DynamicallyActivatableMetricsExporterService; import rocks.inspectit.ocelot.core.exporter.DynamicallyActivatableTraceExporterService; import rocks.inspectit.ocelot.core.utils.OpenCensusShimUtils; @@ -130,6 +129,8 @@ public class OpenTelemetryControllerImpl implements IOpenTelemetryController { /** * The {@link MeterProviderImpl} that wraps {@link SdkMeterProvider} */ + @VisibleForTesting + @Getter(AccessLevel.PACKAGE) private MeterProviderImpl meterProvider; @Autowired @@ -485,7 +486,7 @@ public boolean registerTraceExporterService(DynamicallyActivatableTraceExporterS private boolean unregisterTraceExporterService(String serviceName) { // unregister the service by removing it from the map of registered services and from the spanExporter // evaluates to true when a service with the given name was previously registered - if (null != registeredTraceExportServices.remove(serviceName) & (spanExporter == null || !spanExporter.unregisterSpanExporter(serviceName))) { + if (null != registeredTraceExportServices.remove(serviceName) & (spanExporter == null || spanExporter.unregisterSpanExporter(serviceName))) { notifyTracingSettingsChanged(); return true; } else {