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

Create add_custom_log_attributes API #2069

Closed
wants to merge 35 commits into from

Conversation

kaylareopelle
Copy link
Contributor

@kaylareopelle kaylareopelle commented Jun 13, 2023

See #2084 instead (git mistakes made on this PR)

The NewRelic::Agent.add_custom_log_attributes API allows users to add attributes to all log events for a given agent run. It accepts key/value pairs as arguments.

This API abides by log API documentation on limits, and event data:

  • No more than 255 attributes can be added (limited to 240 for the agent at this time)
  • Keys must have less than 64 characters
  • Values must have less than 4094 characters
  • Key/value pairs with empty content will be dropped
  • Values longer than 4094 characters that aren't Strings/Symbols will be dropped

These attributes will be sent to the logs API in the "common"["attributes"] JSON block.

Relates to: #1141

@kaylareopelle kaylareopelle force-pushed the custom-attributes-in-log-events branch 2 times, most recently from a0b4f96 to 2bee8fc Compare June 13, 2023 20:39
lib/new_relic/agent.rb Outdated Show resolved Hide resolved
@kaylareopelle kaylareopelle force-pushed the custom-attributes-in-log-events branch 3 times, most recently from 957dc60 to 5343b42 Compare June 14, 2023 20:11
@kaylareopelle kaylareopelle marked this pull request as ready for review June 14, 2023 20:31
CHANGELOG.md Outdated Show resolved Hide resolved
lib/new_relic/agent.rb Show resolved Hide resolved
lib/new_relic/agent.rb Show resolved Hide resolved
lib/new_relic/agent.rb Show resolved Hide resolved
lib/new_relic/agent/log_event_attributes.rb Outdated Show resolved Hide resolved
fallwith
fallwith previously approved these changes Jun 15, 2023
@kaylareopelle
Copy link
Contributor Author

kaylareopelle commented Jun 15, 2023 via email

@fallwith
Copy link
Contributor

If you’re up for it, I’d like to meet synchronously tomorrow to talk this through.

Sure thing.

@github-actions
Copy link
Contributor

SimpleCov Report

Coverage Threshold
Line 94.11% 94%
Branch 85.67% 85%

kaylareopelle and others added 9 commits June 16, 2023 09:19
This API allows users to add attributes to all log events
for a given agent run. It accepts a single argument, a hash
with key value pairs for the attributes.

No more than 240 attributes can be added
Keys must have less than 64 characters
Values must have less than 4094 characters

These attributes will be sent to the logs API in the
"common"["attributes"] JSON block.
This was called already_warned_custom_attribute_count_limit.
It is now called custom_attribute_limit_reached.
Co-authored-by: James Bunch <[email protected]>
@kaylareopelle kaylareopelle force-pushed the custom-attributes-in-log-events branch from ceffdc1 to a7ed284 Compare June 16, 2023 16:20
@kaylareopelle
Copy link
Contributor Author

See #2084 instead (git mistakes made on this PR)

@kaylareopelle kaylareopelle deleted the custom-attributes-in-log-events branch June 16, 2023 17:25
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.

4 participants