Skip to content

Commit d64e750

Browse files
authored
fix: Record UTC timestamps for transactions (getsentry#547)
* fix: Record UTC timestamps for transactions * fix: Do not upload coverage to zeus if no api token is available * noop for bot * syntax?
1 parent 79557f7 commit d64e750

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ script:
6262
- coverage combine .coverage*
6363
- coverage xml -i
6464
- codecov --file coverage.xml
65-
- zeus upload -t "application/x-cobertura+xml" coverage.xml
65+
- '[[ -z "$ZEUS_API_TOKEN" ]] || zeus upload -t "application/x-cobertura+xml" coverage.xml'
6666

6767
notifications:
6868
webhooks:

sentry_sdk/tracing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def __init__(
133133
self.hub = hub
134134
self._tags = {} # type: Dict[str, str]
135135
self._data = {} # type: Dict[str, Any]
136-
self.start_timestamp = datetime.now()
136+
self.start_timestamp = datetime.utcnow()
137137

138138
#: End timestamp of span
139139
self.timestamp = None # type: Optional[datetime]
@@ -279,7 +279,7 @@ def finish(self, hub=None):
279279
# This transaction is already finished, so we should not flush it again.
280280
return None
281281

282-
self.timestamp = datetime.now()
282+
self.timestamp = datetime.utcnow()
283283

284284
_maybe_create_breadcrumbs_from_span(hub, self)
285285

tests/test_transport.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def test_transport_works(
4444
Hub.current.bind_client(client)
4545
request.addfinalizer(lambda: Hub.current.bind_client(None))
4646

47-
add_breadcrumb(level="info", message="i like bread", timestamp=datetime.now())
47+
add_breadcrumb(level="info", message="i like bread", timestamp=datetime.utcnow())
4848
capture_message("löl")
4949

5050
getattr(client, client_flush_method)()

0 commit comments

Comments
 (0)