Skip to content

Commit

Permalink
Replace comments about recorder method execution with markers
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand committed Apr 15, 2024
1 parent fd34e44 commit 43e92f3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import io.quarkus.arc.SyntheticCreationalContext;
import io.quarkus.opentelemetry.runtime.config.runtime.OTelRuntimeConfig;
import io.quarkus.runtime.annotations.Recorder;
import io.quarkus.runtime.annotations.RuntimeInit;
import io.quarkus.runtime.annotations.StaticInit;
import io.quarkus.runtime.configuration.DurationConverter;
import io.smallrye.config.ConfigValue;
import io.smallrye.config.SmallRyeConfig;
Expand All @@ -30,23 +32,23 @@ public class OpenTelemetryRecorder {

public static final String OPEN_TELEMETRY_DRIVER = "io.opentelemetry.instrumentation.jdbc.OpenTelemetryDriver";

/* STATIC INIT */
@StaticInit
public void resetGlobalOpenTelemetryForDevMode() {
GlobalOpenTelemetry.resetForTest();
GlobalEventEmitterProvider.resetForTest();
}

/* RUNTIME INIT */
@RuntimeInit
public void eagerlyCreateContextStorage() {
ContextStorage.get();
}

/* RUNTIME INIT */
@RuntimeInit
public void storeVertxOnContextStorage(Supplier<Vertx> vertx) {
QuarkusContextStorage.vertx = vertx.get();
}

/* RUNTIME INIT */
@RuntimeInit
public Function<SyntheticCreationalContext<OpenTelemetry>, OpenTelemetry> opentelemetryBean(
OTelRuntimeConfig oTelRuntimeConfig) {
return new Function<>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
import io.opentelemetry.semconv.ResourceAttributes;
import io.quarkus.arc.runtime.BeanContainer;
import io.quarkus.runtime.annotations.Recorder;
import io.quarkus.runtime.annotations.StaticInit;

@Recorder
public class TracerRecorder {

public static final Set<String> dropNonApplicationUriTargets = new HashSet<>();
public static final Set<String> dropStaticResourceTargets = new HashSet<>();

/* STATIC INIT */
@StaticInit
public void setAttributes(
BeanContainer beanContainer,
String quarkusVersion,
Expand All @@ -35,7 +36,7 @@ public void setAttributes(
.getAttributes());
}

/* STATIC INIT */
@StaticInit
public void setupSampler(
List<String> dropNonApplicationUris,
List<String> dropStaticResources) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import io.quarkus.opentelemetry.runtime.tracing.intrumentation.vertx.SqlClientInstrumenterVertxTracer;
import io.quarkus.runtime.RuntimeValue;
import io.quarkus.runtime.annotations.Recorder;
import io.quarkus.runtime.annotations.RuntimeInit;
import io.vertx.core.VertxOptions;
import io.vertx.core.metrics.MetricsOptions;
import io.vertx.core.tracing.TracingOptions;
Expand All @@ -34,14 +35,15 @@ public InstrumentationRecorder(RuntimeValue<OTelRuntimeConfig> config) {
this.config = config;
}

/* RUNTIME INIT */
@RuntimeInit
public Consumer<VertxOptions> getVertxTracingOptions() {
TracingOptions tracingOptions = new TracingOptions()
.setFactory(FACTORY);
return vertxOptions -> vertxOptions.setTracingOptions(tracingOptions);
}

/* RUNTIME INIT */
@RuntimeInit
public void setupVertxTracer(BeanContainer beanContainer, boolean sqlClientAvailable,
boolean redisClientAvailable, final String semconvStability) {
OpenTelemetry openTelemetry = beanContainer.beanInstance(OpenTelemetry.class);
Expand Down

0 comments on commit 43e92f3

Please sign in to comment.