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 service_name from Log Group and hostname from Log Stream #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jnoss
Copy link

@jnoss jnoss commented Aug 13, 2021

This PR uses the name of the CloudWatch Log Group and Log Stream to set the Service Name and hostname attributes in New Relic Logs. This is useful for applications that do not set those in their own logs.

Details:

  • New Relic Logs attribute service_name will be set to the CloudWatch Log Group (trailing portion / delimited), and
  • New Relic Logs attribute hostname will be set to the trailing portion of the CloudWatch Log Stream (/ or ] delimited, the ECS task ID for ECS logs or identifier for an instance of a Lambda).

Without this change, both of those fields are N/A in New Relic Logs if the application is not setting them in the log message.

This sets the New Relic Logs attribute `service_name` to the CloudWatch
Log Group (trailing portion `/` delimited), and sets the attribute
`hostname` to the trailing portion of the CloudWatch Log Stream (`/` or
`]` delimited, the ECS task ID for ECS logs or identifier for an
instance of a Lambda).  Without this change, both of those fields are
N/A in New Relic Logs if the application is not setting them in the log
message.
@mrickard
Copy link
Member

Thank you again, @jnoss ! And apologies for the delay in getting to this PR. At this point, I'd be happy to accept this once you've rebased against the current master branch.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@umaannamalai
Copy link

Hi @jnoss! Would you be able to sign the CLA for this? If you could do so, then we should be able to merge this after the branch has been rebased.
Thanks for opening this PR!

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