From 0ecbc2bfbd4692c187936c9f3954a4c3e5dff25b Mon Sep 17 00:00:00 2001 From: Matteo Ferrando Date: Mon, 13 Mar 2023 18:11:47 -0400 Subject: [PATCH] feat: send fal script telemetry info (#780) --- projects/fal/src/fal/fal_script.py | 12 ++++++++++++ projects/fal/src/faldbt/project.py | 1 - 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/projects/fal/src/fal/fal_script.py b/projects/fal/src/fal/fal_script.py index de44bb205..73b04fe08 100644 --- a/projects/fal/src/fal/fal_script.py +++ b/projects/fal/src/fal/fal_script.py @@ -6,6 +6,8 @@ from dataclasses import dataclass, field from deprecation import deprecated +import hashlib + from faldbt.parse import normalize_path from faldbt.project import DbtModel, FalDbt, FAL @@ -13,6 +15,7 @@ from dbt.config.runtime import RuntimeConfig from faldbt.logger import LOGGER +from fal.telemetry import telemetry import faldbt.version as version if version.is_version_plus("1.4.0"): @@ -156,6 +159,15 @@ def __init__( object.__setattr__(self, "hook_arguments", hook_arguments) object.__setattr__(self, "is_hook", is_hook) + telemetry.log_api( + action="falscript_initialized", + additional_props={ + "is_global": model is None, + "is_hook": is_hook, + "script_path": hashlib.md5(path.encode()).hexdigest(), + }, + ) + @classmethod def from_hook(cls, faldbt: FalDbt, model: DbtModel, hook: Hook): """ diff --git a/projects/fal/src/faldbt/project.py b/projects/fal/src/faldbt/project.py index 1da6a5732..23888eb88 100644 --- a/projects/fal/src/faldbt/project.py +++ b/projects/fal/src/faldbt/project.py @@ -512,7 +512,6 @@ def __init__( telemetry.log_api( action="faldbt_initialized", - additional_props={"config_hash": self._config.hashed_name()}, dbt_config=self._config, )