Skip to content

Commit

Permalink
Use isoformat after all
Browse files Browse the repository at this point in the history
  • Loading branch information
lancetarn committed Nov 1, 2024
1 parent a499525 commit 163f4da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
9 changes: 4 additions & 5 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Running the test app
--------------------

Note: this has not been tested in a while. Instead, the
[scout-test-apps repo](https://github.com/tim-schilling/scout-test-apps) has
[scout-test-apps repo](https://github.com/scoutapp/scout-test-apps) has
been used with many individual scout apps.

Add the following env variables:
Expand Down Expand Up @@ -133,7 +133,6 @@ architectures. Its documentation is excellent.
Documentation
-------------

The user documentation is stored in the [slate_apm_help
repo](https://github.com/scoutapp/slate_apm_help) in the
`source/_includes/python.md` file. Make relevant changes there when developing
features.
The user documentation is stored in the [scout-documentation](https://github.com/scoutapp/scout-documentation) repo.
It is private to the Scout Monitoring team; if you want to submit a feature feel free to
send us some Markdown and we will get it added.
11 changes: 6 additions & 5 deletions src/scout_apm/core/agent/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@

def format_dt_for_core_agent(event_time: dt.datetime) -> str:
"""
Returns expected format for Core Agent compatibility. Agent expects UTC datetime
with 'Z' suffix. Coerce any tz-aware datetime to UTC just in case.
Returns expected format for Core Agent compatibility.
Coerce any tz-aware datetime to UTC just in case.
"""
# if we somehow got a non-UTC datetime, convert it to UTC
if event_time.tzinfo is not None:
# if we somehow got a naive datetime, convert it to UTC
if event_time.tzinfo is None:
logger.warning("Naive datetime passed to format_dt_for_core_agent")
event_time = event_time.astimezone(dt.timezone.utc)
return event_time.strftime("%Y-%m-%dT%H:%M:%SZ")
return event_time.isoformat()


class Register(object):
Expand Down

0 comments on commit 163f4da

Please sign in to comment.