public class DatastoreOpenTelemetryOptionsRepresents the options that are used to configure the use of OpenTelemetry for telemetry collection in the Datastore SDK.
Static Methods
newBuilder()
public static DatastoreOpenTelemetryOptions.Builder newBuilder()Returns a new default Builder.
| Returns | |
|---|---|
| Type | Description |
DatastoreOpenTelemetryOptions.Builder |
a new Builder. |
Methods
getOpenTelemetry()
public OpenTelemetry getOpenTelemetry()Returns the configured custom OpenTelemetry instance.
| Returns | |
|---|---|
| Type | Description |
io.opentelemetry.api.OpenTelemetry |
the configured OpenTelemetry instance, or the global instance if a custom one
was not provided. If there is no global instance, then |
isEnabled()
public boolean isEnabled()Returns whether either tracing or custom metrics (via a user-provided OpenTelemetry instance) are enabled.
Note: This method does not reflect the state of built-in metrics export to
Google Cloud Monitoring, which is controlled separately by #isExportBuiltinMetricsToGoogleCloudMonitoring() and is false by default. To check
whether any telemetry is active, also consult that flag.
| Returns | |
|---|---|
| Type | Description |
boolean |
|
isExportBuiltinMetricsToGoogleCloudMonitoring()
public boolean isExportBuiltinMetricsToGoogleCloudMonitoring()Returns whether built-in metrics should be exported to Google Cloud Monitoring.
When enabled, client-side metrics are automatically exported to Google Cloud Monitoring using the Cloud Monitoring API. This is independent of the custom OpenTelemetry backend configured via #getOpenTelemetry().
| Returns | |
|---|---|
| Type | Description |
boolean |
|
isMetricsEnabled()
public boolean isMetricsEnabled()Returns whether metrics are enabled for the custom (user-provided) OpenTelemetry backend.
| Returns | |
|---|---|
| Type | Description |
boolean |
|
isTracingEnabled()
public boolean isTracingEnabled()Returns whether tracing is enabled.
| Returns | |
|---|---|
| Type | Description |
boolean |
|
toBuilder()
public DatastoreOpenTelemetryOptions.Builder toBuilder()Returns a new Builder initialized with the values from this options instance.
| Returns | |
|---|---|
| Type | Description |
DatastoreOpenTelemetryOptions.Builder |
a new Builder. |