Skip to content

Commit

Permalink
Reduce sentry trace size
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik van Velzen committed Jun 25, 2024
1 parent 070d904 commit 618034e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ services:
environment:
ALLOWED_HOSTS: "*"
AZURE_ACCOUNT_NAME: holonstorage
# AZURE_STORAGE_KEY:
MEDIA_LOCATION: media-dev
STATIC_LOCATION: static-dev
DB_HOST: db
Expand All @@ -73,6 +72,7 @@ services:
DOMAIN_HOST: http://localhost:8000
N_WORKERS: 2
DJANGO_SETTINGS_MODULE: pipit.settings.prod
SENTRY_ENVIRONMENT: local
env_file: ./docker/config/python.env

python-test:
Expand Down
1 change: 1 addition & 0 deletions docker/config/python.example.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ DOMAIN_HOST="https://pizzaoven.holontool.nl"
# Set to enable remote debugging with PyCharm or IntelliJ
PYCHARM_IP=172.17.0.1
PYCHARM_PORT=9222
SENTRY_DSN=https://764e9f2b886741bcbcfd2acd74a7f7b0@o4505045746384896.ingest.sentry.io/4505045759361024
17 changes: 9 additions & 8 deletions src/holon/services/cloudclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,15 @@ def run(self) -> AnyLogicOutput:

def log_input_output(self, inputs: Inputs, outputs: SingleRunOutputs):
span = sentry_sdk.Hub.current.scope.span
if span is not None and span.sampled is True:
span.set_data(
"inputs", list(map(self.model_input_value_to_log_format, inputs.inputs_array))
)
span.set_data(
"outputs",
list(map(self.model_output_value_to_log_format, outputs.get_raw_outputs())),
)
## Disabled because it's too much data and Sentry seems to drop it.
# if span is not None and span.sampled is True:
# span.set_data(
# "inputs", list(map(self.model_input_value_to_log_format, inputs.inputs_array))
# )
# span.set_data(
# "outputs",
# list(map(self.model_output_value_to_log_format, outputs.get_raw_outputs())),
# )

def model_input_value_to_log_format(self, model_input: dict) -> dict:
value = model_input["value"]
Expand Down

0 comments on commit 618034e

Please sign in to comment.