Skip to content
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

Logs-in-context: add support for Zerolog #178

Closed
jodeev opened this issue Jul 13, 2020 · 2 comments · Fixed by #507, #531 or newrelic/docs-website#8258
Closed

Logs-in-context: add support for Zerolog #178

jodeev opened this issue Jul 13, 2020 · 2 comments · Fixed by #507, #531 or newrelic/docs-website#8258

Comments

@jodeev
Copy link
Contributor

jodeev commented Jul 13, 2020

There is one New Relic Go Agent logs-in-context enricher available today, for Logrus. We have requests to create an enricher for Zerolog.

Assumptions

  • Not all users will subscribe to NR logging or logs-in-context (so the solution must not impact users who do not want these features)
  • There is a separate solution that forwards logs on to New Relic

Acceptance Criteria

  • Go agent customers with Zerolog have a tool to get decorated logs that is similar to our existing Logrus tool - similar installation, similar configuration, same capabilities

  • The tool uses our trace and entity metadatata APIs to decorate the log files

  • Decorated log file has all trace and entity metadata that are associated with an event, added in line with the event in the logs

  • Decorated log file is in json format

  • logs can be forwarded to NRDB using the NR logs solution offering (same as with our Logrus tool)

  • the metadata in the log file must be sufficient to support the desired behavior for logs-in-context use cases:

    • User can access the correct log file associated with their application entity
    • User can access logs at the relevant log line location from NR UI from distributed trace view, from errors view
    • User can search logs using a trace_id, span_id, and a unique identifier for errors
@belimawr
Copy link

Hi @jodeev, we've been using NewRelic at OneFootball and or logging library is zerolog, yesterday I worked on a rough implementation of logs-in-context for zerolog, I tested it an it seems to work well enough.

I can share the code later on today.

@belimawr
Copy link

I decided to add my example as a PR: #294

I've already tested it with a demo application and it worked pretty well.

@ak-war ak-war added the logging label Feb 15, 2022
This was referenced Apr 20, 2022
@iamemilio iamemilio linked a pull request May 27, 2022 that will close this issue
@iamemilio iamemilio linked a pull request Jun 2, 2022 that will close this issue
@iamemilio iamemilio removed a link to a pull request Jun 2, 2022
This was referenced Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants