Skip to content

Logger does not use process_host.display_name when setting hostname in the logs #1696

Open
@flivni

Description

The logger does not use process_host.display_name when setting hostname in the logs. Instead it uses Socket.gethostname via a call to NewRelic::Agent::Hostname.get.

I believe it is a bug. (In another issue, a New Relic developer assumes the feature already acts this way when she says "Alternatively, we have the ability to set the app name (entity.name in the default attributes) and hostname by configuration in either the newrelic.yml file or by environment variable"). #1141

You can see the offending code here:

add_key_value(message, HOSTNAME_KEY, Hostname.get)

I think the fix is to just replace with:
Agent.config[:'process_host.display_name']

I can create a PR if that would be helpful.

Thanks!

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions