'Newrelic rails logs

Is there anyway to add custom attributes to newrelic ruby apm and see there in Logs view ?

current tools:

  • rails 6.0
  • newrelic_rpm gem 8.7
  • ruby 2.7.2
  • local OS Ubuntu 20

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: https://docs.newrelic.com/docs/data-apis/custom-data/custom-events/collect-custom-attributes/#ruby-att

class ApplicationController < ActionController::Base

before_action :set_new_relic

def set_new_relic
  ::NewRelic::Agent.add_custom_attributes(
    {
      pid: Process.pid,
      test: "hello"
    }
)
end

Restarted my app but can't add column pid in Logs view.

Thank you for helping !



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source