-
Notifications
You must be signed in to change notification settings - Fork 296
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
nrzap log in context ignores additional fields #768
Comments
Do we have any updates on this? Adding some fields to both logs in the example doesn't work for me either as intended:
Gives this in the console:
but in New Relic:
|
Yeah, we are aware of this. There is a roadmap item to add support for logs in context fields in the future, and a possible re-write of the zap libraries that will pair with it. The collection of fields as attributes is not supported in the agent yet. |
Thanks for the reply, is there a very rough estimation on when will this happen? Just to know if it's worth waiting or switching to the REST agent way. |
bumping this it is sad that such core functionality is missing and forces us to do parsing of logs on ui @iamemilio NewRelic go-agent only recently started supporting more than logrus and yet it fails to do it right. Despite that the only option remains to use the plugin coming from logcontext v1 with logrus cause it supports attribute capture. So why even bother implementing the new integration labraries if none of them support core must have functionality. This forces customers to parse unstructured log data using regexp and nrql to make anything useful with dashboards/alerts/insights and/or locks in with logrus which is in maintenance mode only. |
Hi all, thank you for your advocacy and your patience. I hear your concerns and have gotten the go ahead to prioritize this ASAP. Supporting attribute collection for all v2 logs in context packages is my top priority. I will communicate expectations and upcoming changes here and in #833. |
I am working on adding support for attribute collection to the agent now. Once I have that code settled and tested, I will prioritize Zap and then Slog for attribute collection support first. Zerolog's opacity will make attribute collection more difficult, so I'll save it for last. |
Entering the review phase for attribute collection support in the agent: #900. Building this into wrappers for logging frameworks and additional optimizations are on their way. This should make the next release. Feel free to leave feedback on this PR until then. Notes:
|
Description
I'm unsure if this is intended behaviour or not, but while debugging I noticed the nrzap logs in context integration does NOT do anything with zap fields...my initial expectation was that these would be added as custom attributes to the log entries.
The code here shows that the fields are just not used:
go-agent/v3/integrations/logcontext-v2/nrzap/nrzap.go
Line 28 in 046b4fc
Please let me know if this intended or if there's another way to add these fields as attributes!
Steps to Reproduce
go-agent/v3/integrations/logcontext-v2/nrzap/example/main.go
Line 35 in 046b4fc
txnLogger.Error("Some error!")
do
txnLogger.Error("Some error!", zap.Int("http.statusCode", http.StatusInternalServerError)
Expected Behavior
The log entry in New Relic would have a custom attributes, "http.statusCode" with the passed value.
I didn't include env info because I'm not sure it matters based on the code I linked to, but please let me know if any additional info is needed!
Thanks so much,
Nick
The text was updated successfully, but these errors were encountered: