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 {
160
160
googleTraceVersion = ' 2.51.0'
161
161
googleCloudBomVersion = ' 26.48.0'
162
162
cloudMonitoringVersion = ' 3.52.0'
163
- openTelemetryBomVersion = ' 1.46 .0'
164
- openTelemetryVersion = ' 1.46 .0'
163
+ openTelemetryBomVersion = ' 1.47 .0'
164
+ openTelemetryVersion = ' 1.47 .0'
165
165
openTelemetryInstrumentationBomVersion = ' 2.12.0'
166
166
openTelemetryInstrumentationVersion = ' 2.12.0'
167
167
openTelemetrySemconvVersion = ' 1.29.0'
168
- openTelemetryContribVersion = ' 1.43 .0'
168
+ openTelemetryContribVersion = ' 1.44 .0'
169
169
junitVersion = ' 4.13'
170
170
junit5Version = ' 5.10.0'
171
171
mockitoVersion = ' 5.2.0'
Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ configurations {
29
29
agent
30
30
}
31
31
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 '
34
34
35
35
dependencies {
36
36
agent agentLibraries. agent
Original file line number Diff line number Diff line change @@ -28,15 +28,12 @@ repositories {
28
28
mavenCentral()
29
29
}
30
30
31
- // the shaded variant name for gcp auth extension is an empty string
32
- def gcp_auth_extension_shaded_classifier = ' '
33
-
34
31
dependencies {
35
32
implementation(libraries. opentelemetry_api)
36
33
implementation(libraries. opentelemetry_sdk)
37
34
implementation(libraries. opentelemetry_otlp_exporter)
38
35
implementation(libraries. opentelemetry_sdk_autoconf)
39
- implementation(" ${ libraries.opentelemetry_gcp_auth_extension} : ${ gcp_auth_extension_shaded_classifier } " )
36
+ implementation(libraries. opentelemetry_gcp_auth_extension)
40
37
implementation(libraries. opentelemetry_gcp_resources)
41
38
42
39
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:
22
22
```
23
23
cd examples/otlptrace && gradle run
24
24
```
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 {
20
20
// examples are not published, so version can be hardcoded
21
21
version = ' 0.1.0'
22
22
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'
27
24
28
25
dependencies {
29
26
implementation(libraries. opentelemetry_api)
30
27
implementation(libraries. opentelemetry_sdk)
31
28
implementation(libraries. opentelemetry_otlp_exporter)
32
29
implementation(libraries. opentelemetry_sdk_autoconf)
33
- implementation(" ${ libraries.opentelemetry_gcp_auth_extension} : ${ gcp_auth_extension_shaded_classifier } " )
30
+ implementation(libraries. opentelemetry_gcp_auth_extension)
34
31
implementation(libraries. opentelemetry_gcp_resources)
35
32
}
36
33
37
34
// Provide headers from env variable
38
35
def autoconf_config = [
39
- ' -Dgoogle.cloud.project=your-gcp-project-id' ,
40
36
' -Dotel.exporter.otlp.endpoint=https://telemetry.googleapis.com' ,
41
37
' -Dotel.traces.exporter=otlp' ,
42
38
' -Dotel.logs.exporter=none' ,
Original file line number Diff line number Diff line change 20
20
import io .opentelemetry .sdk .OpenTelemetrySdk ;
21
21
import io .opentelemetry .sdk .autoconfigure .AutoConfiguredOpenTelemetrySdk ;
22
22
import io .opentelemetry .sdk .common .CompletableResultCode ;
23
- import java .io .IOException ;
24
23
import java .util .Random ;
25
24
import java .util .concurrent .TimeUnit ;
26
25
@@ -63,8 +62,8 @@ private static void doWork(String description) {
63
62
}
64
63
}
65
64
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
68
67
openTelemetrySdk = AutoConfiguredOpenTelemetrySdk .initialize ().getOpenTelemetrySdk ();
69
68
70
69
// Application-specific logic
You can’t perform that action at this time.
0 commit comments