Skip to content

Commit

Permalink
Fix: OTel bugs (#318)
Browse files Browse the repository at this point in the history
* fix: patch action payload issue caused by wrong type hint

* chore: ver
  • Loading branch information
mrkaye97 authored Feb 12, 2025
1 parent 9ad90a6 commit 1a7164d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion hatchet_sdk/clients/dispatcher/action_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ def __post_init__(self):

@property
def otel_attributes(self) -> dict[str, str | int]:
try:
payload_str = json.dumps(self.action_payload, default=str)
except Exception:
payload_str = str(self.action_payload)

attrs: dict[str, str | int | None] = {
"hatchet.tenant_id": self.tenant_id,
"hatchet.worker_id": self.worker_id,
Expand All @@ -101,7 +106,7 @@ def otel_attributes(self) -> dict[str, str | int]:
"hatchet.parent_workflow_run_id": self.parent_workflow_run_id,
"hatchet.child_workflow_index": self.child_workflow_index,
"hatchet.child_workflow_key": self.child_workflow_key,
"hatchet.action_payload": self.action_payload,
"hatchet.action_payload": payload_str,
"hatchet.workflow_name": self.job_name,
"hatchet.action_name": self.action_id,
"hatchet.get_group_key_run_id": self.get_group_key_run_id,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hatchet-sdk"
version = "0.46.0"
version = "0.46.1"
description = ""
authors = ["Alexander Belanger <alexander@hatchet.run>"]
readme = "README.md"
Expand Down

0 comments on commit 1a7164d

Please sign in to comment.