The synchronous client for uploading logs to Azure Monitor.
endpoint (str) â The Data Collection Endpoint for the Data Collection Rule, for example https://dce-name.eastus-2.ingest.monitor.azure.com.
credential (TokenCredential) â Credential needed for the client to connect to Azure.
api_version (str) â Api Version. Default value is â2023-01-01â. Note that overriding this default value may result in unsupported behavior.
Example:
Creating the LogsIngestionClient with DefaultAzureCredential.ïfrom azure.identity import DefaultAzureCredential from azure.monitor.ingestion import LogsIngestionClient credential = DefaultAzureCredential() endpoint = "https://example.ingest.monitor.azure.com" client = LogsIngestionClient(endpoint, credential)
Example:
Creating the LogsIngestionClient for use with a sovereign cloud (i.e. non-public cloud).ïfrom azure.identity import AzureAuthorityHosts, DefaultAzureCredential from azure.monitor.ingestion import LogsIngestionClient credential = DefaultAzureCredential(authority=AzureAuthorityHosts.AZURE_GOVERNMENT) endpoint = "https://example.ingest.monitor.azure.us" client = LogsIngestionClient(endpoint, credential, credential_scopes=["https://monitor.azure.us/.default"])
Runs the network request through the clientâs chained policies.
>>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") <HttpRequest [GET], url: 'https://www.example.org/'> >>> response = client.send_request(request) <HttpResponse: 200 OK>
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
request (HttpRequest) â The network request you want to make. Required.
stream (bool) â Whether the response payload will be streamed. Defaults to False.
The response of your network call. Does not do error handling on your response.
Ingestion API used to directly ingest data using Data Collection Rules.
A list of logs is divided into chunks of 1MB or less, then each chunk is gzip-compressed and uploaded. If an I/O stream is passed in, the stream is uploaded as-is.
on_error (Optional[Callable[[LogsUploadError], None]]) â The callback function that is called when a chunk of logs fails to upload. This function should expect one argument that corresponds to an âLogsUploadErrorâ object. If no function is provided, then the first exception encountered will be raised.
None
None
~azure.core.exceptions.HttpResponseError
Error information for a failed upload to Azure Monitor.
The error that occurred during the upload.
The list of logs that failed to upload.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4