Skip to content

Commit

Permalink
Merge pull request #103 from microsoft/v3
Browse files Browse the repository at this point in the history
v2.0.7
  • Loading branch information
bluewatersql authored Jan 7, 2025
2 parents 8057248 + 4719847 commit a7fcb6b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Packages/FabricSync/FabricSync.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: FabricSync
Version: 2.0.6
Version: 2.0.7
Summary: Fabric BigQuery Data Sync Utility
Author-email: Microsoft GBBs North America <[email protected]>
License: MIT License
Expand Down
13 changes: 7 additions & 6 deletions Packages/FabricSync/FabricSync/BQ/Logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from .Enum import *
from .Constants import SyncConstants
from .Utils import *
from ..Meta import Version as SyncVersion

class SyncLogger:
def __init__(self, context:SparkSession):
Expand Down Expand Up @@ -60,7 +61,10 @@ def sync_status(self, message, *args, **kwargs):
def telemetry(self, message, *args, **kwargs):
if (self.logger.isEnabledFor(SyncLogLevel.TELEMETRY.value)):
if self.Telemetry:
self.send_telemetry(message)
message["correlation_id"] = self.ApplicationID
message["sync_version"] = SyncVersion.CurrentVersion

self.send_telemetry(json.dumps(message))
#self.logger._log(SyncLogLevel.SYNC_STATUS.value, f"Telemetry: {message}", args, **kwargs)

def send_telemetry(self, payload):
Expand All @@ -78,10 +82,7 @@ def send_telemetry(self, payload):
async def send_telemetry_to_api(self, payload):
try:
api_proxy = RestAPIProxy(base_url=f"https://{self.TelemetryEndpoint}")
#response = api_proxy.post(endpoint="telemetry", data=payload)

bound = functools.partial(api_proxy.post, endpoint="telemetry", data=payload)
#loop = asyncio.get_event_loop()
await self.loop.run_in_executor(None, bound)
except Exception as e:
self.logger.error("Telemetry Send Failure")
Expand Down Expand Up @@ -135,9 +136,9 @@ def log_telemetry(operation:str, result=None, data=None):
}

if data:
payload = payload | data
payload["operation_data"] = data

logging.Logger.telemetry(json.dumps(payload))
logging.Logger.telemetry(payload)

def Install(func_=None):
def _decorator(func):
Expand Down
2 changes: 1 addition & 1 deletion Packages/FabricSync/FabricSync/Meta.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
class Version():
CurrentVersion = "2.0.6"
CurrentVersion = "2.0.7"
Binary file added dist/FabricSync-2.0.7-py3-none-any.whl
Binary file not shown.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "FabricSync"
version = "2.0.6"
version = "2.0.7"
dependencies = [
'pydantic == 2.10.4',
'PyGithub == 2.5.0',
Expand Down

0 comments on commit a7fcb6b

Please sign in to comment.