-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Sync logging with jest (#10459)
Jest would overwrite pino logs when logging via a worker thread. This changes logging so that we only use pino-pretty if running in jest, and we only use it as a stream in the main loop. See https://github.com/pinojs/pino-pretty?tab=readme-ov-file#usage-with-jest for more info. This PR also restores OTLP exports via `getEndToEndTestTelemetryClient`, which had been broken in a previous PR. Export now works by using a multistream destination (again, main loop) to send logs to OTEL. Note that there was an error in how we created the telemetry clients: since starting a new OTEL telemetry client involved registering metrics/traces/logs in the global OTEL variables, there were multiple errors in the lines of `Attempted duplicate registration of API: trace`. This is now fixed by having a single test telemetry client instance. This requires _not_ setting the service name, which is unfortunate. ![image](https://github.com/user-attachments/assets/5208178c-7765-444f-b0f9-e3f4b7532e43) As a last change here, the jest reporter for end-to-end tests is now set to `summary`. This means that jest will no longer write to the console `RUNS my-test-suite` every second or so, overwriting the actual logs we are trying to read.
- Loading branch information
1 parent
92eb377
commit 6e33cb9
Showing
8 changed files
with
99 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -145,9 +145,9 @@ | |
}, | ||
"reporters": [ | ||
[ | ||
"default", | ||
"summary", | ||
{ | ||
"summaryThreshold": 9999 | ||
"summaryThreshold": 0 | ||
} | ||
] | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters