From 7c1cc81917421a367b28110407120d0eded6e738 Mon Sep 17 00:00:00 2001 From: Mark Hamilton Date: Tue, 7 Jan 2025 15:59:05 -0500 Subject: [PATCH] chore: fix certified events emitting --- .../main/python/synapse/ml/core/logging/SynapseMLLogger.py | 6 +----- .../azure/synapse/ml/logging/SynapseMLLogging.scala | 3 +-- .../synapse/ml/logging/fabric/CertifiedEventClient.scala | 6 ++---- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/core/src/main/python/synapse/ml/core/logging/SynapseMLLogger.py b/core/src/main/python/synapse/ml/core/logging/SynapseMLLogger.py index 37fed9e9da..04bf0621d3 100644 --- a/core/src/main/python/synapse/ml/core/logging/SynapseMLLogger.py +++ b/core/src/main/python/synapse/ml/core/logging/SynapseMLLogger.py @@ -145,14 +145,10 @@ def _log_base_dict(self, info: Dict[str, str], feature_name: Optional[str] = Non if feature_name is not None and running_on_synapse_internal(): from synapse.ml.fabric.telemetry_utils import report_usage_telemetry - keys_to_remove = ["libraryName", "method"] - attributes = { - key: value for key, value in info.items() if key not in keys_to_remove - } report_usage_telemetry( feature_name=self.library_name, activity_name=feature_name, - attributes=attributes, + attributes={}, ) self.logger.info(json.dumps(info)) diff --git a/core/src/main/scala/com/microsoft/azure/synapse/ml/logging/SynapseMLLogging.scala b/core/src/main/scala/com/microsoft/azure/synapse/ml/logging/SynapseMLLogging.scala index 0102dbafa8..5431d93488 100644 --- a/core/src/main/scala/com/microsoft/azure/synapse/ml/logging/SynapseMLLogging.scala +++ b/core/src/main/scala/com/microsoft/azure/synapse/ml/logging/SynapseMLLogging.scala @@ -128,8 +128,7 @@ trait SynapseMLLogging extends Logging { Future { logToCertifiedEvents( info("libraryName"), - featureName.get, - info -- Seq("libraryName", "method") + featureName.get ) }.failed.map { case e: Exception => logErrorBase("certifiedEventLogging", e) diff --git a/core/src/main/scala/com/microsoft/azure/synapse/ml/logging/fabric/CertifiedEventClient.scala b/core/src/main/scala/com/microsoft/azure/synapse/ml/logging/fabric/CertifiedEventClient.scala index b619bdd2d6..c6b0409bc3 100644 --- a/core/src/main/scala/com/microsoft/azure/synapse/ml/logging/fabric/CertifiedEventClient.scala +++ b/core/src/main/scala/com/microsoft/azure/synapse/ml/logging/fabric/CertifiedEventClient.scala @@ -19,16 +19,14 @@ object CertifiedEventClient { private[ml] def logToCertifiedEvents(featureName: String, - activityName: String, - attributes: Map[String, String]): Unit = { - + activityName: String): Unit = { if (runningOnFabric) { val payload = s"""{ |"timestamp":${Instant.now().getEpochSecond}, |"feature_name":"$featureName", |"activity_name":"$activityName", - |"attributes":${attributes.toJson.compactPrint} + |"attributes":{} |}""".stripMargin FabricClient.usagePost(CertifiedEventUri, payload)