Hello
Is there anyway to add custom attributes to newrelic ruby apm and see there in Logs view ?
my working env
- rails 6.0
- newrelic_rpm gem 8.7
- ruby 2.7.2
- local OS Ubuntu
In view Logs
, we can add some predefined columns like message
and timestamp
.
I want to add pid (process id) in this view and use it as column but I don’t know how.
I tried the doc: Collect custom attributes | New Relic Documentation
class ApplicationController < ActionController::Base
before_action :set_new_relic
def set_new_relic
::NewRelic::Agent.add_custom_attributes(
{
pid: Process.pid,
test: "hello"
}
)
end
I restarted my app but impossible to add column pid
in Logs
view.
Thank you !