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

nrWriter: an io.Writer that implements logs in context #548

Merged
merged 8 commits into from Sep 15, 2022

Conversation

iamemilio
Copy link
Contributor

@iamemilio iamemilio commented Aug 5, 2022

Packaging for supporting capturing log data from any framework that writes using the io.Writer interface for:

  • zerolog
  • log

@iamemilio iamemilio marked this pull request as ready for review August 5, 2022 16:24
nr-swilloughby
nr-swilloughby previously approved these changes Aug 5, 2022
@iamemilio
Copy link
Contributor Author

Let's hold this until after recharge. I would like to think about how this could incorporate metrics and maybe auto ingestion too.

@iamemilio iamemilio changed the title Log Writer: an io.Writer that automatically enriches your logs Nr Writer library and Zerolog Package Aug 30, 2022
@iamemilio
Copy link
Contributor Author

This has been updated as a one stop shop solution. All you need is the zerologWriter package to capture log metrics, events, and to decorate local logs.

@iamemilio iamemilio changed the title Nr Writer library and Zerolog Package nrWriter: an io.Writer that implements logs in context Aug 31, 2022
@iamemilio
Copy link
Contributor Author

Requires #562 to be merged after to enable testing. May require additional modification of go mod files for frameworks. Do not merge this to master until #562 is also merged.

nr-swilloughby
nr-swilloughby previously approved these changes Sep 9, 2022
NrWriter is a generic library for gathering log data from frameworks
that do not allow us to get their internal data. This release kicks off
with support for zerolog.
@iamemilio iamemilio merged commit dd07840 into newrelic:develop Sep 15, 2022
@iamemilio iamemilio deleted the ioEnricher branch September 15, 2022 18:07
"io"
"strings"

"github.com/newrelic/go-agent/v3/internal/logcontext/nrwriter"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fact that logcontext-v2 was made it's own module means the internal from newrelic/v3 can't be imported ..

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I had gone from the initial error I got from failing imports.

There is a missing import for "github.com/newrelic/go-agent/v3/internal", and the capitalization is mismatched for "github.com/newrelic/go-agent/v3/internal/logcontext/nrwriter" which prevents it from being found.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Meroje the problem is actually that we created a submodule in internal :(. Looks like we will have to hotfix this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure that most of the stuff in internal is not package correctly to be protected from external imports haha. We will have a fix for this immediately :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reporting! Please use the 3.19.1 hot fix release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants