You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: gcp-auth-extension/README.md
+49-3Lines changed: 49 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,8 @@ Here is a list of configurable options for the extension:
40
40
41
41
## Usage
42
42
43
+
### With OpenTelemetry Java agent
44
+
43
45
The OpenTelemetry Java Agent Extension can be easily added to any Java application by modifying the startup command to the application.
44
46
For more information on Extensions, see the [documentation here](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/examples/extension/README.md).
// Configure the GCP Auth extension using system properties.
@@ -66,7 +67,52 @@ application {
66
67
// Optionally enable the built-in GCP resource detector
67
68
'-Dotel.resource.providers.gcp.enabled=true'
68
69
'-Dotel.traces.exporter=otlp',
69
-
'-Dotel.metrics.exporter=logging',
70
+
'-Dotel.metrics.exporter=logging'
71
+
)
72
+
73
+
application {
74
+
...
75
+
applicationDefaultJvmArgs = autoconf_config
76
+
...
77
+
}
78
+
```
79
+
80
+
### Without OpenTelemetry Java agent
81
+
82
+
This extension can be used without the OpenTelemetry Java agent by leveraging the [OpenTelemetry SDK Autoconfigure](https://github.com/open-telemetry/opentelemetry-java/blob/main/sdk-extensions/autoconfigure/README.md) module.\
83
+
When using the autoconfigured SDK, simply adding this extension as a dependency automatically configures authentication headers and resource attributes for spans, enabling export to Google Cloud.
84
+
85
+
Below is a snippet showing how to use this extension as a dependency when the application is not instrumented using the OpenTelemetry Java agent.
0 commit comments