Skip to content

Commit 48c8320

Browse files
authored
[fix] Correct timestamp calculation in dify instrumentation (#74)
2 parents 0ef7dd7 + f240663 commit 48c8320

File tree

1 file changed

+1
-5
lines changed
  • instrumentation-loongsuite/loongsuite-instrumentation-dify/src/opentelemetry/instrumentation/dify

1 file changed

+1
-5
lines changed

instrumentation-loongsuite/loongsuite-instrumentation-dify/src/opentelemetry/instrumentation/dify/utils.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
def get_timestamp_from_datetime_attr(obj, attr_name):
66
attr_value = getattr(obj, attr_name, None)
77
if attr_value is not None and isinstance(attr_value, datetime):
8-
timestamp = (
9-
attr_value.timestamp() * 1_000_000_000
10-
+ attr_value.microsecond * 1_000
11-
)
12-
return int(timestamp)
8+
return int(attr_value.timestamp() * 1_000_000_000)
139
return time.time_ns()
1410

1511

0 commit comments

Comments
 (0)