azure.monitor.opentelemetry.exporter package

class azure.monitor.opentelemetry.exporter.ApplicationInsightsSampler(sampling_ratio: float = 1.0)[source]

Sampler that implements the same probability sampling algorithm as the ApplicationInsights SDKs.

get_description()str[source]
should_sample(parent_context: Optional[opentelemetry.context.context.Context], trace_id: int, name: str, kind: Optional[opentelemetry.trace.SpanKind] = None, attributes: Optional[Mapping[str, Union[str, bool, int, float, Sequence[str], Sequence[bool], Sequence[int], Sequence[float]]]] = None, links: Optional[Sequence[opentelemetry.trace.Link]] = None, trace_state: Optional[opentelemetry.trace.span.TraceState] = None)opentelemetry.sdk.trace.sampling.SamplingResult[source]
class azure.monitor.opentelemetry.exporter.AzureMonitorLogExporter(**kwargs: Any)[source]

Azure Monitor Log exporter for OpenTelemetry.

Azure Monitor base exporter for OpenTelemetry.

Keyword Arguments

api_version (str) – The service API version used. Defaults to latest.

Return type

None

export(batch: Sequence[opentelemetry.sdk._logs.LogData], **kwargs: Any)opentelemetry.sdk._logs.export.LogExportResult[source]

Export log data :param batch: Open Telemetry LogData(s) to export. :type batch: Sequence[~opentelemetry._logs.LogData] :rtype: ~opentelemetry.sdk._logs.export.LogData

classmethod from_connection_string(conn_str: str, **kwargs: Any)azure.monitor.opentelemetry.exporter.export.logs._exporter.AzureMonitorLogExporter[source]

Create an AzureMonitorLogExporter from a connection string.

This is the recommended way of instantation if a connection string is passed in explicitly. If a user wants to use a connection string provided by environment variable, the constructor of the exporter can be called directly.

Parameters

conn_str (str) – The connection string to be used for authentication.

Keyword Arguments

api_version (str) – The service API version used. Defaults to latest.

:returns an instance of ~AzureMonitorLogExporter

shutdown()None[source]

Shuts down the exporter.

Called when the SDK is shut down.

class azure.monitor.opentelemetry.exporter.AzureMonitorMetricExporter(**kwargs: Any)[source]

Azure Monitor Metric exporter for OpenTelemetry.

Azure Monitor base exporter for OpenTelemetry.

Keyword Arguments

api_version (str) – The service API version used. Defaults to latest.

Return type

None

export(metrics_data: opentelemetry.sdk.metrics.export.MetricsData, timeout_millis: float = 10000, **kwargs: Any)opentelemetry.sdk.metrics.export.MetricExportResult[source]

Exports a batch of metric data :param metrics: Open Telemetry Metric(s) to export. :type metrics_data: Sequence[~opentelemetry.sdk.metrics._internal.point.MetricsData] :rtype: ~opentelemetry.sdk.metrics.export.MetricExportResult

force_flush(timeout_millis: float = 10000)bool[source]

Ensure that export of any metrics currently received by the exporter are completed as soon as possible.

classmethod from_connection_string(conn_str: str, **kwargs: Any)azure.monitor.opentelemetry.exporter.export.metrics._exporter.AzureMonitorMetricExporter[source]

Create an AzureMonitorMetricExporter from a connection string.

This is the recommended way of instantation if a connection string is passed in explicitly. If a user wants to use a connection string provided by environment variable, the constructor of the exporter can be called directly.

Parameters

conn_str (str) – The connection string to be used for authentication.

Keyword Arguments

api_version (str) – The service API version used. Defaults to latest.

:returns an instance of ~AzureMonitorMetricExporter

shutdown(timeout_millis: float = 30000, **kwargs: Any)None[source]

Shuts down the exporter.

Called when the SDK is shut down.

class azure.monitor.opentelemetry.exporter.AzureMonitorTraceExporter(**kwargs: Any)[source]

Azure Monitor Trace exporter for OpenTelemetry.

Azure Monitor base exporter for OpenTelemetry.

Keyword Arguments

api_version (str) – The service API version used. Defaults to latest.

Return type

None

export(spans: Sequence[opentelemetry.sdk.trace.ReadableSpan], **kwargs: Any)opentelemetry.sdk.trace.export.SpanExportResult[source]

Export span data :param spans: Open Telemetry Spans to export. :type spans: Sequence[~opentelemetry.trace.Span] :rtype: ~opentelemetry.sdk.trace.export.SpanExportResult

force_flush(timeout_millis: int = 30000)bool

Hint to ensure that the export of any spans the exporter has received prior to the call to ForceFlush SHOULD be completed as soon as possible, preferably before returning from this method.

classmethod from_connection_string(conn_str: str, **kwargs: Any)azure.monitor.opentelemetry.exporter.export.trace._exporter.AzureMonitorTraceExporter[source]

Create an AzureMonitorTraceExporter from a connection string.

This is the recommended way of instantation if a connection string is passed in explicitly. If a user wants to use a connection string provided by environment variable, the constructor of the exporter can be called directly.

Parameters

conn_str (str) – The connection string to be used for authentication.

Keyword Arguments

api_version (str) – The service API version used. Defaults to latest.

:returns an instance of ~AzureMonitorTraceExporter

shutdown()None[source]

Shuts down the exporter.

Called when the SDK is shut down.