Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Newrelic with Go on Lambda

golang
go-agent
lambda

#1

Hi, we can get Newrelic data showing on both local hosts, EC2 and containers.

On lambda, however, the app appears in the APM (even with a new app name), but no data is shown. We have tried the original new relic agent, nrgin (having to install gin framework for this) and also wrote a custom one. But nothing shows except the app name. The logger in cloudwatch shows the new relic agent being invoked with cryptic debug messages, but no data is being passed.

Before going back to the drawing board on the code side, can someone tell me if NR actually works on lambda with APM reporting?

Is there a permission or something that we are missing?

Example JSON being seeing with NRGIN

{  
   "level":"debug",
   "msg":"rpm failure",
   "context":{  
      "command":"preconnect",
      "error":"Post https://collector.newrelic.com/agent_listener/invoke_raw_method?license_key=fc00a5c8609eaXXXXXXXXXXXXXXX\u0026marshal_format=json\u0026method=preconnect\u0026protocol_version=16: dial tcp 50.31.164.146:443: i/o timeout",
      "url":"https://collector.newrelic.com/agent_listener/invoke_raw_method?license_key=fc00a5c8609ea9931235c30e902XXXXXXXXXXXX\u0026marshal_format=json\u0026method=preconnect\u0026protocol_version=16"
   }
}

PS, I have tried:

  1. starting the transaction in a http handler
  2. Starting it manually in the route
  3. Wrapping every SQL query in a segment
  4. Putting in custom segments
  5. doing things like err = mf.TXN.AddAttribute("ip", c.ClientIP())

– All work on localhost and putting it on EC2. Nothing on lambda.

Thanks


#2

Please hold fire on answering this issue - need to delete it if possible.

It is now working and showing in newrelic with all lambda points.

Not sure exactly why.


#3

Hey @kit1

Good to hear you got this working! Note that the nature of lambda is that it’s all short running scripts, whereas our agents are more for app servers that are long running. It may be better for you to send custom data as insights events. Rather than using an APM agent.