Skip to content

Commit

Permalink
fix(EUM-server): Add conversion-service to EUM server (#1346)
Browse files Browse the repository at this point in the history
* Add conversionService to EUM-Server

* Refactor Conditional annotations
  • Loading branch information
aaronweissler authored Mar 9, 2022
1 parent a7f0430 commit 2c85192
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import io.opencensus.stats.ViewManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.ConversionService;
import rocks.inspectit.ocelot.config.conversion.InspectitConfigConversionService;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
Expand Down Expand Up @@ -38,4 +40,9 @@ public ViewManager viewManager() {
public ScheduledExecutorService scheduledExecutor() {
return Executors.newScheduledThreadPool(4);
}

@Bean("conversionService")
public ConversionService getConversionService() {
return InspectitConfigConversionService.getInstance();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import rocks.inspectit.oce.eum.server.beacon.Beacon;
import rocks.inspectit.oce.eum.server.configuration.model.BeaconHttpExporterSettings;
Expand All @@ -17,7 +18,8 @@
*/
@Component
@Slf4j
@ConditionalOnExpression("NOT new String('${inspectit-eum-server.exporters.beacons.http.enabled}').equals('DISABLED')")
@ConditionalOnProperty({"inspectit-eum-server.exporters.beacons.http.enabled"})
@ConditionalOnExpression("NOT new String('${inspectit-eum-server.exporters.beacons.http.enabled}').toUpperCase().equals(T(rocks.inspectit.ocelot.config.model.exporters.ExporterEnabledState).DISABLED.toString())")
public class BeaconHttpExporter {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
Expand All @@ -28,7 +29,8 @@
*/
@Slf4j
@Component
@ConditionalOnExpression("NOT new String('${inspectit-eum-server.exporters.beacons.http.enabled}').equals('DISABLED')")
@ConditionalOnProperty({"inspectit-eum-server.exporters.beacons.http.enabled"})
@ConditionalOnExpression("NOT new String('${inspectit-eum-server.exporters.beacons.http.enabled}').toUpperCase().equals(T(rocks.inspectit.ocelot.config.model.exporters.ExporterEnabledState).DISABLED.toString())")
public class ExportWorkerFactory {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void logWrongJaegerConfig() {

@Bean(destroyMethod = "shutdown")
@ConditionalOnProperty({"inspectit-eum-server.exporters.tracing.jaeger.enabled", "inspectit-eum-server.exporters.tracing.jaeger.grpc"})
@ConditionalOnExpression("NOT new String('${inspectit-eum-server.exporters.tracing.jaeger.enabled}').equals('DISABLED') AND new String('${inspectit-eum-server.exporters.tracing.jaeger.grpc}').length() > 0")
@ConditionalOnExpression("(NOT new String('${inspectit-eum-server.exporters.tracing.jaeger.enabled}').toUpperCase().equals(T(rocks.inspectit.ocelot.config.model.exporters.ExporterEnabledState).DISABLED.toString())) AND (new String('${inspectit-eum-server.exporters.tracing.jaeger.grpc}').length() > 0)")
public SpanExporter jaegerSpanExporter() {
JaegerExporterSettings jaegerExporterSettings = configuration.getExporters().getTracing().getJaeger();

Expand Down

0 comments on commit 2c85192

Please sign in to comment.