File tree Expand file tree Collapse file tree 6 files changed +12
-18
lines changed
src/main/java/com/google/cloud/opentelemetry/example/otlptrace Expand file tree Collapse file tree 6 files changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -160,12 +160,12 @@ subprojects {
160160 googleTraceVersion = ' 2.51.0'
161161 googleCloudBomVersion = ' 26.48.0'
162162 cloudMonitoringVersion = ' 3.52.0'
163- openTelemetryBomVersion = ' 1.46 .0'
164- openTelemetryVersion = ' 1.46 .0'
163+ openTelemetryBomVersion = ' 1.47 .0'
164+ openTelemetryVersion = ' 1.47 .0'
165165 openTelemetryInstrumentationBomVersion = ' 2.12.0'
166166 openTelemetryInstrumentationVersion = ' 2.12.0'
167167 openTelemetrySemconvVersion = ' 1.29.0'
168- openTelemetryContribVersion = ' 1.43 .0'
168+ openTelemetryContribVersion = ' 1.44 .0'
169169 junitVersion = ' 4.13'
170170 junit5Version = ' 5.10.0'
171171 mockitoVersion = ' 5.2.0'
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ configurations {
2929 agent
3030}
3131
32- // the shaded variant name for gcp auth extension is an empty string
33- def gcp_auth_extension_shaded_classifier = ' '
32+ // the shaded variant name for gcp auth extension
33+ def gcp_auth_extension_shaded_classifier = ' shadow '
3434
3535dependencies {
3636 agent agentLibraries. agent
Original file line number Diff line number Diff line change @@ -28,15 +28,12 @@ repositories {
2828 mavenCentral()
2929}
3030
31- // the shaded variant name for gcp auth extension is an empty string
32- def gcp_auth_extension_shaded_classifier = ' '
33-
3431dependencies {
3532 implementation(libraries. opentelemetry_api)
3633 implementation(libraries. opentelemetry_sdk)
3734 implementation(libraries. opentelemetry_otlp_exporter)
3835 implementation(libraries. opentelemetry_sdk_autoconf)
39- implementation(" ${ libraries.opentelemetry_gcp_auth_extension} : ${ gcp_auth_extension_shaded_classifier } " )
36+ implementation(libraries. opentelemetry_gcp_auth_extension)
4037 implementation(libraries. opentelemetry_gcp_resources)
4138
4239 implementation(libraries. spring_boot_starter_web)
Original file line number Diff line number Diff line change @@ -22,3 +22,5 @@ Finally, to run the sample from the project root:
2222```
2323cd examples/otlptrace && gradle run
2424```
25+
26+ Running this sample will generate and export Traces to Google Cloud.
Original file line number Diff line number Diff line change @@ -20,23 +20,19 @@ plugins {
2020// examples are not published, so version can be hardcoded
2121version = ' 0.1.0'
2222
23- description = ' Example for OTLP exporter'
24-
25- // the shaded variant name for gcp auth extension is an empty string
26- def gcp_auth_extension_shaded_classifier = ' '
23+ description = ' Example showing OTLP exporter being used for traces export to GCP'
2724
2825dependencies {
2926 implementation(libraries. opentelemetry_api)
3027 implementation(libraries. opentelemetry_sdk)
3128 implementation(libraries. opentelemetry_otlp_exporter)
3229 implementation(libraries. opentelemetry_sdk_autoconf)
33- implementation(" ${ libraries.opentelemetry_gcp_auth_extension} : ${ gcp_auth_extension_shaded_classifier } " )
30+ implementation(libraries. opentelemetry_gcp_auth_extension)
3431 implementation(libraries. opentelemetry_gcp_resources)
3532}
3633
3734// Provide headers from env variable
3835def autoconf_config = [
39- ' -Dgoogle.cloud.project=your-gcp-project-id' ,
4036 ' -Dotel.exporter.otlp.endpoint=https://telemetry.googleapis.com' ,
4137 ' -Dotel.traces.exporter=otlp' ,
4238 ' -Dotel.logs.exporter=none' ,
Original file line number Diff line number Diff line change 2020import io .opentelemetry .sdk .OpenTelemetrySdk ;
2121import io .opentelemetry .sdk .autoconfigure .AutoConfiguredOpenTelemetrySdk ;
2222import io .opentelemetry .sdk .common .CompletableResultCode ;
23- import java .io .IOException ;
2423import java .util .Random ;
2524import java .util .concurrent .TimeUnit ;
2625
@@ -63,8 +62,8 @@ private static void doWork(String description) {
6362 }
6463 }
6564
66- public static void main (String [] args ) throws IOException {
67- // Configure the OpenTelemetry pipeline with CloudTrace exporter
65+ public static void main (String [] args ) {
66+ // Configure the OpenTelemetry pipeline with Auto configuration
6867 openTelemetrySdk = AutoConfiguredOpenTelemetrySdk .initialize ().getOpenTelemetrySdk ();
6968
7069 // Application-specific logic
You can’t perform that action at this time.
0 commit comments