public class ObservabilityStubSettings extends StubSettings<ObservabilityStubSettings>Settings class to configure an instance of ObservabilityStub.
The default instance has everything set to sensible defaults:
- The default service address (observability.googleapis.com) and default port (443) are used.
- Credentials are acquired automatically through Application Default Credentials.
- Retries are configured for idempotent methods but not for non-idempotent methods.
The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.
For example, to set the RetrySettings of getScope:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ObservabilityStubSettings.Builder observabilitySettingsBuilder =
ObservabilityStubSettings.newBuilder();
observabilitySettingsBuilder
.getScopeSettings()
.setRetrySettings(
observabilitySettingsBuilder
.getScopeSettings()
.getRetrySettings()
.toBuilder()
.setInitialRetryDelayDuration(Duration.ofSeconds(1))
.setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
.setMaxAttempts(5)
.setMaxRetryDelayDuration(Duration.ofSeconds(30))
.setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
.setRetryDelayMultiplier(1.3)
.setRpcTimeoutMultiplier(1.5)
.setTotalTimeoutDuration(Duration.ofSeconds(300))
.build());
ObservabilityStubSettings observabilitySettings = observabilitySettingsBuilder.build();
Please refer to the Client Side Retry Guide for additional support in setting retries.
To configure the RetrySettings of a Long Running Operation method, create an OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to configure the RetrySettings for createBucket:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
ObservabilityStubSettings.Builder observabilitySettingsBuilder =
ObservabilityStubSettings.newBuilder();
TimedRetryAlgorithm timedRetryAlgorithm =
OperationalTimedPollAlgorithm.create(
RetrySettings.newBuilder()
.setInitialRetryDelayDuration(Duration.ofMillis(500))
.setRetryDelayMultiplier(1.5)
.setMaxRetryDelayDuration(Duration.ofMillis(5000))
.setTotalTimeoutDuration(Duration.ofHours(24))
.build());
observabilitySettingsBuilder
.createClusterOperationSettings()
.setPollingAlgorithm(timedRetryAlgorithm)
.build();
Static Methods
defaultApiClientHeaderProviderBuilder()
public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder()| Returns | |
|---|---|
| Type | Description |
Builder |
|
defaultCredentialsProviderBuilder()
public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder()Returns a builder for the default credentials for this service.
| Returns | |
|---|---|
| Type | Description |
Builder |
|
defaultExecutorProviderBuilder()
public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder()Returns a builder for the default ExecutorProvider for this service.
| Returns | |
|---|---|
| Type | Description |
Builder |
|
defaultGrpcApiClientHeaderProviderBuilder()
public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder()| Returns | |
|---|---|
| Type | Description |
Builder |
|
defaultGrpcTransportProviderBuilder()
public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder()Returns a builder for the default gRPC ChannelProvider for this service.
| Returns | |
|---|---|
| Type | Description |
Builder |
|
defaultHttpJsonApiClientHeaderProviderBuilder()
public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder()| Returns | |
|---|---|
| Type | Description |
Builder |
|
defaultHttpJsonTransportProviderBuilder()
public static InstantiatingHttpJsonChannelProvider.Builder defaultHttpJsonTransportProviderBuilder()Returns a builder for the default REST ChannelProvider for this service.
| Returns | |
|---|---|
| Type | Description |
Builder |
|
defaultTransportChannelProvider()
public static TransportChannelProvider defaultTransportChannelProvider()| Returns | |
|---|---|
| Type | Description |
TransportChannelProvider |
|
getDefaultEndpoint()
public static String getDefaultEndpoint()Returns the default service endpoint.
| Returns | |
|---|---|
| Type | Description |
String |
|
getDefaultMtlsEndpoint()
public static String getDefaultMtlsEndpoint()Returns the default mTLS service endpoint.
| Returns | |
|---|---|
| Type | Description |
String |
|
getDefaultServiceScopes()
public static List<String> getDefaultServiceScopes()Returns the default service scopes.
| Returns | |
|---|---|
| Type | Description |
List<String> |
|
newBuilder()
public static ObservabilityStubSettings.Builder newBuilder()Returns a new gRPC builder for this class.
| Returns | |
|---|---|
| Type | Description |
ObservabilityStubSettings.Builder |
|
newBuilder(@Nullable ClientContext clientContext)
public static ObservabilityStubSettings.Builder newBuilder(@Nullable ClientContext clientContext)Returns a new builder for this class.
| Parameter | |
|---|---|
| Name | Description |
clientContext |
@org.jspecify.annotations.Nullable com.google.api.gax.rpc.ClientContext |
| Returns | |
|---|---|
| Type | Description |
ObservabilityStubSettings.Builder |
|
newHttpJsonBuilder()
public static ObservabilityStubSettings.Builder newHttpJsonBuilder()Returns a new REST builder for this class.
| Returns | |
|---|---|
| Type | Description |
ObservabilityStubSettings.Builder |
|
Constructors
ObservabilityStubSettings(ObservabilityStubSettings.Builder settingsBuilder)
protected ObservabilityStubSettings(ObservabilityStubSettings.Builder settingsBuilder)| Parameter | |
|---|---|
| Name | Description |
settingsBuilder |
ObservabilityStubSettings.Builder |
Methods
createBucketOperationSettings()
public OperationCallSettings<CreateBucketRequest,Bucket,OperationMetadata> createBucketOperationSettings()Returns the object with the settings used for calls to createBucket.
| Returns | |
|---|---|
| Type | Description |
OperationCallSettings<CreateBucketRequest,Bucket,OperationMetadata> |
|
createBucketSettings()
public UnaryCallSettings<CreateBucketRequest,Operation> createBucketSettings()Returns the object with the settings used for calls to createBucket.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<CreateBucketRequest,Operation> |
|
createLinkOperationSettings()
public OperationCallSettings<CreateLinkRequest,Link,OperationMetadata> createLinkOperationSettings()Returns the object with the settings used for calls to createLink.
| Returns | |
|---|---|
| Type | Description |
OperationCallSettings<CreateLinkRequest,Link,OperationMetadata> |
|
createLinkSettings()
public UnaryCallSettings<CreateLinkRequest,Operation> createLinkSettings()Returns the object with the settings used for calls to createLink.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<CreateLinkRequest,Operation> |
|
createStub()
public ObservabilityStub createStub()| Returns | |
|---|---|
| Type | Description |
ObservabilityStub |
|
| Exceptions | |
|---|---|
| Type | Description |
IOException |
|
createTraceScopeSettings()
public UnaryCallSettings<CreateTraceScopeRequest,TraceScope> createTraceScopeSettings()Returns the object with the settings used for calls to createTraceScope.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<CreateTraceScopeRequest,TraceScope> |
|
deleteLinkOperationSettings()
public OperationCallSettings<DeleteLinkRequest,Empty,OperationMetadata> deleteLinkOperationSettings()Returns the object with the settings used for calls to deleteLink.
| Returns | |
|---|---|
| Type | Description |
OperationCallSettings<DeleteLinkRequest,Empty,OperationMetadata> |
|
deleteLinkSettings()
public UnaryCallSettings<DeleteLinkRequest,Operation> deleteLinkSettings()Returns the object with the settings used for calls to deleteLink.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<DeleteLinkRequest,Operation> |
|
deleteTraceScopeSettings()
public UnaryCallSettings<DeleteTraceScopeRequest,Empty> deleteTraceScopeSettings()Returns the object with the settings used for calls to deleteTraceScope.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<DeleteTraceScopeRequest,Empty> |
|
getBucketSettings()
public UnaryCallSettings<GetBucketRequest,Bucket> getBucketSettings()Returns the object with the settings used for calls to getBucket.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<GetBucketRequest,Bucket> |
|
getDatasetSettings()
public UnaryCallSettings<GetDatasetRequest,Dataset> getDatasetSettings()Returns the object with the settings used for calls to getDataset.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<GetDatasetRequest,Dataset> |
|
getLibraryMetadata()
protected LibraryMetadata getLibraryMetadata()| Returns | |
|---|---|
| Type | Description |
LibraryMetadata |
|
getLinkSettings()
public UnaryCallSettings<GetLinkRequest,Link> getLinkSettings()Returns the object with the settings used for calls to getLink.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<GetLinkRequest,Link> |
|
getLocationSettings()
public UnaryCallSettings<GetLocationRequest,Location> getLocationSettings()Returns the object with the settings used for calls to getLocation.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
|
getScopeSettings()
public UnaryCallSettings<GetScopeRequest,Scope> getScopeSettings()Returns the object with the settings used for calls to getScope.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<GetScopeRequest,Scope> |
|
getServiceName()
public String getServiceName()Returns the default service name.
| Returns | |
|---|---|
| Type | Description |
String |
|
getSettingsSettings()
public UnaryCallSettings<GetSettingsRequest,Settings> getSettingsSettings()Returns the object with the settings used for calls to getSettings.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<GetSettingsRequest,Settings> |
|
getTraceScopeSettings()
public UnaryCallSettings<GetTraceScopeRequest,TraceScope> getTraceScopeSettings()Returns the object with the settings used for calls to getTraceScope.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<GetTraceScopeRequest,TraceScope> |
|
getViewSettings()
public UnaryCallSettings<GetViewRequest,View> getViewSettings()Returns the object with the settings used for calls to getView.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<GetViewRequest,View> |
|
listBucketsSettings()
public PagedCallSettings<ListBucketsRequest,ListBucketsResponse,ObservabilityClient.ListBucketsPagedResponse> listBucketsSettings()Returns the object with the settings used for calls to listBuckets.
| Returns | |
|---|---|
| Type | Description |
PagedCallSettings<ListBucketsRequest,ListBucketsResponse,ListBucketsPagedResponse> |
|
listDatasetsSettings()
public PagedCallSettings<ListDatasetsRequest,ListDatasetsResponse,ObservabilityClient.ListDatasetsPagedResponse> listDatasetsSettings()Returns the object with the settings used for calls to listDatasets.
| Returns | |
|---|---|
| Type | Description |
PagedCallSettings<ListDatasetsRequest,ListDatasetsResponse,ListDatasetsPagedResponse> |
|
listLinksSettings()
public PagedCallSettings<ListLinksRequest,ListLinksResponse,ObservabilityClient.ListLinksPagedResponse> listLinksSettings()Returns the object with the settings used for calls to listLinks.
| Returns | |
|---|---|
| Type | Description |
PagedCallSettings<ListLinksRequest,ListLinksResponse,ListLinksPagedResponse> |
|
listLocationsSettings()
public PagedCallSettings<ListLocationsRequest,ListLocationsResponse,ObservabilityClient.ListLocationsPagedResponse> listLocationsSettings()Returns the object with the settings used for calls to listLocations.
| Returns | |
|---|---|
| Type | Description |
PagedCallSettings<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse,ListLocationsPagedResponse> |
|
listTraceScopesSettings()
public PagedCallSettings<ListTraceScopesRequest,ListTraceScopesResponse,ObservabilityClient.ListTraceScopesPagedResponse> listTraceScopesSettings()Returns the object with the settings used for calls to listTraceScopes.
| Returns | |
|---|---|
| Type | Description |
PagedCallSettings<ListTraceScopesRequest,ListTraceScopesResponse,ListTraceScopesPagedResponse> |
|
listViewsSettings()
public PagedCallSettings<ListViewsRequest,ListViewsResponse,ObservabilityClient.ListViewsPagedResponse> listViewsSettings()Returns the object with the settings used for calls to listViews.
| Returns | |
|---|---|
| Type | Description |
PagedCallSettings<ListViewsRequest,ListViewsResponse,ListViewsPagedResponse> |
|
toBuilder()
public ObservabilityStubSettings.Builder toBuilder()Returns a builder containing all the values of this settings class.
| Returns | |
|---|---|
| Type | Description |
ObservabilityStubSettings.Builder |
|
updateBucketOperationSettings()
public OperationCallSettings<UpdateBucketRequest,Bucket,OperationMetadata> updateBucketOperationSettings()Returns the object with the settings used for calls to updateBucket.
| Returns | |
|---|---|
| Type | Description |
OperationCallSettings<UpdateBucketRequest,Bucket,OperationMetadata> |
|
updateBucketSettings()
public UnaryCallSettings<UpdateBucketRequest,Operation> updateBucketSettings()Returns the object with the settings used for calls to updateBucket.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<UpdateBucketRequest,Operation> |
|
updateLinkOperationSettings()
public OperationCallSettings<UpdateLinkRequest,Link,OperationMetadata> updateLinkOperationSettings()Returns the object with the settings used for calls to updateLink.
| Returns | |
|---|---|
| Type | Description |
OperationCallSettings<UpdateLinkRequest,Link,OperationMetadata> |
|
updateLinkSettings()
public UnaryCallSettings<UpdateLinkRequest,Operation> updateLinkSettings()Returns the object with the settings used for calls to updateLink.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<UpdateLinkRequest,Operation> |
|
updateScopeSettings()
public UnaryCallSettings<UpdateScopeRequest,Scope> updateScopeSettings()Returns the object with the settings used for calls to updateScope.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<UpdateScopeRequest,Scope> |
|
updateSettingsOperationSettings()
public OperationCallSettings<UpdateSettingsRequest,Settings,OperationMetadata> updateSettingsOperationSettings()Returns the object with the settings used for calls to updateSettings.
| Returns | |
|---|---|
| Type | Description |
OperationCallSettings<UpdateSettingsRequest,Settings,OperationMetadata> |
|
updateSettingsSettings()
public UnaryCallSettings<UpdateSettingsRequest,Operation> updateSettingsSettings()Returns the object with the settings used for calls to updateSettings.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<UpdateSettingsRequest,Operation> |
|
updateTraceScopeSettings()
public UnaryCallSettings<UpdateTraceScopeRequest,TraceScope> updateTraceScopeSettings()Returns the object with the settings used for calls to updateTraceScope.
| Returns | |
|---|---|
| Type | Description |
UnaryCallSettings<UpdateTraceScopeRequest,TraceScope> |
|