Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
feat: send fal script telemetry info (#780)
Browse files Browse the repository at this point in the history
  • Loading branch information
chamini2 authored Mar 13, 2023
1 parent 272c750 commit 0ecbc2b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 12 additions & 0 deletions projects/fal/src/fal/fal_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
from dataclasses import dataclass, field
from deprecation import deprecated

import hashlib

from faldbt.parse import normalize_path
from faldbt.project import DbtModel, FalDbt, FAL

from dbt.contracts.results import RunStatus
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"):
Expand Down Expand Up @@ -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):
"""
Expand Down
1 change: 0 additions & 1 deletion projects/fal/src/faldbt/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ def __init__(

telemetry.log_api(
action="faldbt_initialized",
additional_props={"config_hash": self._config.hashed_name()},
dbt_config=self._config,
)

Expand Down

0 comments on commit 0ecbc2b

Please sign in to comment.