зеркало из
1
0
Форкнуть 0
* Added kcsb's app for tracing and user for tracing to queued ingest client ingestion properties as well

* PR fixes

* without init! - Moved to ingest_from_blob, and update to use client version for tracing

* Removed tracing params from ingestion properties

* Update ingest_client.py

manually removed ingestion properties settings

* Removed tracing params from ingestion properties again

---------

Co-authored-by: AsafMah <asafmahlev@microsoft.com>
This commit is contained in:
t-ronmoneta 2024-04-08 12:31:29 +03:00 коммит произвёл GitHub
Родитель 93a7b34e5f
Коммит b8db2d7c51
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 17 добавлений и 8 удалений

Просмотреть файл

@ -125,8 +125,6 @@ class QueuedIngestClient(BaseIngestClient):
:param azure.kusto.ingest.BlobDescriptor blob_descriptor: An object that contains a description of the blob to be ingested.
:param azure.kusto.ingest.IngestionProperties ingestion_properties: Ingestion properties.
"""
ingestion_properties.application_for_tracing = self.application_for_tracing
ingestion_properties.client_version_for_tracing = self.client_version_for_tracing
IngestTracingAttributes.set_ingest_descriptor_attributes(blob_descriptor, ingestion_properties)
if self._is_closed:
@ -135,7 +133,13 @@ class QueuedIngestClient(BaseIngestClient):
queues = self._resource_manager.get_ingestion_queues()
authorization_context = self._resource_manager.get_authorization_context()
ingestion_blob_info = IngestionBlobInfo(blob_descriptor, ingestion_properties=ingestion_properties, auth_context=authorization_context)
ingestion_blob_info = IngestionBlobInfo(
blob_descriptor,
ingestion_properties=ingestion_properties,
auth_context=authorization_context,
application_for_tracing=self.application_for_tracing,
client_version_for_tracing=self.client_version_for_tracing,
)
ingestion_blob_info_json = ingestion_blob_info.to_json()
retries_left = min(self._MAX_RETRIES, len(queues))
for queue in queues:

Просмотреть файл

@ -10,7 +10,14 @@ if TYPE_CHECKING:
class IngestionBlobInfo:
def __init__(self, blob_descriptor: "BlobDescriptor", ingestion_properties: "IngestionProperties", auth_context=None):
def __init__(
self,
blob_descriptor: "BlobDescriptor",
ingestion_properties: "IngestionProperties",
auth_context=None,
application_for_tracing=None,
client_version_for_tracing=None,
):
self.properties = dict()
self.properties["BlobPath"] = blob_descriptor.path
if blob_descriptor.size:
@ -24,8 +31,8 @@ class IngestionBlobInfo:
self.properties["ReportMethod"] = ingestion_properties.report_method.value
self.properties["SourceMessageCreationTime"] = datetime.utcnow().isoformat()
self.properties["Id"] = str(blob_descriptor.source_id)
self.properties["ApplicationForTracing"] = ingestion_properties.application_for_tracing
self.properties["ClientVersionForTracing"] = ingestion_properties.client_version_for_tracing
self.properties["ApplicationForTracing"] = application_for_tracing
self.properties["ClientVersionForTracing"] = client_version_for_tracing
additional_properties = ingestion_properties.additional_properties or {}
additional_properties["authorizationContext"] = auth_context

Просмотреть файл

@ -218,8 +218,6 @@ class IngestionProperties:
self.report_method = report_method
self.validation_policy = validation_policy
self.additional_properties = additional_properties
self.application_for_tracing = None
self.client_version_for_tracing = None
def get_tracing_attributes(self) -> dict:
"""Gets dictionary of attributes to be documented during tracing"""