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

[WOR-1544] Populate MDC for flight and its steps #117

Closed
wants to merge 9 commits into from

Conversation

okotsopoulos
Copy link
Contributor

@okotsopoulos okotsopoulos commented Feb 28, 2024

https://broadworkbench.atlassian.net/browse/WOR-1544

Wrap flight thread execution so that flight threads are context-aware.

  • Logs emitted during a flight thread now have the context from the calling thread, along with flight-specific context (flight ID and class).
  • Logs emitted during the execution of a step additionally include step-specific context (step class, direction, and index).

Handles the case where a flight thread spawns a child flight by intentionally cleaning any leftover step-specific context from the calling thread.

Wrap flight thread execution so that flight threads are context-aware.
Logs emitted during a flight thread now have the context from the calling thread, along with flight-specific context (flight ID and class).
Logs emitted during the execution of a step additionally include step-specific context (step class, direction, and index).
Handles the case where a flight thread spawns a child flight by intentionally cleaning any leftover step-specific context from the calling thread.
Drive-by: now that we include flight ID and class on all flight logs in the MDC, we can trim down the dismal failure log line.
We cannot call MDC.setContextMap with a null input.
flightContext.getFlightClassName(),
flightContext.getStepIndex(),
flightContext.getStepClassName());
"{} (index {}) experienced DISMAL FAILURE: non-retryable error on undo",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by: now that we include flight ID and class on all flight logs in the MDC, we can trim down the dismal failure log line.

I also reformatted to lead with the failing step class based off of Stairway retro feedback that all of the useful information on a log line is at the end. Do we like this better? Unfortunately we don't get step context in MDC for free at this point -- we're outside of step execution.

@okotsopoulos okotsopoulos changed the title Populate MDC for flight and its steps [WOR-1544] Populate MDC for flight and its steps Feb 28, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@okotsopoulos
Copy link
Contributor Author

Got into a weird Git state, recreating.

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.

2 participants