Skip to content

Commit

Permalink
Merge pull request quarkusio#33565 from radcortez/fix-33493
Browse files Browse the repository at this point in the history
Removed manual OTel properties for fallback, since they are now provided automatically
  • Loading branch information
radcortez authored May 24, 2023
2 parents 3d08855 + cad9a5f commit 8101c3e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import io.quarkus.opentelemetry.runtime.config.runtime.OTelRuntimeConfig;
import io.quarkus.opentelemetry.runtime.config.runtime.exporter.OtlpExporterRuntimeConfig;
import io.quarkus.test.QuarkusUnitTest;
import io.smallrye.config.SmallRyeConfig;

class OpenTelemetryLegacyConfigurationTest {
@RegisterExtension
Expand All @@ -41,6 +42,8 @@ class OpenTelemetryLegacyConfigurationTest {
OtlpExporterBuildConfig otlpExporterBuildConfig;
@Inject
OtlpExporterRuntimeConfig otlpExporterRuntimeConfig;
@Inject
SmallRyeConfig config;

@Test
void config() {
Expand All @@ -61,4 +64,25 @@ void config() {
assertEquals("header=value", otlpExporterRuntimeConfig.traces().headers().get().get(0));
assertEquals("http://localhost:4318/", otlpExporterRuntimeConfig.traces().legacyEndpoint().get());
}

@Test
void names() {
assertTrue(config.isPropertyPresent("quarkus.otel.enabled"));
assertTrue(config.isPropertyPresent("quarkus.otel.metrics.exporter"));
assertTrue(config.isPropertyPresent("quarkus.otel.propagators"));
assertTrue(config.isPropertyPresent("quarkus.otel.logs.exporter"));
assertTrue(config.isPropertyPresent("quarkus.otel.traces.enabled"));
assertTrue(config.isPropertyPresent("quarkus.otel.traces.exporter"));
assertTrue(config.isPropertyPresent("quarkus.otel.traces.sampler"));
assertTrue(config.isPropertyPresent("quarkus.otel.sdk.disabled"));
assertTrue(config.isPropertyPresent("quarkus.otel.service.name"));
assertTrue(config.isPropertyPresent("quarkus.otel.attribute.count.limit"));
assertTrue(config.isPropertyPresent("quarkus.otel.span.attribute.count.limit"));
assertTrue(config.isPropertyPresent("quarkus.otel.span.event.count.limit"));
assertTrue(config.isPropertyPresent("quarkus.otel.span.link.count.limit"));
assertTrue(config.isPropertyPresent("quarkus.otel.bsp.schedule.delay"));
assertTrue(config.isPropertyPresent("quarkus.otel.bsp.max.queue.size"));
assertTrue(config.isPropertyPresent("quarkus.otel.bsp.max.export.batch.size"));
assertTrue(config.isPropertyPresent("quarkus.otel.bsp.export.timeout"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,6 @@ public Iterator<String> iterateNames(final ConfigSourceInterceptorContext contex
names.add(name);
}
}

// TODO - Required because the defaults ConfigSource for mappings does not provide configuration names.
names.add("quarkus.otel.enabled");
names.add("quarkus.otel.metrics.exporter");
names.add("quarkus.otel.propagators");
names.add("quarkus.otel.logs.exporter");
names.add("quarkus.otel.traces.enabled");
names.add("quarkus.otel.traces.exporter");
names.add("quarkus.otel.traces.sampler");
names.add("quarkus.otel.sdk.disabled");
names.add("quarkus.otel.service.name");
names.add("quarkus.otel.attribute.value.length.limit");
names.add("quarkus.otel.attribute.count.limit");
names.add("quarkus.otel.span.attribute.count.limit");
names.add("quarkus.otel.span.event.count.limit");
names.add("quarkus.otel.span.link.count.limit");
names.add("quarkus.otel.bsp.schedule.delay");
names.add("quarkus.otel.bsp.max.queue.size");
names.add("quarkus.otel.bsp.max.export.batch.size");
names.add("quarkus.otel.bsp.export.timeout");
names.add("quarkus.otel.experimental.resource.disabled-keys");
return names.iterator();
}
}

0 comments on commit 8101c3e

Please sign in to comment.