Class AzureMonitorAutoConfigureOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPolicy
(com.azure.core.http.policy.HttpPipelinePolicy pipelinePolicy) Adds apipeline policy
to apply on each request sent.clientOptions
(com.azure.core.util.ClientOptions clientOptions) Allows for setting common properties such as application ID, headers, proxy configuration, etc.connectionString
(String connectionString) Sets the connection string to use for exporting telemetry events to Azure Monitor.credential
(com.azure.core.credential.TokenCredential credential) Sets the token credential required for authentication with the ingestion endpoint service.httpClient
(com.azure.core.http.HttpClient httpClient) Sets theHttpClient
to use for sending and receiving requests to and from the service.httpLogOptions
(com.azure.core.http.policy.HttpLogOptions logOptions) Sets thelogging configuration
to use when sending and receiving requests to and from the service.pipeline
(com.azure.core.http.HttpPipeline pipeline) Sets theHttpPipeline
to use for the service client.retryOptions
(com.azure.core.http.policy.RetryOptions retryOptions) Sets theRetryOptions
for all the requests made through the client.
-
Constructor Details
-
AzureMonitorAutoConfigureOptions
public AzureMonitorAutoConfigureOptions()Creates an instance ofAzureMonitorAutoConfigureOptions
.
-
-
Method Details
-
pipeline
Sets theHttpPipeline
to use for the service client.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a
HttpPipeline
is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipeline
is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipeline
is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.- Parameters:
pipeline
-HttpPipeline
to use for sending service requests and receiving responses.- Returns:
- The updated
AzureMonitorAutoConfigureOptions
object.
-
httpClient
Sets theHttpClient
to use for sending and receiving requests to and from the service.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a
HttpPipeline
is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipeline
is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipeline
is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.- Parameters:
httpClient
- TheHttpClient
to use for requests.- Returns:
- The updated
AzureMonitorAutoConfigureOptions
object.
-
httpLogOptions
public AzureMonitorAutoConfigureOptions httpLogOptions(com.azure.core.http.policy.HttpLogOptions logOptions) Sets thelogging configuration
to use when sending and receiving requests to and from the service. If alogLevel
is not provided, default value ofHttpLogDetailLevel.NONE
is set.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a
HttpPipeline
is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipeline
is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipeline
is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.- Parameters:
logOptions
- Thelogging configuration
to use when sending and receiving requests to and from the service.- Returns:
- The updated
AzureMonitorAutoConfigureOptions
object.
-
addPolicy
public AzureMonitorAutoConfigureOptions addPolicy(com.azure.core.http.policy.HttpPipelinePolicy pipelinePolicy) Adds apipeline policy
to apply on each request sent.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a
HttpPipeline
is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipeline
is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipeline
is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.- Parameters:
pipelinePolicy
- Apipeline policy
.- Returns:
- The updated
AzureMonitorAutoConfigureOptions
object. - Throws:
NullPointerException
- IfpipelinePolicy
isnull
.
-
retryOptions
public AzureMonitorAutoConfigureOptions retryOptions(com.azure.core.http.policy.RetryOptions retryOptions) Sets theRetryOptions
for all the requests made through the client.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if an
HttpPipeline
is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipeline
is specified, an HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipeline
is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.- Parameters:
retryOptions
- TheRetryOptions
to use for all the requests made through the client.- Returns:
- The updated
AzureMonitorAutoConfigureOptions
object.
-
clientOptions
public AzureMonitorAutoConfigureOptions clientOptions(com.azure.core.util.ClientOptions clientOptions) Allows for setting common properties such as application ID, headers, proxy configuration, etc. Note that it is recommended that this method be called with an instance of theHttpClientOptions
class (a subclass of theClientOptions
base class). The HttpClientOptions subclass provides more configuration options suitable for HTTP clients, which is applicable for any class that implements this HttpTrait interface.Note: It is important to understand the precedence order of the HttpTrait APIs. In particular, if a
HttpPipeline
is specified, this takes precedence over all other APIs in the trait, and they will be ignored. If noHttpPipeline
is specified, a HTTP pipeline will be constructed internally based on the settings provided to this trait. Additionally, there may be other APIs in types that implement this trait that are also ignored if anHttpPipeline
is specified, so please be sure to refer to the documentation of types that implement this trait to understand the full set of implications.- Parameters:
clientOptions
- A configured instance ofHttpClientOptions
.- Returns:
- The updated
AzureMonitorAutoConfigureOptions
object. - See Also:
-
connectionString
Sets the connection string to use for exporting telemetry events to Azure Monitor.- Parameters:
connectionString
- The connection string for the Azure Monitor resource.- Returns:
- The updated
AzureMonitorAutoConfigureOptions
object. - Throws:
NullPointerException
- If the connection string isnull
.IllegalArgumentException
- If the connection string is invalid.
-
credential
public AzureMonitorAutoConfigureOptions credential(com.azure.core.credential.TokenCredential credential) Sets the token credential required for authentication with the ingestion endpoint service.- Parameters:
credential
- The Azure Identity TokenCredential.- Returns:
- The updated
AzureMonitorAutoConfigureOptions
object.
-