remove the `millis` from the BSP config options (#2568)

This commit is contained in:
John Watson 2021-01-21 20:29:29 -08:00 committed by GitHub
parent 3acbc5a699
commit d516879084
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -50,7 +50,7 @@ final class TracerProviderConfiguration {
static BatchSpanProcessor configureSpanProcessor(ConfigProperties config, SpanExporter exporter) { static BatchSpanProcessor configureSpanProcessor(ConfigProperties config, SpanExporter exporter) {
BatchSpanProcessorBuilder builder = BatchSpanProcessor.builder(exporter); BatchSpanProcessorBuilder builder = BatchSpanProcessor.builder(exporter);
Long scheduleDelayMillis = config.getLong("otel.bsp.schedule.delay.millis"); Long scheduleDelayMillis = config.getLong("otel.bsp.schedule.delay");
if (scheduleDelayMillis != null) { if (scheduleDelayMillis != null) {
builder.setScheduleDelay(Duration.ofMillis(scheduleDelayMillis)); builder.setScheduleDelay(Duration.ofMillis(scheduleDelayMillis));
} }
@ -65,7 +65,7 @@ final class TracerProviderConfiguration {
builder.setMaxExportBatchSize(maxExportBatch); builder.setMaxExportBatchSize(maxExportBatch);
} }
Integer timeout = config.getInt("otel.bsp.export.timeout.millis"); Integer timeout = config.getInt("otel.bsp.export.timeout");
if (timeout != null) { if (timeout != null) {
builder.setExporterTimeout(Duration.ofMillis(timeout)); builder.setExporterTimeout(Duration.ofMillis(timeout));
} }

View File

@ -39,7 +39,7 @@ class TracerProviderConfigurationTest {
@Test @Test
void configureTracerProvider() { void configureTracerProvider() {
Map<String, String> properties = new HashMap<>(); Map<String, String> properties = new HashMap<>();
properties.put("otel.bsp.schedule.delay.millis", "100000"); properties.put("otel.bsp.schedule.delay", "100000");
properties.put("otel.trace.sampler", "always_off"); properties.put("otel.trace.sampler", "always_off");
Resource resource = Resource.create(Attributes.builder().put("cat", "meow").build()); Resource resource = Resource.create(Attributes.builder().put("cat", "meow").build());
@ -97,10 +97,10 @@ class TracerProviderConfigurationTest {
@Test @Test
void configureSpanProcessor_configured() { void configureSpanProcessor_configured() {
Map<String, String> properties = new HashMap<>(); Map<String, String> properties = new HashMap<>();
properties.put("otel.bsp.schedule.delay.millis", "100000"); properties.put("otel.bsp.schedule.delay", "100000");
properties.put("otel.bsp.max.queue.size", "2"); properties.put("otel.bsp.max.queue.size", "2");
properties.put("otel.bsp.max.export.batch.size", "3"); properties.put("otel.bsp.max.export.batch.size", "3");
properties.put("otel.bsp.export.timeout.millis", "4"); properties.put("otel.bsp.export.timeout", "4");
BatchSpanProcessor processor = BatchSpanProcessor processor =
TracerProviderConfiguration.configureSpanProcessor( TracerProviderConfiguration.configureSpanProcessor(