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: adds data on action kind and queue length to logs #266

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

ddneilson
Copy link
Contributor

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

When looking at Agent Logs it is useful to know:

  1. What kind of SessionAction is starting/ending. This helps understand the flow of the running Session(s) just from the agent log and can be a useful troubleshooting tool.
  2. How many actions are queued up in a Session's internal pipeline. As with the above, this can be a useful troubleshooting datapoint, but can also be used to generate some statistics on scheduling behavior.

What was the solution? (How)

This adds:

  1. A 'kind' field to SessionActionLogEvents with values: TaskRun, EnvEnter, EnvExit, and JobAttachSyncInput.
  2. A 'queue_length' field to SessionLogEvents of subtype Add and Remove.

It also adds a warning message to the start of the Agent log to inform the customer about the expectations that they can have about log contents and formatting. This was added because not all customers will see the README on the GitHub repository.

What is the impact of this change?

More useful data in the agent logs, and a message to clearly set customer expectations with respect to the log contents and format.

How was this change tested?

I've run the agent with the changes in place, and updated tests. Moreover, the way in which the change was made relied upon tooling to reduce risk:

  1. The addition to SessionActionLogEvent is a required keyword argument, so the linter picks up on every place that a required change is missed.
  2. The addition of a kind to SessionLogEvent is only applicable to two subtypes, and each of those subtypes only occurs once in the codebase (outside of tests). This made is easy to do a global search to find all instances and be confident that none were missed.

Was this change documented?

Yes, the README has been updated.

Is this a breaking change?

No, it is strictly additive to structured logs, and we do not consider changes to the unstructured logs to be breaking.

@ddneilson ddneilson requested a review from a team as a code owner March 27, 2024 04:43
@ddneilson ddneilson enabled auto-merge (squash) March 27, 2024 04:46
README.md Show resolved Hide resolved
Request:

When looking at Agent Logs it is useful to know:

1. What kind of SessionAction is starting/ending. This helps understand
   the flow of the running Session(s) just from the agent log and can be
   a useful troubleshooting tool.
2. How many actions are queued up in a Session's internal pipeline. As
   with the above, this can be a useful troubleshooting datapoint, but
   can also be used to generate some statistics on scheduling behavior.

Solution:

This adds:

1. A 'kind' field to SessionActionLogEvents with values: TaskRun,
   EnvEnter, EnvExit, and JobAttachSyncInput.
2. A 'queue_length' field to SessionLogEvents of subtype Add and Remove.

It also adds a warning message to the start of the Agent log to inform
the customer about the expectations that they can have about log
contents and formatting. This was added because not all customers will
see the README on the GitHub repository.

Signed-off-by: Daniel Neilson <53624638+ddneilson@users.noreply.github.com>
@ddneilson ddneilson requested a review from mwiebe March 27, 2024 16:36
@ddneilson ddneilson merged commit bb10c47 into mainline Mar 27, 2024
12 checks passed
@ddneilson ddneilson deleted the ddneilson/P95860983 branch March 27, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants