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

Add dynamic custom attributes to Log #1275

Open
mbyrne00 opened this issue Dec 17, 2024 · 1 comment
Open

Add dynamic custom attributes to Log #1275

mbyrne00 opened this issue Dec 17, 2024 · 1 comment

Comments

@mbyrne00
Copy link

mbyrne00 commented Dec 17, 2024

Is your feature request related to a problem? Please describe.

I cannot add request-contextual data to my log entries.

Feature Description

I want to include per-request information to each log entry so that I do not have to rely explicitly on Transaction. As per the Same feature in the ruby agent something simple like newrelic.agent. add_custom_log_attributes() and newrelic.agent. add_custom_log_attribute() equivalents to the existing add_custom_attribute() and add_custom_attributes() functions for Transactions. Alternatively a setting to allow transaction custom attributes to propagate to logs.

I would like to set this in my FastAPI @app.middleware("http") function much like I have been doing for add_custom_attributes() and hoping they would appear in log entries.

The direct contextual information is available in Splunk on legacy apps and we would like to rely less on that.

Alternatives

Maybe the Ruby feature isn't supporting dynamic attributes after reading this back a bit. If the logging does not manage a lifecycle like transactions do then it would be great if there was a guide for how to dynamically add attributes to certain logs with python logging and the newrelic-admin run-program agent running in our Dockerfile. is there a way to omit json logging via our app and have the outer agent understand this? Is there any other hooks? Do we have to revert to forwarding all logs manually if that's not the case and is there a guide on how to do this beginning to end with custom attributes? Or is this why Transactions exist?

I figured there must be a way if there are various contextual logging context vars optionally flushed through.

Priority

Really want

I've searched, cloned this repo and reversed-engineered, but I'm pretty sure this feature does not exist. Very happy to be corrected if it does exist.

@workato-integration
Copy link

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

No branches or pull requests

1 participant