public final class AzureMonitorExporterBuilder extends Object
AzureMonitorTraceExporter
that implements
SpanExporter
interface defined by OpenTelemetry API specification.Constructor and Description |
---|
AzureMonitorExporterBuilder()
Creates an instance of
AzureMonitorExporterBuilder . |
Modifier and Type | Method and Description |
---|---|
AzureMonitorExporterBuilder |
addPolicy(com.azure.core.http.policy.HttpPipelinePolicy policy)
Adds a policy to the set of existing policies that are executed after required policies.
|
AzureMonitorTraceExporter |
buildTraceExporter()
Creates an
AzureMonitorTraceExporter based on the options set in the builder. |
AzureMonitorExporterBuilder |
clientOptions(com.azure.core.util.ClientOptions clientOptions)
Sets the client options such as application ID and custom headers to set on a request.
|
AzureMonitorExporterBuilder |
configuration(com.azure.core.util.Configuration configuration)
Sets the configuration store that is used during construction of the service client.
|
AzureMonitorExporterBuilder |
connectionString(String connectionString)
Sets the connection string to use for exporting telemetry events to Azure Monitor.
|
AzureMonitorExporterBuilder |
httpClient(com.azure.core.http.HttpClient client)
Sets the HTTP client to use for sending and receiving requests to and from the service.
|
AzureMonitorExporterBuilder |
httpLogOptions(com.azure.core.http.policy.HttpLogOptions logOptions)
Sets the logging configuration for HTTP requests and responses.
|
AzureMonitorExporterBuilder |
pipeline(com.azure.core.http.HttpPipeline httpPipeline)
Sets the HTTP pipeline to use for the service client.
|
AzureMonitorExporterBuilder |
retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy)
Sets the
RetryPolicy that is used when each request is sent. |
AzureMonitorExporterBuilder |
serviceVersion(AzureMonitorExporterServiceVersion serviceVersion)
Sets the Azure Monitor service version.
|
public AzureMonitorExporterBuilder()
AzureMonitorExporterBuilder
.public AzureMonitorExporterBuilder pipeline(com.azure.core.http.HttpPipeline httpPipeline)
pipeline
is set, all other settings are
ignored, apart from endpoint
.httpPipeline
- The HTTP pipeline to use for sending service requests and receiving responses.AzureMonitorExporterBuilder
object.public AzureMonitorExporterBuilder httpClient(com.azure.core.http.HttpClient client)
client
- The HTTP client to use for requests.AzureMonitorExporterBuilder
object.public AzureMonitorExporterBuilder httpLogOptions(com.azure.core.http.policy.HttpLogOptions logOptions)
If logLevel is not provided, default value of HttpLogDetailLevel.NONE
is set.
logOptions
- The logging configuration to use when sending and receiving HTTP requests/responses.AzureMonitorExporterBuilder
object.public AzureMonitorExporterBuilder retryPolicy(com.azure.core.http.policy.RetryPolicy retryPolicy)
RetryPolicy
that is used when each request is sent.
The default retry policy will be used if not provided to build AzureMonitorExporterBuilder
.
retryPolicy
- user's retry policy applied to each request.AzureMonitorExporterBuilder
object.public AzureMonitorExporterBuilder addPolicy(com.azure.core.http.policy.HttpPipelinePolicy policy)
policy
- The retry policy for service requests.AzureMonitorExporterBuilder
object.NullPointerException
- If policy
is null
.public AzureMonitorExporterBuilder configuration(com.azure.core.util.Configuration configuration)
The default configuration store is a clone of the global
configuration store
, use Configuration.NONE
to bypass using configuration settings during construction.
configuration
- The configuration store used toAzureMonitorExporterBuilder
object.public AzureMonitorExporterBuilder clientOptions(com.azure.core.util.ClientOptions clientOptions)
clientOptions
- The client options.AzureMonitorExporterBuilder
object.public AzureMonitorExporterBuilder connectionString(String connectionString)
connectionString
- The connection string for the Azure Monitor resource.AzureMonitorExporterBuilder
object.NullPointerException
- If the connection string is null
.IllegalArgumentException
- If the connection string is invalid.public AzureMonitorExporterBuilder serviceVersion(AzureMonitorExporterServiceVersion serviceVersion)
serviceVersion
- The Azure Monitor service version.AzureMonitorExporterBuilder
object.public AzureMonitorTraceExporter buildTraceExporter()
AzureMonitorTraceExporter
based on the options set in the builder. This exporter is an
implementation of OpenTelemetry SpanExporter
.AzureMonitorTraceExporter
.NullPointerException
- if the connection string is not set on this builder or if the environment variable
"APPLICATIONINSIGHTS_CONNECTION_STRING" is not set.Copyright © 2021 Microsoft Corporation. All rights reserved.