Replies: 12 comments
-
Could you share the doc link for the newrelic agent you tried? |
Beta Was this translation helpful? Give feedback.
-
I have followed https://newrelic.com/blog/how-to-relic/nextjs-monitor-application-data documentation. I have modified run.sh file to |
Beta Was this translation helpful? Give feedback.
-
I don't have New Relic account to experiment. Could you try New Relic Lambda Extension? |
Beta Was this translation helpful? Give feedback.
-
sure i will try this |
Beta Was this translation helpful? Give feedback.
-
@bnusunny i have tried this approach this is not working |
Beta Was this translation helpful? Give feedback.
-
Did you see any error messages? |
Beta Was this translation helpful? Give feedback.
-
im not getting error messages and its giving response but in newrelic platform data is not there |
Beta Was this translation helpful? Give feedback.
-
@bnusunny we are trying to do something similar with a python+fastapi streaming application. we are using the NewRelic lambda layer along with the lambda web adapter layer. When using the bootstrap function as directed in the lambda web adapter docs, we encounter the following error:
The NR lambda layer wraps the user defined handler and expects to be executed as a python file. I have experimented with providing a custom bootstrap file to trigger the NR lambda wrapper function as a python function. something like
but this leads to a different error
i've unsuccessfully experimented with a handful of different formulations of how to call the handler, along with trying to find the handler function in the lambda runtime environment to explicitly call it out, updating the pythonpath/path, etc. The other potential issue here is that the NR lambda wrapper is going to expect a python function as the user defined handler, not a bash script. I suppose we may be able to get around this by starting up our uvicorn server in a python file? do you have any familiarity with how the lambda web adapter layer interacts with other layers that wrap code at runtime, and the best path to connect them? |
Beta Was this translation helpful? Give feedback.
-
This might be a wrong direction. With LWA, the web app is a stand-alone process, like a normal web application. We should try to use the normal instrument approach for web apps. |
Beta Was this translation helpful? Give feedback.
-
I have tried below solution and it worked in newrelic without installing any new layer |
Beta Was this translation helpful? Give feedback.
-
@bnusunny got it - thanks! I've tried using the NR approach for a FastAPI server (described here), without success. The NR docs suggest starting up the server with the NR admin utility as
I've adapted this in our run.sh file, with some of the formatting suggested in the web-adapter docs
this results in a few strange logs
Not sure why we're seeing both error and success logs there. Does the file path from the log ( |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Team,
I want to know how to use newrelic agent in nextjs app in lambda using this layer. Can you provide the guide here as i have tried many ways but newrelic agent is not sending data to newrelic
Beta Was this translation helpful? Give feedback.
All reactions