Skip to content
Snippets Groups Projects
Unverified Commit 156e92a4 authored by Marcel Vriend's avatar Marcel Vriend Committed by GitHub
Browse files

Fix too verbose HTTP logging for Azure Data Explorer (#121802)

parent 5f02f3ca
No related branches found
No related tags found
No related merge requests found
...@@ -65,13 +65,18 @@ class AzureDataExplorerClient: ...@@ -65,13 +65,18 @@ class AzureDataExplorerClient:
) )
if data[CONF_USE_QUEUED_CLIENT] is True: if data[CONF_USE_QUEUED_CLIENT] is True:
# Queded is the only option supported on free tear of ADX # Queued is the only option supported on free tier of ADX
self.write_client = QueuedIngestClient(kcsb_ingest) self.write_client = QueuedIngestClient(kcsb_ingest)
else: else:
self.write_client = ManagedStreamingIngestClient.from_dm_kcsb(kcsb_ingest) self.write_client = ManagedStreamingIngestClient.from_dm_kcsb(kcsb_ingest)
self.query_client = KustoClient(kcsb_query) self.query_client = KustoClient(kcsb_query)
# Reduce the HTTP logging, the default INFO logging is too verbose.
logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(
logging.WARNING
)
def test_connection(self) -> None: def test_connection(self) -> None:
"""Test connection, will throw Exception if it cannot connect.""" """Test connection, will throw Exception if it cannot connect."""
...@@ -80,7 +85,7 @@ class AzureDataExplorerClient: ...@@ -80,7 +85,7 @@ class AzureDataExplorerClient:
self.query_client.execute_query(self._database, query) self.query_client.execute_query(self._database, query)
def ingest_data(self, adx_events: str) -> None: def ingest_data(self, adx_events: str) -> None:
"""Send data to Axure Data Explorer.""" """Send data to Azure Data Explorer."""
bytes_stream = io.StringIO(adx_events) bytes_stream = io.StringIO(adx_events)
stream_descriptor = StreamDescriptor(bytes_stream) stream_descriptor = StreamDescriptor(bytes_stream)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment