AzureMonitorLogExporter Class
Azure Monitor Log exporter for OpenTelemetry.
Azure Monitor base exporter for OpenTelemetry.
- Inheritance
-
azure.monitor.opentelemetry.exporter.export._base.BaseExporterAzureMonitorLogExporteropentelemetry.sdk._logs._internal.export.LogExporterAzureMonitorLogExporter
Constructor
AzureMonitorLogExporter(**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 log data. |
from_connection_string |
Create an AzureMonitorLogExporter 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 log data.
export(batch: Sequence[LogData], **kwargs: Any) -> LogExportResult
Parameters
Name | Description |
---|---|
batch
Required
|
Sequence[<xref:opentelemetry._logs.LogData>]
OpenTelemetry LogData(s) to export. |
Returns
Type | Description |
---|---|
<xref:opentelemetry.sdk._logs.export.LogData>
|
The result of the export. |
from_connection_string
Create an AzureMonitorLogExporter 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) -> AzureMonitorLogExporter
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 ~AzureMonitorLogExporter |
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