-
Notifications
You must be signed in to change notification settings - Fork 7
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-1560] WSM uses Stairway 1.0.0's native MDC support #1666
Conversation
This is now enabled as needed via TCL's terra.common.tracing.stackdriverExportEnabled property.
TCL upgrade will have removed it. All of our AWS functionality is unsupported, so default to disabled. Ticket to fully clean up FeatureService and related code: WOR-1559
This required OTEL dependency upgrades for bootRun to work, following DataBiosphere/terra-common-lib#131 Is there a better way to get these from TCL without redefining them downstream?
MdcHook is greatly reduced and renamed to StairwayLoggingHook: it now only logs at notable state transitions.
This now matches the integration version as well as the version in TCL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - I went through everything yesterday, but forgot to hit the button!
I learned that Spring Boot Dependency Manager pulls in opentelemetry-bom as a dependency. For our Spring Boot version 3.1.2, opentelemetry-bom has version 1.25.0. Using the BOM (bill of materials) to manage OTEL dependencies is preferred to managing them individually: the BOM makes sure that they remain compatible with one another. The only OTEL dependencies that WSM needs to define directly are: 1. opentelemetry-api so that we can construct OpenTelemetry objects (versioned by the BOM, which is itself versioned by Spring Boot dependency manager) 2. opentelemetry-instrumentation-annotations so that we can use the @WithSpan annotation terra-common-lib defines the OTEL deps it needs, they are available as runtime dependencies so we don't need to redefine them. But it does not use the BOM to version them, or Spring Boot dependency manager. It versions them directly at 1.34.1. I found when removing the OTEL deps that WSM didn't need, I also needed to instruct our Spring Boot dependency manager to pin opentelemetry-bom at a higher version compatible with TCL's OTEL dependencies.
eda6738
to
8aef8d6
Compare
Please retry analysis of this Pull-Request directly on SonarCloud |
After merging in the main branch, I noticed that our Google BOM versions have again diverged. There is a wider mystery here as to why Dependabot is not picking up on some dependencies, but for now, bringing this one up to date.
Quality Gate passedIssues Measures |
Quality Gate passedIssues Measures |
https://broadworkbench.atlassian.net/browse/WOR-1560
Objective
WSM uses Stairway 1.0.0's native MDC (mapped diagnostic context) support, rather than populating the log MDC itself on flight state transitions.
How?
To achieve this, I first upgraded to the latest terra-common-lib, from which we get our Stairway dependency. Then I was able to drastically simplify our
MdcHook
: it is nowStairwayLoggingHook
, and does what it says on the tin (supplement logging on notable state transitions). I removed now-unused code, including cleaning upJobBuilder
's job initialization which no longer has to serialize the calling thread's MDC and write it to the input map.Because this TCL version got rid of Flagsmith, and WSM used Flagsmith in its user-level feature flagging (a Verily artifact), I excised Flagsmith from our repo to allow this upgrade and ticketed further clean-up here (we discussed in refinement that we wanted to fully remove AWS code from the repo): https://broadworkbench.atlassian.net/browse/WOR-1559
Other Dependency Upgrades
I had some trouble with dependencies straight out of the box: OTEL dependencies, and a Google BOM conflict within our repo.
I learned that Spring Boot Dependency Manager for Spring Boot 3.1.2 pulls in opentelemetry-bom:1.25.0 as a dependency.
Using the BOM (bill of materials) to manage OTEL dependencies is preferred to managing them individually: the BOM makes sure that they remain compatible with one another.
The only OTEL dependencies that WSM needs to define directly are:
opentelemetry-api
so that we can constructOpenTelemetry
objects (versioned by the BOM, which is itself versioned by Spring Boot dependency manager)opentelemetry-instrumentation-annotations
so that we can use the@WithSpan
annotation (not versioned by the BOM)terra-common-lib defines the OTEL deps it needs, they are available as runtime dependencies so we don't need to redefine them. But it does not use the BOM to version them, or Spring Boot dependency manager... it versions them directly at 1.34.1 (and 2.0.0 for instrumentation).
I found when removing the OTEL deps that WSM didn't need, I also needed to instruct our Spring Boot dependency manager to pin opentelemetry-bom to a higher version compatible with TCL's OTEL dependencies.
Demonstration
I deployed the latest version of this feature branch to my Bee, and triggered a flight. The resulting logs have their
jsonPayload
populated as we'd expect:jsonPayload.requestId
comes from)A
jsonPayload
for a log emitted during a step:All logs for the request, with
flightId
andflightStepNumber
added to the summary line: