googleapis / nodejs-logging-winston

Node.js client integration between Stackdriver Logging and Winston.
https://cloud.google.com/logging/
Apache License 2.0
105 stars 50 forks source link

fix: Fix timestamp drift due to using instanceof typeguard #827

Open cindy-peng opened 9 months ago

cindy-peng commented 9 months ago

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

Fixes #802 🦕 This is to fix timestamp drift issue which may cause timestamp inaccuracy while using OpenTelemetry and view trace timespans. Since timestamp within metadata is defined as a union-types including null and undefined, the type guard is not necessary here.

daniel-sanche commented 9 months ago

Can you add any tests around this? Try to make one that would fail before the change, but passes after

cindy-peng commented 9 months ago

Can you add any tests around this? Try to make one that would fail before the change, but passes after

Good suggestion. Will do!