From 46c48bf1b0461a7447afb53ac56560334a49d95f Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Tue, 29 Oct 2024 21:51:12 +0000 Subject: [PATCH 01/12] Hardcode the version for examples-spring module --- examples/spring/build.gradle | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/spring/build.gradle b/examples/spring/build.gradle index cc4c54c3..3667ca55 100644 --- a/examples/spring/build.gradle +++ b/examples/spring/build.gradle @@ -20,6 +20,8 @@ plugins { id 'application' id 'com.google.cloud.tools.jib' } +// examples are not published, so version can be hardcoded +version = '1.0.0' repositories { mavenCentral() @@ -37,7 +39,7 @@ jar { // OpenTelemetry Autoconfigure module can be configured using system properties def autoconf_config = [ - '-Dotel.resource.attributes=gcp.project_id=otel-test-sharmapranav', + '-Dotel.resource.attributes=gcp.project_id=', '-Dotel.traces.exporter=google_cloud_trace', '-Dotel.metrics.exporter=google_cloud_monitoring,logging', '-Dotel.logs.exporter=none', @@ -58,7 +60,7 @@ tasks.register('runApp', JavaExec) { description = "Builds and runs the spring application's execuable JAR" dependsOn tasks.bootJar - classpath = files('build/libs/examples-spring-0.1.0-SNAPSHOT.jar') + classpath = files('build/libs/examples-spring-1.0.0.jar') jvmArgs = autoconf_config } From 54260531cf610993d97346748b474a8e55902323 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Tue, 29 Oct 2024 21:52:50 +0000 Subject: [PATCH 02/12] Hardcode version for spring-slueth example --- examples/spring-sleuth/README.md | 2 +- examples/spring-sleuth/build.gradle | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/spring-sleuth/README.md b/examples/spring-sleuth/README.md index e2532946..47b3fdc4 100644 --- a/examples/spring-sleuth/README.md +++ b/examples/spring-sleuth/README.md @@ -35,7 +35,7 @@ cd examples/spring-sleuth/ && gradle bootJar The JAR built from the previous command typically ends up in `build/libs` - ```shell -java -jar build/libs/examples-spring-sleuth-0.1.0-SNAPSHOT.jar +java -jar build/libs/examples-spring-sleuth-1.0.0.jar ``` The application is now running. To generate traces, head to `http://localhost:8080` in your browser. diff --git a/examples/spring-sleuth/build.gradle b/examples/spring-sleuth/build.gradle index 8261e30e..3dc0ab96 100644 --- a/examples/spring-sleuth/build.gradle +++ b/examples/spring-sleuth/build.gradle @@ -18,6 +18,8 @@ plugins { id 'io.spring.dependency-management' version '1.0.11.RELEASE' id 'java' } +// examples are not published, so version can be hardcoded +version = "1.0.0" jar { manifest { From 086f8bd4ba68ca9c7aa5f3c3fdf185d0d2d49083 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Tue, 29 Oct 2024 21:56:05 +0000 Subject: [PATCH 03/12] Hardcode version for resource example --- examples/resource/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/resource/build.gradle b/examples/resource/build.gradle index 9d452057..be867cf6 100644 --- a/examples/resource/build.gradle +++ b/examples/resource/build.gradle @@ -18,6 +18,8 @@ plugins { id 'application' id 'com.google.cloud.tools.jib' } +// examples are not published, so version can be hardcoded +version = '1.0.0' description = 'Examples for showing resource detection in various GCP environments.' From 07662d46b6f8a9b8a77774a68d5804f9d9461168 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Tue, 29 Oct 2024 21:56:25 +0000 Subject: [PATCH 04/12] Hardcode version for otlptrace example --- examples/otlptrace/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/otlptrace/build.gradle b/examples/otlptrace/build.gradle index 713117b6..39d7e766 100644 --- a/examples/otlptrace/build.gradle +++ b/examples/otlptrace/build.gradle @@ -17,6 +17,8 @@ plugins { id 'java' id 'application' } +// examples are not published, so version can be hardcoded +version = '1.0.0' mainClassName = 'com.google.cloud.opentelemetry.example.otlptrace.OTLPTraceExample' From eafd2d758a84bbf603ce032265b627fb29392ff2 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Tue, 29 Oct 2024 21:58:31 +0000 Subject: [PATCH 05/12] Hardcode version for otlpmetrics-function example --- examples/otlpmetrics-function/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/otlpmetrics-function/build.gradle b/examples/otlpmetrics-function/build.gradle index d28f083b..8f5675ea 100644 --- a/examples/otlpmetrics-function/build.gradle +++ b/examples/otlpmetrics-function/build.gradle @@ -20,7 +20,8 @@ plugins { import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -group 'org.example' +// examples are not published, so version can be hardcoded +version = '1.0.0' repositories { mavenCentral() From 441f268671dbd3e53237a8ebea6b833bba11cf64 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Tue, 29 Oct 2024 22:03:15 +0000 Subject: [PATCH 06/12] Hardcode version for otlp-spring example --- examples/otlp-spring/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/otlp-spring/build.gradle b/examples/otlp-spring/build.gradle index 9c6c6f18..a9f0a3bb 100644 --- a/examples/otlp-spring/build.gradle +++ b/examples/otlp-spring/build.gradle @@ -23,6 +23,9 @@ description = 'Example showcasing OTLP trace ingest on GCP and Google Auth in a group 'com.google.cloud.opentelemetry.examples' +// examples are not published, so version can be hardcoded +version = '1.0.0' + repositories { mavenCentral() } From fe47515450b3c0d0f33bdfcf13f80755760fdc93 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Tue, 29 Oct 2024 22:04:58 +0000 Subject: [PATCH 07/12] Hardcode version for metrics example --- examples/metrics/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/metrics/build.gradle b/examples/metrics/build.gradle index cecaf1ae..428fb405 100644 --- a/examples/metrics/build.gradle +++ b/examples/metrics/build.gradle @@ -19,6 +19,9 @@ plugins { id 'com.google.cloud.tools.jib' } +// examples are not published, so version can be hardcoded +version = '1.0.0' + // Set Docker image path here, e.g. using Google Container Registry or Docker Hub // https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin#configuration jib { From 048da212be5e004b5d745da56cfd4284c8e827a7 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Tue, 29 Oct 2024 22:07:17 +0000 Subject: [PATCH 08/12] Hardcode version for autoinstrument example --- examples/autoinstrument/build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/autoinstrument/build.gradle b/examples/autoinstrument/build.gradle index cfd2efa0..55edab4e 100644 --- a/examples/autoinstrument/build.gradle +++ b/examples/autoinstrument/build.gradle @@ -22,6 +22,9 @@ plugins { description = 'Examples for using java auto instrumentation and Google Cloud Operations' +// examples are not published, so version can be hardcoded +version = '1.0.0' + configurations { agent } From 2fe51aad5431beaa337a11197d1aae861585a397 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Tue, 29 Oct 2024 22:09:00 +0000 Subject: [PATCH 09/12] Hardcode version for autoconf example --- examples/autoconf/build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/autoconf/build.gradle b/examples/autoconf/build.gradle index 56c91f36..1642634e 100644 --- a/examples/autoconf/build.gradle +++ b/examples/autoconf/build.gradle @@ -19,9 +19,11 @@ plugins { id 'com.google.cloud.tools.jib' } - description = 'Examples for using java autoconfiguration and Google Cloud Operations' +// examples are not published, so version can be hardcoded +version = '1.0.0' + dependencies { implementation(libraries.opentelemetry_api) implementation(libraries.opentelemetry_sdk_metrics) From a3393828a6eb132282c63001bbbacaa3593d2f3f Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Tue, 29 Oct 2024 22:15:43 +0000 Subject: [PATCH 10/12] Remove group from example modules --- examples/otlp-spring/build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/otlp-spring/build.gradle b/examples/otlp-spring/build.gradle index a9f0a3bb..7f51338e 100644 --- a/examples/otlp-spring/build.gradle +++ b/examples/otlp-spring/build.gradle @@ -21,8 +21,6 @@ plugins { description = 'Example showcasing OTLP trace ingest on GCP and Google Auth in a Spring Boot App' -group 'com.google.cloud.opentelemetry.examples' - // examples are not published, so version can be hardcoded version = '1.0.0' From 08f76a14fd2779d5017bcd731c016c74e5c3e536 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Tue, 29 Oct 2024 22:26:38 +0000 Subject: [PATCH 11/12] Change the name of placeholder variable --- examples/spring/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/spring/build.gradle b/examples/spring/build.gradle index 3667ca55..62bfdf98 100644 --- a/examples/spring/build.gradle +++ b/examples/spring/build.gradle @@ -39,7 +39,7 @@ jar { // OpenTelemetry Autoconfigure module can be configured using system properties def autoconf_config = [ - '-Dotel.resource.attributes=gcp.project_id=', + '-Dotel.resource.attributes=gcp.project_id=', '-Dotel.traces.exporter=google_cloud_trace', '-Dotel.metrics.exporter=google_cloud_monitoring,logging', '-Dotel.logs.exporter=none', From 82e1a201b6ae4da82dcc3b370f3344820813fbd2 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Wed, 30 Oct 2024 15:45:02 +0000 Subject: [PATCH 12/12] Change version numbers for samples to be 0.1.0 --- examples/autoconf/build.gradle | 2 +- examples/autoinstrument/build.gradle | 2 +- examples/metrics/build.gradle | 2 +- examples/otlp-spring/build.gradle | 2 +- examples/otlpmetrics-function/build.gradle | 2 +- examples/otlptrace/build.gradle | 2 +- examples/resource/build.gradle | 2 +- examples/spring-sleuth/README.md | 2 +- examples/spring-sleuth/build.gradle | 2 +- examples/spring/build.gradle | 4 ++-- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/autoconf/build.gradle b/examples/autoconf/build.gradle index 1642634e..5184eadf 100644 --- a/examples/autoconf/build.gradle +++ b/examples/autoconf/build.gradle @@ -22,7 +22,7 @@ plugins { description = 'Examples for using java autoconfiguration and Google Cloud Operations' // examples are not published, so version can be hardcoded -version = '1.0.0' +version = '0.1.0' dependencies { implementation(libraries.opentelemetry_api) diff --git a/examples/autoinstrument/build.gradle b/examples/autoinstrument/build.gradle index 55edab4e..cef6a2bf 100644 --- a/examples/autoinstrument/build.gradle +++ b/examples/autoinstrument/build.gradle @@ -23,7 +23,7 @@ plugins { description = 'Examples for using java auto instrumentation and Google Cloud Operations' // examples are not published, so version can be hardcoded -version = '1.0.0' +version = '0.1.0' configurations { agent diff --git a/examples/metrics/build.gradle b/examples/metrics/build.gradle index 428fb405..24f16f62 100644 --- a/examples/metrics/build.gradle +++ b/examples/metrics/build.gradle @@ -20,7 +20,7 @@ plugins { } // examples are not published, so version can be hardcoded -version = '1.0.0' +version = '0.1.0' // Set Docker image path here, e.g. using Google Container Registry or Docker Hub // https://github.com/GoogleContainerTools/jib/tree/master/jib-gradle-plugin#configuration diff --git a/examples/otlp-spring/build.gradle b/examples/otlp-spring/build.gradle index 7f51338e..c9a38cc2 100644 --- a/examples/otlp-spring/build.gradle +++ b/examples/otlp-spring/build.gradle @@ -22,7 +22,7 @@ plugins { description = 'Example showcasing OTLP trace ingest on GCP and Google Auth in a Spring Boot App' // examples are not published, so version can be hardcoded -version = '1.0.0' +version = '0.1.0' repositories { mavenCentral() diff --git a/examples/otlpmetrics-function/build.gradle b/examples/otlpmetrics-function/build.gradle index 8f5675ea..018a5ee9 100644 --- a/examples/otlpmetrics-function/build.gradle +++ b/examples/otlpmetrics-function/build.gradle @@ -21,7 +21,7 @@ plugins { import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar // examples are not published, so version can be hardcoded -version = '1.0.0' +version = '0.1.0' repositories { mavenCentral() diff --git a/examples/otlptrace/build.gradle b/examples/otlptrace/build.gradle index 39d7e766..f78ffec0 100644 --- a/examples/otlptrace/build.gradle +++ b/examples/otlptrace/build.gradle @@ -18,7 +18,7 @@ plugins { id 'application' } // examples are not published, so version can be hardcoded -version = '1.0.0' +version = '0.1.0' mainClassName = 'com.google.cloud.opentelemetry.example.otlptrace.OTLPTraceExample' diff --git a/examples/resource/build.gradle b/examples/resource/build.gradle index be867cf6..103c62fa 100644 --- a/examples/resource/build.gradle +++ b/examples/resource/build.gradle @@ -19,7 +19,7 @@ plugins { id 'com.google.cloud.tools.jib' } // examples are not published, so version can be hardcoded -version = '1.0.0' +version = '0.1.0' description = 'Examples for showing resource detection in various GCP environments.' diff --git a/examples/spring-sleuth/README.md b/examples/spring-sleuth/README.md index 47b3fdc4..188d50ab 100644 --- a/examples/spring-sleuth/README.md +++ b/examples/spring-sleuth/README.md @@ -35,7 +35,7 @@ cd examples/spring-sleuth/ && gradle bootJar The JAR built from the previous command typically ends up in `build/libs` - ```shell -java -jar build/libs/examples-spring-sleuth-1.0.0.jar +java -jar build/libs/examples-spring-sleuth-0.1.0.jar ``` The application is now running. To generate traces, head to `http://localhost:8080` in your browser. diff --git a/examples/spring-sleuth/build.gradle b/examples/spring-sleuth/build.gradle index 3dc0ab96..198031fc 100644 --- a/examples/spring-sleuth/build.gradle +++ b/examples/spring-sleuth/build.gradle @@ -19,7 +19,7 @@ plugins { id 'java' } // examples are not published, so version can be hardcoded -version = "1.0.0" +version = '0.1.0' jar { manifest { diff --git a/examples/spring/build.gradle b/examples/spring/build.gradle index 62bfdf98..3de4c228 100644 --- a/examples/spring/build.gradle +++ b/examples/spring/build.gradle @@ -21,7 +21,7 @@ plugins { id 'com.google.cloud.tools.jib' } // examples are not published, so version can be hardcoded -version = '1.0.0' +version = '0.1.0' repositories { mavenCentral() @@ -60,7 +60,7 @@ tasks.register('runApp', JavaExec) { description = "Builds and runs the spring application's execuable JAR" dependsOn tasks.bootJar - classpath = files('build/libs/examples-spring-1.0.0.jar') + classpath = files('build/libs/examples-spring-0.1.0.jar') jvmArgs = autoconf_config }