Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Structured logging/event creation #197

Closed
nfisher opened this issue Oct 10, 2018 · 4 comments
Closed

Structured logging/event creation #197

nfisher opened this issue Oct 10, 2018 · 4 comments

Comments

@nfisher
Copy link

nfisher commented Oct 10, 2018

Not sure whether people feels this is a fit but I was reading through the Honeycomb docs and noticed they have the concept of an "Event"[1] and provides the following interface;

  ev := libhoney.NewEvent()
  ev.Add(map[string]interface{}{
    "method": "get",
    "hostname": "appserver15",
    "payload_length": 27,
  }))
  ev.AddField("duration_ms", 153.12)
  defer ev.Send()

Looking at it sideways it seems a good fit for a standard structured logging interface when used with a printer. For services like honeycomb that have the concept of an "event" it could be shipped directly. If the spans context were submitted as part of the NewEvent() I could see it automatically tagging the event with related span info like parent, root, etc. In turn this would make the stackdriver trace console (see below) automagically pick-up related log lines without me having to manually tag them.

screen shot 2018-10-10 at 10 21 59

1 - https://docs.honeycomb.io/sdk/go/#building-and-sending-events

@codefromthecrypt
Copy link

codefromthecrypt commented Oct 11, 2018 via email

@nfisher
Copy link
Author

nfisher commented Oct 11, 2018

Thanks @adriancole!

Using a "printer" implementation (similar to the trace console printer) I would see it as a structured log interface that could be shipped to the ELK Stack or similar systems.

Essentially a log line and event are more or less synonymous. I guess I kind of look to OpenCensus as being a library for "observability" and events/logging is the one thing that's absent. I could see getting the root span ID in OpenZipkin/Jaegar and then using it to search for related "events" in ELK.

Feel free to close if it's out of scope.

@sebright
Copy link
Contributor

#130 is related.

@nfisher
Copy link
Author

nfisher commented Oct 16, 2018

Will close as #130 is related and I’ll look at adding anything under this that’s missing there.

@nfisher nfisher closed this as completed Oct 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants