AzureMonitorTraceExporter Class
Azure Monitor Trace exporter for OpenTelemetry.
Azure Monitor base exporter for OpenTelemetry.
- Inheritance
-
azure.monitor.opentelemetry.exporter.export._base.BaseExporterAzureMonitorTraceExporteropentelemetry.sdk.trace.export.SpanExporterAzureMonitorTraceExporter
Constructor
AzureMonitorTraceExporter(**kwargs: Any)
Keyword-Only Parameters
Name | Description |
---|---|
api_version
|
The service API version used. Defaults to latest. |
connection_string
|
The connection string used for your Application Insights resource. |
credential
|
<xref:<xref:ManagedIdentityCredential/ClientSecretCredential>>
Token credential, such as ManagedIdentityCredential or ClientSecretCredential, used for Azure Active Directory (AAD) authentication. Defaults to None. |
disable_offline_storage
|
Determines whether to disable storing failed telemetry records for retry. Defaults to False. |
storage_directory
|
Storage path in which to store retry files. Defaults to <tempfile.gettempdir()>/opentelemetry-python-. |
Methods
export |
Export span data. |
force_flush |
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. |
from_connection_string |
Create an AzureMonitorTraceExporter from a connection string. This is the recommended way of instantiation 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. |
shutdown |
Shuts down the exporter. Called when the SDK is shut down. |
export
Export span data.
export(spans: Sequence[ReadableSpan], **kwargs: Any) -> SpanExportResult
Parameters
Name | Description |
---|---|
spans
Required
|
Sequence[<xref:opentelemetry.trace.Span>]
Open Telemetry Spans to export. |
Returns
Type | Description |
---|---|
<xref:opentelemetry.sdk.trace.export.SpanExportResult>
|
The result of the export. |
force_flush
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.
force_flush(timeout_millis: int = 30000) -> bool
Parameters
Name | Description |
---|---|
timeout_millis
|
default value: 30000
|
from_connection_string
Create an AzureMonitorTraceExporter from a connection string. This is the recommended way of instantiation 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.
from_connection_string(conn_str: str, **kwargs: Any) -> AzureMonitorTraceExporter
Parameters
Name | Description |
---|---|
conn_str
Required
|
The connection string to be used for authentication. |
Keyword-Only Parameters
Name | Description |
---|---|
api_version
|
The service API version used. Defaults to latest. |
Returns
Type | Description |
---|---|
an instance of ~AzureMonitorTraceExporter |
shutdown
Shuts down the exporter.
Called when the SDK is shut down.
shutdown() -> None
Azure SDK for Python
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for