-
Notifications
You must be signed in to change notification settings - Fork 540
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(instrumentation-pino): add log sending to Logs Bridge API (#2249)
* feat(instrumentation-pino): add log sending to Logs Bridge API * refactor tests (mostly from separate #2247 PR); lint:fix; some in-progress changes * remove some old dev/debug code * feat!: make it so re-enabled instr after creating a logger will NOT change behaviour for that logger This removes functionality that was there before, so technically could be breaking. The motivation is to have the contract of pino instrumentation be cleaner. With this change a pino Logger instance will not be touched if the PinoInstrumentation is disabled. I.e. we are hands-off as much as possible when disabled. Before this change, even when disabled, the instrumentation would tweak the pino Logger config to have a no-op mixin. If the instrumentation was later enabled, then the mixin would become active (adding trace_id et al fields in a span context). The coming "log sending" to the Logs Bridge API will *not* support this "work if instrumentation is re-enabled later", so I think it is clearer if neither "log sending" nor "log correlation" support this. We can back this out if we think it is important to support a possible future feature of the SDK doing live enabling/disabling of individual instrumentations. * impl disableLogCorrelation config; undo the previous commit so that log-correlation *will* follow the live instr enable/disable state * log sending: first tests; change impl to use pino.multistream * edge case tests; almost complete * more tests and a fix for 'useOnlyCustomLevels: true' usage * lint:fix * refactor some code out to utils file * add some internal docs * update readme * fix lint * avoid a possible flaky error if using pino 'unixTime' and logging in the first half-second since process start Effectively the issue is that this sometimes returns true: node -e 'console.log(Math.round(Date.now() / 1e3) * 1e3 < performance.timeOrigin)' * limit log-sending to pino@7 and later because that's when pino.multistream was added * lint:fix * discuss pino-opentelemetry-transport alternative * fix a mis-merge * update changed deps to their new latest * typo in README Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> --------- Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com> Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
- Loading branch information
1 parent
d9d558f
commit 055ef41
Showing
7 changed files
with
784 additions
and
72 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.