MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / send_telemetry

Function send_telemetry

methods/cognee/shared/utils.py:77–102  ·  view source on GitHub ↗
(event_name: str, user_id, additional_properties: dict = {})

Source from the content-addressed store, hash-verified

75
76
77def send_telemetry(event_name: str, user_id, additional_properties: dict = {}):
78 if os.getenv("TELEMETRY_DISABLED"):
79 return
80
81 env = os.getenv("ENV")
82 if env in ["test", "dev"]:
83 return
84
85 current_time = datetime.now(timezone.utc)
86 payload = {
87 "anonymous_id": str(get_anonymous_id()),
88 "event_name": event_name,
89 "user_properties": {
90 "user_id": str(user_id),
91 },
92 "properties": {
93 "time": current_time.strftime("%m/%d/%Y"),
94 "user_id": str(user_id),
95 **additional_properties,
96 },
97 }
98
99 response = requests.post(proxy_url, json=payload)
100
101 if response.status_code != 200:
102 print(f"Error sending telemetry through proxy: {response.status_code}")
103
104
105def get_file_content_hash(file_obj: Union[str, BinaryIO]) -> str:

Callers 9

specific_searchFunction · 0.90
handle_taskFunction · 0.90
run_tasks_with_telemetryFunction · 0.90
brute_force_searchFunction · 0.90
get_cascade_graph_tasksFunction · 0.90

Calls 2

get_anonymous_idFunction · 0.85
postMethod · 0.80

Tested by 3