Skip to content

Commit

Permalink
ensure telemetry hits your server
Browse files Browse the repository at this point in the history
  • Loading branch information
ColabDog committed Oct 12, 2023
1 parent 4dacaa5 commit 8dc3214
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deepeval/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import re

# Optionally add telemtry
from . import telemetry
from .telemetry import *
from ._version import __version__


Expand Down
2 changes: 1 addition & 1 deletion deepeval/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__: str = "0.20.5"
__version__: str = "0.20.6"
10 changes: 10 additions & 0 deletions deepeval/telemetry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import socket
import sys


def check_firewall():
Expand All @@ -24,6 +25,15 @@ def check_firewall():
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
)

# Add a global error handler
def handle_exception(exc_type, exc_value, exc_traceback):
print({"exc_type": exc_type, "exc_value": exc_value})
sentry_sdk.capture_exception(exc_value)
sys.__excepthook__(exc_type, exc_value, exc_traceback)

sys.excepthook = handle_exception

except ModuleNotFoundError:
# sentry_sdk not installed
pass

0 comments on commit 8dc3214

Please sign in to comment.