aws-log-ingestion icon indicating copy to clipboard operation
aws-log-ingestion copied to clipboard

Tie logs to an APM?

Open jamesmehorter opened this issue 2 years ago • 2 comments

Hello,

Logs sent to NR via this lambda are not related to any specific APM. Is there a way for this lambda to set the appropriate entity.guid, entity.guids, and entity.name fields in the log JSON so that logs may be related/tied to a specific APM? (I believe these fields would accomplish that linking?)

(I understand using an infrastructure agent typically accomplishes this, though we have reasons for shipping logs separately)

jamesmehorter avatar Sep 25 '23 16:09 jamesmehorter

The New Relic PHP Agent team has just released https://github.com/newrelic/newrelic-php-agent/releases/tag/v10.13.0.2 which does allow us to decorate logs being forwarded by an external solution (e.g. from cloudwatch using this lambda) with the correct entity.* attributes which will link logs to the correct APM.

jamesmehorter avatar Oct 05 '23 14:10 jamesmehorter

This NR_TAGS env var seems it would also accomplish this linking, but would require one lambda running per application, e.g. as a sidecar container running along side the application container

  • https://github.com/newrelic/aws-log-ingestion/blob/master/src/function.py#L325
  • https://github.com/penske-media-corp/terraform/blob/main/new-relic/lambda/log-ingestion/main.tf#L7

jamesmehorter avatar Oct 05 '23 14:10 jamesmehorter