-
Notifications
You must be signed in to change notification settings - Fork 260
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
Feat/timestamp in logs #705
Conversation
Signed-off-by: lidongjies <[email protected]>
Signed-off-by: lidongjies <[email protected]>
Do we want this to be human readable? cc @itowlson |
If I'm reading the code correctly (I haven't tested it), this looks like it prints milliseconds since the Unix epoch? I think a wall clock timestamp would be more broadly acceptable. It might be a good idea to discuss the desired behaviour before @lidongjies dives into the code though, to avoid wasted effort and excessive iteration. E.g.:
I am definitely NOT saying that we need all the knobs, and even more definitely not that we need them all on day one. But I think it would be good to get a sense for what we want long term, and how we want to start, before writing more code. Thoughts? |
@lidongjies Just circling round on this since time has passed - are you interested in pursuing this PR in the light of the discussion, or would you prefer us to close it? We'd be very happy to work with you on determining what a solution might look like - let us know! Thanks! |
@itowlson I'm currently researching this one as a follow-up of #938 and #931. The current idea is to rely on logging provided by
The high-level plan is (probably not well-formed yet):
In the end, it has to provide the unified logging system:
Will be happy to discuss! |
@etehtsea Here's the thing: I know some of what I want and don't want from all this. (For example, I don't want logging spew when I'm following a component interactively.) But other people want different things. (You clearly value unifying all output via the trace system for consistent presentation and processing, and I know you're not alone in that.) And situationally I may want different things. (If I've got a component running in the cloud, I probably do want timestamps. If I've got something running on my computer, any timestamps had better be local time; if it's remote, they'd better be UTC.) And what about tools, do I need to be able to configure the format to feed smoothly into Data Dog or Observability Ostrich or whatever the young people use nowadays? So... what do we need? Do we need knobs? What knobs do we need and how are they surfaced? Or am I a crankish outlier and everybody except me wants the same thing and I can be safely ignored? (Honestly the latter seems like a very likely outcome.) So before we go any further on this I would really like to see a requirements discussion resulting in a SIP laying out the user experience. Or at least a proposal with enough people agreeing with it to shut me up. We don't need to think about design or implementation until the desired behaviour is agreed at least at a high level. Does that caution seem appropriate? Is the proposal something you'd be interested in driving, or would you prefer us to tackle that stage of it? |
@itowlson, the stuff I've posted above is not "an ultimate solution" but more of a proposal to gather feedback. Also, I wasn't familiar with how logging is done internally in spin, so I conducted a little research to be able to reason about it (also, I wanted to check what
This sound more like a dev/prod mode (#389) where one log format is defined for dev and another one for prod mode.
It seems there is an open pull request about it (#655).
I agree with you. But also, it might make sense to define the baseline to make it easier to reason about enhancements and further integrations (such as log format, UTC vs local, log collectors integration, and so on). By it, I mean that spin already has timestamps in the log output but only for the stuff that is using I created a few issues and have stopped looking further into this until the consensus. |
@etehtsea I may be misreading but I'm concerned I may have upset you - if so, I apologise. I did not intend to derail you, and I value the investigations you were doing. I meant only to highlight that I feel we need to approach this cautiously and to have a way of gathering opinions and getting consensus (such as what is given by a SIP). I would love it if you felt willing to drive that - you clearly have the broad view that is needed, and your attention to detail in describing user interfaces and outputs would be super valuable. But of course I also appreciate that you're volunteering your time and may not want to invest it in that process! |
@itowlson Actually, it's the opposite, I appreciate your feedback. Sorry if it seemed like that, I probably didn't elaborate well. I would prefer to gather some feedback/requirements before creating the SIP, but I think I can try to figure out something and open a draft PR, and we'll go from there. |
@lidongjies I'm going to close this PR because there's been a lot of churn in the codebase since, and #962 is defining clearer requirements. Thanks for the contribution and sorry we couldn't accept it! |
Signed-off-by: lidongjies [email protected]
I added a timestamp to the
write
method inWriteDestinations
, but I think this is not appropriate. Please give me some feedback. 🤔Related issue #693