Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: session lifecycle log improvements #51

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

jusiskin
Copy link
Contributor

@jusiskin jusiskin commented Oct 6, 2023

What was the problem/requirement? (What/Why)

The worker agent logs for session lifecycle events was ad-hoc and inconsistent

The previous PR (#49) was intended to include changes that were missed. That PR description has since been edited to reflect the actual changes made.

What was the solution? (How)

Made the logging message formatting structure consistent. The format for session events is:

[<SESSION_ID>] [<SESSIONACTION_ID>] (<SESSIONACTION_HUMAN_READABLE>): <MSG>

Where:

  • <SESSION_ID> — The unique identifier for the session
  • <SESSIONACTION_ID> — The unique identifier for the session action
  • <SESSIONACTION_HUMAN_READABLE> — A more human-friendly representation of the session action that denotes the job model entity that the action definition belongs to
  • <MSG> — The event message

An example of the new session log is:

2023-10-06 05:13:47,039 INFO [deadline_worker_agent.sessions.session] [session-6a7080641d5440c78a5f379b287c2b71]: Session started
2023-10-06 05:13:47,142 INFO [deadline_worker_agent.sessions.session] [session-6a7080641d5440c78a5f379b287c2b71] [sessionaction-6a7080641d5440c78a5f379b287c2b71-0] (environment[STEP:step-e404e034a52846809db3ec250ea82f48:myenv].enter()): Starting action
2023-10-06 05:13:47,150 INFO [deadline_worker_agent.sessions.session] [session-6a7080641d5440c78a5f379b287c2b71] [sessionaction-6a7080641d5440c78a5f379b287c2b71-0] (environment[STEP:step-e404e034a52846809db3ec250ea82f48:myenv].enter()): Action completed as SUCCEEDED
2023-10-06 05:13:47,251 INFO [deadline_worker_agent.sessions.session] [session-6a7080641d5440c78a5f379b287c2b71] [sessionaction-6a7080641d5440c78a5f379b287c2b71-1] (step[step-e404e034a52846809db3ec250ea82f48].run()): Starting action
2023-10-06 05:14:32,379 INFO [deadline_worker_agent.sessions.session] [session-6a7080641d5440c78a5f379b287c2b71] [sessionaction-6a7080641d5440c78a5f379b287c2b71-1] (step[step-e404e034a52846809db3ec250ea82f48].run()): Action completed as SUCCEEDED
2023-10-06 05:14:32,852 INFO [deadline_worker_agent.sessions.session] [session-6a7080641d5440c78a5f379b287c2b71] [sessionaction-6a7080641d5440c78a5f379b287c2b71-2] (environment[STEP:step-e404e034a52846809db3ec250ea82f48:myenv].exit()): Starting action
2023-10-06 05:14:32,861 INFO [deadline_worker_agent.sessions.session] [session-6a7080641d5440c78a5f379b287c2b71] [sessionaction-6a7080641d5440c78a5f379b287c2b71-2] (environment[STEP:step-e404e034a52846809db3ec250ea82f48:myenv].exit()): Action completed as SUCCEEDED
2023-10-06 05:14:33,043 INFO [deadline_worker_agent.sessions.session] [session-6a7080641d5440c78a5f379b287c2b71]: Session complete

What is the impact of this change?

  • Logging is more structured and internally consistent and easy to filter with basic text searches
  • Since identifiers are fixed length, the log messages for session lifecycle events align vertically unless word-wrapping

How was this change tested?

  • Automated unit tests were added and updated
  • Manual end-to-end testing

Was this change documented?

No

Is this a breaking change?

Yes, log formatting has changed

@jusiskin jusiskin added the enhancement New feature or request label Oct 6, 2023
@jusiskin jusiskin requested a review from a team as a code owner October 6, 2023 20:30
Signed-off-by: Josh Usiskin <56369778+jusiskin@users.noreply.github.com>
@jusiskin jusiskin force-pushed the jusiskin/log_completed_session_actions branch from 66f5813 to 668a76f Compare October 6, 2023 20:36
@jusiskin jusiskin merged commit f658fff into mainline Oct 6, 2023
9 checks passed
@jusiskin jusiskin deleted the jusiskin/log_completed_session_actions branch October 6, 2023 20:54
gmchale79 pushed a commit that referenced this pull request Oct 31, 2023
Signed-off-by: Josh Usiskin <56369778+jusiskin@users.noreply.github.com>
Signed-off-by: Graeme McHale <gmchale@amazon.com>
gmchale79 pushed a commit that referenced this pull request Nov 2, 2023
Signed-off-by: Josh Usiskin <56369778+jusiskin@users.noreply.github.com>
Signed-off-by: Graeme McHale <gmchale@amazon.com>
gahyusuh pushed a commit that referenced this pull request Nov 6, 2023
Signed-off-by: Josh Usiskin <56369778+jusiskin@users.noreply.github.com>
Signed-off-by: Graeme McHale <gmchale@amazon.com>
Signed-off-by: Gahyun Suh <132245153+gahyusuh@users.noreply.github.com>
gmchale79 pushed a commit that referenced this pull request Feb 12, 2024
Signed-off-by: Josh Usiskin <56369778+jusiskin@users.noreply.github.com>
Signed-off-by: Graeme McHale <gmchale@amazon.com>
gmchale79 pushed a commit that referenced this pull request Mar 11, 2024
Signed-off-by: Josh Usiskin <56369778+jusiskin@users.noreply.github.com>
Signed-off-by: Graeme McHale <gmchale@amazon.com>
jusiskin added a commit to jusiskin/deadline-cloud-worker-agent that referenced this pull request Sep 4, 2024
Signed-off-by: Josh Usiskin <56369778+jusiskin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants