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

Set custom log attributes using newrelic.yml or environment variables #2087

Merged
merged 5 commits into from
Jun 20, 2023

Conversation

kaylareopelle
Copy link
Contributor

Overview

Adds the ability to set custom log attributes using the configuration option application_logging.forwarding.custom_attributes. When submitted using newrelic.yml, the value must be a hash. When submitted using an environment variable, the format must be "key1=value1,key2=value2".

Attributes will be added to all log events.

Relates to: #1141

This method transforms strings with the format "key1=value1,key2=value2"
into hashes: {'key1' => 'value1', 'key2' => 'value2'}

Thanks to [@rajpawar02](https://github.com/rajpawar02) for raising this issue and [@askreet](https://github.com/askreet) for helping us with the solution. [Issue#1141](https://github.com/newrelic/newrelic-ruby-agent/issues/1141), [PR#2084](https://github.com/newrelic/newrelic-ruby-agent/pull/2084)

- **Feature: Instrument transmit_subscription_* Action Cable actions**
- **Feature: Instrument transmit_subscription-related Action Cable actions**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting for this one appeared strangely due to the * in the title.

@kaylareopelle kaylareopelle marked this pull request as ready for review June 16, 2023 21:46
@github-actions
Copy link

SimpleCov Report

Coverage Threshold
Line 94.18% 94%
Branch 85.72% 85%

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: James Bunch <[email protected]>
fallwith
fallwith previously approved these changes Jun 16, 2023
CHANGELOG.md Outdated Show resolved Hide resolved
@kaylareopelle kaylareopelle merged commit 1fca78c into dev Jun 20, 2023
25 checks passed
@kaylareopelle kaylareopelle deleted the set_log_attributes_via_config branch June 20, 2023 19:14
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

Successfully merging this pull request may close these issues.

2 participants