forked from inspectIT/inspectit-ocelot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inspectIT#1269: Integrated the concept of an IOpenTelemetryController…
… that handles the registration and unregister of individual traces and metrics exporter services. Fixed JaegerExporterService, PrometheusExporterService, ZipkinExporterService to work with inspectIT Ocelot. Adjusted build.gradle in the core package and added a SpringTestBase.yml configuration to speed up tests in the core module (as the OTEL implementation of the Prometheus server needs ~10 seconds to shut down).
- Loading branch information
Heiko Holz
committed
Jan 11, 2022
1 parent
0326626
commit 37bdc0a
Showing
31 changed files
with
1,598 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...rc/main/java/rocks/inspectit/ocelot/bootstrap/opentelemetry/IOpenTelemetryController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package rocks.inspectit.ocelot.bootstrap.opentelemetry; | ||
|
||
/** | ||
* Controller interface for the OpenTelemetryController. Its implementation is {@link rocks.inspectit.ocelot.core.opentelemetry.OpenTelemetryControllerImpl} | ||
*/ | ||
public interface IOpenTelemetryController { | ||
|
||
/** | ||
* Shuts down the {@link IOpenTelemetryController} | ||
*/ | ||
void shutdown(); | ||
|
||
/** | ||
* Starts the {@link IOpenTelemetryController} | ||
* | ||
* @return Whether the {@link IOpenTelemetryController} was successfuly started | ||
*/ | ||
boolean start(); | ||
|
||
/** | ||
* Gets whether the {@link IOpenTelemetryController} is configured | ||
* | ||
* @return Whether the {@link IOpenTelemetryController} is configured | ||
*/ | ||
boolean isConfigured(); | ||
|
||
/** | ||
* Gets whether the {@link IOpenTelemetryController} is enabled | ||
* | ||
* @return Whether the {@link IOpenTelemetryController} is enabled | ||
*/ | ||
boolean isEnabled(); | ||
|
||
/** | ||
* Notifies the {@link IOpenTelemetryController} that something in the {@link rocks.inspectit.ocelot.config.model.tracing.TracingSettings} changed | ||
*/ | ||
void notifyTracingSettingsChanged(); | ||
|
||
/** | ||
* Notifies the {@link IOpenTelemetryController} that something in the {@link rocks.inspectit.ocelot.config.model.metrics.MetricsSettings} changed | ||
*/ | ||
void notifyMetricsSettingsChanged(); | ||
} |
36 changes: 36 additions & 0 deletions
36
...main/java/rocks/inspectit/ocelot/bootstrap/opentelemetry/NoopOpenTelemetryController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package rocks.inspectit.ocelot.bootstrap.opentelemetry; | ||
|
||
public class NoopOpenTelemetryController implements IOpenTelemetryController { | ||
|
||
public static final NoopOpenTelemetryController INSTANCE = new NoopOpenTelemetryController(); | ||
|
||
@Override | ||
public void shutdown() { | ||
|
||
} | ||
|
||
@Override | ||
public boolean start() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean isConfigured() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isEnabled() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void notifyTracingSettingsChanged() { | ||
|
||
} | ||
|
||
@Override | ||
public void notifyMetricsSettingsChanged() { | ||
|
||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...n/java/rocks/inspectit/ocelot/config/model/exporters/trace/OtlpTraceExporterSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package rocks.inspectit.ocelot.config.model.exporters.trace; | ||
|
||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* Settings for {@link rocks.inspectit.ocelot.core.exporter.OtlpTraceExporterService} | ||
*/ | ||
@Data | ||
@NoArgsConstructor | ||
public class OtlpTraceExporterSettings { | ||
|
||
private boolean enabled; | ||
|
||
/*** | ||
* The OTLP traces endpoint to connect to | ||
*/ | ||
private String url; | ||
|
||
private String serviceName; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...va/rocks/inspectit/ocelot/core/exporter/DynamicallyActivatableMetricsExporterService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package rocks.inspectit.ocelot.core.exporter; | ||
|
||
import io.opentelemetry.sdk.metrics.SdkMeterProvider; | ||
import io.opentelemetry.sdk.metrics.export.MetricReader; | ||
import io.opentelemetry.sdk.metrics.export.MetricReaderFactory; | ||
import rocks.inspectit.ocelot.config.model.InspectitConfig; | ||
import rocks.inspectit.ocelot.config.model.exporters.metrics.PrometheusExporterSettings; | ||
import rocks.inspectit.ocelot.core.service.DynamicallyActivatableService; | ||
|
||
/** | ||
* Base class for metrics export services that can be dynamically enabled and disabled based on the {@link InspectitConfig}. | ||
* This class extends {@link DynamicallyActivatableService} which handles the waiting for changes in the configuration. | ||
*/ | ||
public abstract class DynamicallyActivatableMetricsExporterService extends DynamicallyActivatableService { | ||
|
||
/** | ||
* Gets a {@link MetricReaderFactory} for this service. | ||
* | ||
* @return | ||
*/ | ||
public abstract MetricReaderFactory getMetricReaderFactory(); | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param configDependencies The list of configuration properties in camelCase this service depends on. | ||
* For example "exporters.metrics.prometheus" specifies a dependency | ||
* to {@link PrometheusExporterSettings} | ||
* and all its children. | ||
*/ | ||
public DynamicallyActivatableMetricsExporterService(String... configDependencies) { | ||
super(configDependencies); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.