Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcode versions on all samples #384

Merged
merged 12 commits into from
Oct 30, 2024
4 changes: 3 additions & 1 deletion examples/autoconf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
psx95 marked this conversation as resolved.
Show resolved Hide resolved

dependencies {
implementation(libraries.opentelemetry_api)
implementation(libraries.opentelemetry_sdk_metrics)
Expand Down
3 changes: 3 additions & 0 deletions examples/autoinstrument/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 3 additions & 0 deletions examples/metrics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion examples/otlp-spring/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ 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'

repositories {
mavenCentral()
Expand Down
3 changes: 2 additions & 1 deletion examples/otlpmetrics-function/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions examples/otlptrace/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
2 changes: 2 additions & 0 deletions examples/resource/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.'

Expand Down
2 changes: 1 addition & 1 deletion examples/spring-sleuth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions examples/spring-sleuth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions examples/spring/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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=<YOUR_PROJECT>',
'-Dotel.traces.exporter=google_cloud_trace',
'-Dotel.metrics.exporter=google_cloud_monitoring,logging',
'-Dotel.logs.exporter=none',
Expand All @@ -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
}

Expand Down
Loading