GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — logging-winston: use custom serialization · Issue #2218 · googleapis/google-cloud-node

logging-winston: use custom serialization #2218

New issue
Copy link
New issue
Copy link
Closed
Closed
logging-winston: use custom serialization#2218
Copy link
Assignees
stephenplusplus
Labels
api: logging-winstontype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@stephenplusplus
stephenplusplus
opened on Apr 13, 2017
Issue body actions

Could you take a look at this system test that is failing?

  • Build
 1) LoggingWinston log should properly write log entries:

      Uncaught AssertionError: '2017-04-13T13:18:30.003Z' === 'Thu Apr 13 2017 13:17:08 GMT+0000 (UTC)'
      + expected - actual

      -2017-04-13T13:18:30.003Z
      +Thu Apr 13 2017 13:17:08 GMT+0000 (UTC)
      
      at Object.testData.verify (system-test/logging-winston.js:63:18)
      at system-test/logging-winston.js:104:20
      at Array.forEach (native)
      at system-test/logging-winston.js:102:14
      at node_modules/@google-cloud/logging/src/index.js:314:14

Activity

Next
  1. stephenplusplus
    added
    api: logging-winston
    testing
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Apr 13, 2017
  2. stephenplusplus
    assigned
    ofrobots
    on Apr 13, 2017
  3. lukesneeringer
    added
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on Apr 13, 2017
  4. ofrobots commented on Apr 20, 2017

    @ofrobots
    ofrobots
    on Apr 20, 2017
    Contributor
    More actions

    Curious... seems to be passing for me.

  5. stephenplusplus commented on Apr 20, 2017

    @stephenplusplus
    stephenplusplus
    on Apr 20, 2017
    ContributorAuthor
    More actions

    Alright, you can close this if you can't find anything flaky about the test, then if the problem shows up again on CI, we'll just re-open.

  6. ofrobots commented on Apr 20, 2017

    @ofrobots
    ofrobots
    on Apr 20, 2017
    Contributor
    More actions

    Let me stare at the code for a bit.

  7. ofrobots commented on Apr 20, 2017

    @ofrobots
    ofrobots
    on Apr 20, 2017
    Contributor
    More actions

    I am really puzzled by this. The test is:

    var testTimestamp = new Date();
    //...
    assert.strictEqual(
        entry.metadata.labels.testTimestamp,
        util.inspect(testTimestamp)
    );

    Even if it is a flake, I am quite puzzled how util.inspect(testTimestamp) managed to format it as Thu Apr 13 2017 13:17:08 GMT+0000 (UTC). util.inspect should use the ISO form.

    Do you have objections to pre-emptively adding a debug print to catch some more info if it flakes again?

  8. stephenplusplus commented on Apr 20, 2017

    @stephenplusplus
    stephenplusplus
    on Apr 20, 2017
    ContributorAuthor
    More actions

    Looks like that's a new thing:

    $ node
    > process.version
    'v4.8.2'
    > util.inspect(new Date())
    'Thu Apr 20 2017 12:30:34 GMT-0400 (Eastern Daylight Time)'
    
  9. ofrobots commented on Apr 20, 2017

    @ofrobots
    ofrobots
    on Apr 20, 2017
    Contributor
    More actions

    Okay, it makes a lot more sense now.

    It is definitely a flake in that case. It seems that we are retrieving the log entries from previous system-test run. That is, a node 4 run is fetching the entries from a preceding node 6/7 run.

    The delay is already set to 90 seconds, should we increase it?

  10. stephenplusplus commented on Apr 20, 2017

    @stephenplusplus
    stephenplusplus
    on Apr 20, 2017
    ContributorAuthor
    More actions

    I suppose so :( Does any source code need to be touched to make sure the behavior of the new util.inspect() is passed to the API, even in Node v4 envs, or no big deal?

  11. ofrobots commented on Apr 20, 2017

    @ofrobots
    ofrobots
    on Apr 20, 2017
    Contributor
    More actions

    The contract we have is that we will format metadata attached to winston log entries using util.inspect. Whatever behaviour util.inspect has with a given node version is the behaviour we should follow. So, no, I don't think source code needs to be touched.

  12. stephenplusplus commented on Apr 20, 2017

    @stephenplusplus
    stephenplusplus
    on Apr 20, 2017
    ContributorAuthor
    More actions

    I can see your point, but I worry that will set them up for the same confusion we just had when they inevitably upgrade Node or simply try to write an app that handles consistently-formed data from a log that has writers from multiple environments. Assuming Logging's job is to take input, stringify it, and send it to the API, it seems like a bug that we would do that differently depending on what version of Node is running.

    The "contract" part is a bit more weighted now that we have gone 1.0 with Logging. If you don't think we should guarantee a consistent API message across multiple Node versions (which we could call a bug fix, as opposed to a breaking change), then go ahead and bump the delay of the system test and we'll see if we get better results.

  13. ofrobots commented on Apr 20, 2017

    @ofrobots
    ofrobots
    on Apr 20, 2017
    Contributor
    More actions

    logging-winston should follow winston conventions. Winston also formats data using util.inspect: https://github.com/winstonjs/winston#logging-with-metadata.

  14. 4 remaining items

  15. ofrobots commented on Apr 21, 2017

    @ofrobots
    ofrobots
    on Apr 21, 2017
    Contributor
    More actions

    BTW, here's the change in Node that changed the behaviour of util.inspect: nodejs/node#4314

  16. stephenplusplus commented on Apr 21, 2017

    @stephenplusplus
    stephenplusplus
    on Apr 21, 2017
    ContributorAuthor
    More actions

    A better solution would be to make util.inspect optional (default: false) and let common-grpc do the serialization. This would be a semver major change, but we are still in the 0.x, so still doable.

    That sounds good to me, and thank you for digging into this.

  17. stephenplusplus
    changed the title [-]logging-winston failed system test ("log should properly write log entries")[/-] [+]logging-winston: use custom serialization[/+] on Apr 21, 2017
  18. ofrobots commented on Apr 21, 2017

    @ofrobots
    ofrobots
    on Apr 21, 2017
    Contributor
    More actions

    That sounds good to me, and thank you for digging into this.

    Thank you for being a good advocate for consistent behaviour for users :).

  19. stephenplusplus commented on Apr 21, 2017

    @stephenplusplus
    stephenplusplus
    on Apr 21, 2017
    ContributorAuthor
    More actions

    🎖 Teamwork! 🏆

    Reacted by Ali Ijaz Sheikh
    Reacted by Luke Sneeringer
  20. ofrobots
    added 4 commits that reference this issue on May 10, 2017

    logging-winston: metadata serialization

    87a5ce9

    logging-winston: metadata serialization

    87a167e

    logging-winston: metadata serialization

    2b7b9ed

    logging-winston: metadata serialization

    4fb6c8f
  21. stephenplusplus
    added a commit that references this issue on May 11, 2017

    logging-winston: metadata serialization

    0bcd810
  22. stephenplusplus
    closed this as completedin #2288on May 11, 2017
  23. lukesneeringer
    removed
    priority: p2Moderately-important priority. Fix may not be included in next release.
    on May 11, 2017
  24. JustinBeckwith
    unassigned
    ofrobots
    on Sep 19, 2018
  25. JustinBeckwith
    assigned
    stephenplusplus
    on Feb 1, 2021
  26. sofisl
    added a commit that references this issue on Feb 24, 2026

    feat: Enable tracing via OpenTelemetry. (#2218)

    e60eb87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

api: logging-winstontype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.