AzureMonitorExporterBuilder Class

  • java.lang.Object
    • com.azure.opentelemetry.exporters.azuremonitor.AzureMonitorExporterBuilder

public final class AzureMonitorExporterBuilder

This class provides a fluent builder API to instantiate AzureMonitorExporter that implements SpanExporter interface defined by OpenTelemetry API specification.

Constructor Summary

Constructor Description
AzureMonitorExporterBuilder()

Creates an instance of AzureMonitorExporterBuilder.

Method Summary

Modifier and Type Method and Description
AzureMonitorExporterBuilder addPolicy(HttpPipelinePolicy policy)

Adds a policy to the set of existing policies that are executed after required policies.

AzureMonitorExporter buildExporter()

Creates an AzureMonitorExporter based on the options set in the builder.

AzureMonitorExporterBuilder configuration(Configuration configuration)

Sets the configuration store that is used during construction of the service client.

AzureMonitorExporterBuilder endpoint(String endpoint)

Sets the service endpoint for the Azure Monitor Exporter.

AzureMonitorExporterBuilder httpClient(HttpClient client)

Sets the HTTP client to use for sending and receiving requests to and from the service.

AzureMonitorExporterBuilder httpLogOptions(HttpLogOptions logOptions)

Sets the logging configuration for HTTP requests and responses.

AzureMonitorExporterBuilder instrumentationKey(String instrumentationKey)

Sets the instrumentation key to use for exporting telemetry events to Azure Monitor.

AzureMonitorExporterBuilder pipeline(HttpPipeline httpPipeline)

Sets the HTTP pipeline to use for the service client.

AzureMonitorExporterBuilder retryPolicy(RetryPolicy retryPolicy)

Sets the RetryPolicy that is used when each request is sent.

Methods inherited from java.lang.Object

Constructor Details

AzureMonitorExporterBuilder

public AzureMonitorExporterBuilder()

Creates an instance of AzureMonitorExporterBuilder.

Method Details

addPolicy

public AzureMonitorExporterBuilder addPolicy(HttpPipelinePolicy policy)

Adds a policy to the set of existing policies that are executed after required policies.

Parameters:

policy - The retry policy for service requests.

Returns:

The updated AzureMonitorExporterBuilder object.

buildExporter

public AzureMonitorExporter buildExporter()

Creates an AzureMonitorExporter based on the options set in the builder. This exporter is an implementation of OpenTelemetry SpanExporter.

Returns:

An instance of AzureMonitorExporter.

configuration

public AzureMonitorExporterBuilder configuration(Configuration configuration)

Sets the configuration store that is used during construction of the service client.

The default configuration store is a clone of the global configuration store, use NONE to bypass using configuration settings during construction.

Parameters:

configuration - The configuration store used to

Returns:

The updated AzureMonitorExporterBuilder object.

endpoint

public AzureMonitorExporterBuilder endpoint(String endpoint)

Sets the service endpoint for the Azure Monitor Exporter.

Parameters:

endpoint - The URL of the Azure Monitor Exporter endpoint.

Returns:

The updated AzureMonitorExporterBuilder object.

httpClient

public AzureMonitorExporterBuilder httpClient(HttpClient client)

Sets the HTTP client to use for sending and receiving requests to and from the service.

Parameters:

client - The HTTP client to use for requests.

Returns:

The updated AzureMonitorExporterBuilder object.

httpLogOptions

public AzureMonitorExporterBuilder httpLogOptions(HttpLogOptions logOptions)

Sets the logging configuration for HTTP requests and responses.

If logLevel is not provided, default value of HttpLogDetailLevel#NONE is set.

Parameters:

logOptions - The logging configuration to use when sending and receiving HTTP requests/responses.

Returns:

The updated AzureMonitorExporterBuilder object.

instrumentationKey

public AzureMonitorExporterBuilder instrumentationKey(String instrumentationKey)

Sets the instrumentation key to use for exporting telemetry events to Azure Monitor.

Parameters:

instrumentationKey - The instrumentation key of the Azure Monitor resource.

Returns:

The updated AzureMonitorExporterBuilder object.

pipeline

public AzureMonitorExporterBuilder pipeline(HttpPipeline httpPipeline)

Sets the HTTP pipeline to use for the service client. If pipeline is set, all other settings are ignored, apart from endpoint(String endpoint).

Parameters:

httpPipeline - The HTTP pipeline to use for sending service requests and receiving responses.

Returns:

The updated AzureMonitorExporterBuilder object.

retryPolicy

public AzureMonitorExporterBuilder retryPolicy(RetryPolicy retryPolicy)

Sets the RetryPolicy that is used when each request is sent.

The default retry policy will be used if not provided to build AzureMonitorExporterBuilder .

Parameters:

retryPolicy - user's retry policy applied to each request.

Returns:

The updated AzureMonitorExporterBuilder object.

Applies to