diff --git a/README.md b/README.md index 3356c358bc7..3503236b277 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Continuous Build][ci-image]][ci-url] [![Coverage Status][codecov-image]][codecov-url] [![Maven Central][maven-image]][maven-url] +[![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/io/opentelemetry/java/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/io/opentelemetry/java/README.md) ## Project Status diff --git a/dependencyManagement/build.gradle.kts b/dependencyManagement/build.gradle.kts index 9194798c861..806ed9abaa2 100644 --- a/dependencyManagement/build.gradle.kts +++ b/dependencyManagement/build.gradle.kts @@ -67,7 +67,7 @@ val DEPENDENCIES = listOf( "io.github.netmikey.logunit:logunit-jul:2.0.0", "io.jaegertracing:jaeger-client:1.8.1", "io.opentelemetry.contrib:opentelemetry-aws-xray-propagator:1.39.0-alpha", - "io.opentelemetry.semconv:opentelemetry-semconv-incubating:1.27.0-alpha", + "io.opentelemetry.semconv:opentelemetry-semconv-incubating:1.28.0-alpha", "io.opentelemetry.proto:opentelemetry-proto:1.3.2-alpha", "io.opentracing:opentracing-api:0.33.0", "io.opentracing:opentracing-noop:0.33.0", diff --git a/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/FileConfigurationTest.java b/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/FileConfigurationTest.java index e3a9bb3ed10..955e5817693 100644 --- a/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/FileConfigurationTest.java +++ b/sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/FileConfigurationTest.java @@ -31,7 +31,7 @@ class FileConfigurationTest { @Test void configFile(@TempDir Path tempDir) throws IOException { String yaml = - "file_format: \"0.1\"\n" + "file_format: \"0.3\"\n" + "resource:\n" + " attributes:\n" + " - name: service.name\n" diff --git a/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/FileConfigurationTest.java b/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/FileConfigurationTest.java index 3b3869e5bf6..7eface52c5e 100644 --- a/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/FileConfigurationTest.java +++ b/sdk-extensions/autoconfigure/src/testFullConfig/java/io/opentelemetry/sdk/autoconfigure/FileConfigurationTest.java @@ -55,7 +55,7 @@ class FileConfigurationTest { @BeforeEach void setup() throws IOException { String yaml = - "file_format: \"0.1\"\n" + "file_format: \"0.3\"\n" + "resource:\n" + " attributes:\n" + " - name: service.name\n" @@ -160,7 +160,7 @@ void configFile_setResultAsGlobalTrue() { @Test void configFile_Error(@TempDir Path tempDir) throws IOException { String yaml = - "file_format: \"0.1\"\n" + "file_format: \"0.3\"\n" + "resource:\n" + " attributes:\n" + " - name: service.name\n" diff --git a/sdk-extensions/incubator/build.gradle.kts b/sdk-extensions/incubator/build.gradle.kts index 59acac261ef..92be979672f 100644 --- a/sdk-extensions/incubator/build.gradle.kts +++ b/sdk-extensions/incubator/build.gradle.kts @@ -56,8 +56,11 @@ dependencies { // 7. deleteJs2pTmp - delete tmp directory // ... proceed with normal sourcesJar, compileJava, etc -val configurationTag = "0.3.0" -val configurationRef = "refs/tags/v$configurationTag" // Replace with commit SHA to point to experiment with a specific commit +// TODO (trask) revert after the 0.4.0 release +// it was needed after 0.3.0 release because file_format in the examples weren't updated prior to the release tag +// val configurationTag = "0.3.0" +// val configurationRef = "refs/tags/v$configurationTag" // Replace with commit SHA to point to experiment with a specific commit +val configurationRef = "cea3905ce0a542d573968c3c47d413143d473cf4" val configurationRepoZip = "https://github.com/open-telemetry/opentelemetry-configuration/archive/$configurationRef.zip" val buildDirectory = layout.buildDirectory.asFile.get() diff --git a/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java b/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java index 76cf9cc1fbe..e4004516b73 100644 --- a/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java +++ b/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfiguration.java @@ -49,7 +49,7 @@ public final class FileConfiguration { private static final Logger logger = Logger.getLogger(FileConfiguration.class.getName()); private static final Pattern ENV_VARIABLE_REFERENCE = - Pattern.compile("\\$\\{([a-zA-Z_][a-zA-Z0-9_]*)(:-([^\n]*))?\\}"); + Pattern.compile("\\$\\{([a-zA-Z_][a-zA-Z0-9_]*)(:-([^\n}]*))?}"); private static final ComponentLoader DEFAULT_COMPONENT_LOADER = SpiHelper.serviceComponentLoader(FileConfiguration.class.getClassLoader()); diff --git a/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/OpenTelemetryConfigurationFactory.java b/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/OpenTelemetryConfigurationFactory.java index 0213839ee30..5df6a4766a3 100644 --- a/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/OpenTelemetryConfigurationFactory.java +++ b/sdk-extensions/incubator/src/main/java/io/opentelemetry/sdk/extension/incubator/fileconfig/OpenTelemetryConfigurationFactory.java @@ -31,8 +31,8 @@ static OpenTelemetryConfigurationFactory getInstance() { public OpenTelemetrySdk create( OpenTelemetryConfigurationModel model, SpiHelper spiHelper, List closeables) { OpenTelemetrySdkBuilder builder = OpenTelemetrySdk.builder(); - if (!"0.1".equals(model.getFileFormat())) { - throw new ConfigurationException("Unsupported file format. Supported formats include: 0.1"); + if (!"0.3".equals(model.getFileFormat())) { + throw new ConfigurationException("Unsupported file format. Supported formats include: 0.3"); } if (Objects.equals(Boolean.TRUE, model.getDisabled())) { diff --git a/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationCreateTest.java b/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationCreateTest.java index d47ae14eb9a..c1a97a8e265 100644 --- a/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationCreateTest.java +++ b/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationCreateTest.java @@ -103,7 +103,7 @@ void parseAndCreate_Exception_CleansUpPartials() { // exporter with OTLP exporter, following by invalid batch exporter which references invalid // exporter "foo". String yaml = - "file_format: \"0.1\"\n" + "file_format: \"0.3\"\n" + "logger_provider:\n" + " processors:\n" + " - batch:\n" diff --git a/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationParseTest.java b/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationParseTest.java index 81aa6f4487e..7de63dcb45c 100644 --- a/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationParseTest.java +++ b/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/FileConfigurationParseTest.java @@ -92,7 +92,7 @@ void parse_BadInputStream() { void parse_KitchenSinkExampleFile() throws IOException { OpenTelemetryConfigurationModel expected = new OpenTelemetryConfigurationModel(); - expected.withFileFormat("0.1"); + expected.withFileFormat("0.3"); expected.withDisabled(false); // General config @@ -449,7 +449,7 @@ void parse_KitchenSinkExampleFile() throws IOException { OpenTelemetryConfigurationModel config = FileConfiguration.parse(configExampleFile); // General config - assertThat(config.getFileFormat()).isEqualTo("0.1"); + assertThat(config.getFileFormat()).isEqualTo("0.3"); assertThat(config.getResource()).isEqualTo(resource); assertThat(config.getAttributeLimits()).isEqualTo(attributeLimits); assertThat(config.getPropagator()).isEqualTo(propagator); @@ -485,7 +485,7 @@ void parse_KitchenSinkExampleFile() throws IOException { @Test void parse_nullValuesParsedToEmptyObjects() { String objectPlaceholderString = - "file_format: \"0.1\"\n" + "file_format: \"0.3\"\n" + "tracer_provider:\n" + " processors:\n" + " - batch:\n" @@ -503,7 +503,7 @@ void parse_nullValuesParsedToEmptyObjects() { new ByteArrayInputStream(objectPlaceholderString.getBytes(StandardCharsets.UTF_8))); String noOjbectPlaceholderString = - "file_format: \"0.1\"\n" + "file_format: \"0.3\"\n" + "tracer_provider:\n" + " processors:\n" + " - batch:\n" @@ -634,6 +634,9 @@ private static java.util.stream.Stream envVarSubstitutionArgs() { // Multiple environment variables referenced Arguments.of("key1: ${STR_1}${STR_2}\n", mapOf(entry("key1", "value1value2"))), Arguments.of("key1: ${STR_1} ${STR_2}\n", mapOf(entry("key1", "value1 value2"))), + Arguments.of( + "key1: ${STR_1} ${NOT_SET:-default} ${STR_2}\n", + mapOf(entry("key1", "value1 default value2"))), // Undefined / empty environment variable Arguments.of("key1: ${EMPTY_STR}\n", mapOf(entry("key1", null))), Arguments.of("key1: ${STR_3}\n", mapOf(entry("key1", null))), @@ -672,7 +675,7 @@ private static Map mapOf(Map.Entry... entries) { @Test void read_WithEnvironmentVariables() { String yaml = - "file_format: \"0.1\"\n" + "file_format: \"0.3\"\n" + "tracer_provider:\n" + " processors:\n" + " - batch:\n" @@ -691,7 +694,7 @@ void read_WithEnvironmentVariables() { assertThat(model) .isEqualTo( new OpenTelemetryConfigurationModel() - .withFileFormat("0.1") + .withFileFormat("0.3") .withTracerProvider( new TracerProviderModel() .withProcessors( diff --git a/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/OpenTelemetryConfigurationFactoryTest.java b/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/OpenTelemetryConfigurationFactoryTest.java index 0284a16bac4..5630ea99767 100644 --- a/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/OpenTelemetryConfigurationFactoryTest.java +++ b/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/OpenTelemetryConfigurationFactoryTest.java @@ -83,7 +83,7 @@ void create_InvalidFileFormat() { OpenTelemetryConfigurationFactory.getInstance() .create(testCase, spiHelper, closeables)) .isInstanceOf(ConfigurationException.class) - .hasMessage("Unsupported file format. Supported formats include: 0.1"); + .hasMessage("Unsupported file format. Supported formats include: 0.3"); cleanup.addCloseables(closeables); } } @@ -97,7 +97,7 @@ void create_Defaults() { OpenTelemetrySdk sdk = OpenTelemetryConfigurationFactory.getInstance() .create( - new OpenTelemetryConfigurationModel().withFileFormat("0.1"), spiHelper, closeables); + new OpenTelemetryConfigurationModel().withFileFormat("0.3"), spiHelper, closeables); cleanup.addCloseable(sdk); cleanup.addCloseables(closeables); @@ -114,7 +114,7 @@ void create_Disabled() { OpenTelemetryConfigurationFactory.getInstance() .create( new OpenTelemetryConfigurationModel() - .withFileFormat("0.1") + .withFileFormat("0.3") .withDisabled(true) // Logger provider configuration should be ignored since SDK is disabled .withLoggerProvider( @@ -208,7 +208,7 @@ void create_Configured() { OpenTelemetryConfigurationFactory.getInstance() .create( new OpenTelemetryConfigurationModel() - .withFileFormat("0.1") + .withFileFormat("0.3") .withPropagator( new PropagatorModel() .withComposite( diff --git a/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/YamlStructuredConfigPropertiesTest.java b/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/YamlStructuredConfigPropertiesTest.java index 757331934bf..25f9a877c95 100644 --- a/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/YamlStructuredConfigPropertiesTest.java +++ b/sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/YamlStructuredConfigPropertiesTest.java @@ -22,7 +22,7 @@ class YamlStructuredConfigPropertiesTest { private static final String extendedSchema = - "file_format: \"0.1\"\n" + "file_format: \"0.3\"\n" + "disabled: false\n" + "\n" + "resource:\n" @@ -69,7 +69,7 @@ void setup() { @Test void configurationSchema() { // Validate can read file configuration schema properties - assertThat(structuredConfigProps.getString("file_format")).isEqualTo("0.1"); + assertThat(structuredConfigProps.getString("file_format")).isEqualTo("0.3"); StructuredConfigProperties resourceProps = structuredConfigProps.getStructured("resource"); assertThat(resourceProps).isNotNull(); List resourceAttributesList =