-
Notifications
You must be signed in to change notification settings - Fork 227
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
React.JS Next.JS SPDY No data in elastic apm for nodejs application #3413
Comments
@khteh Thanks for the question. The best way to try to confirm what is happening would be to get trace-level logging from the APM agent as it is running. This can be done by setting the Here are some guesses as to what the issue might be and questions to try to find the issue:
|
I am using Next
results in
This is how I start the application in the container:
|
Where to check the trace? I don't see anything in APM > Logs and there is nothing in the Traces tab. |
The trace/debug logs I was referring to are printed to stdout by the APM agent. They aren't automatically sent to APM server to be visible in the Kibana APM app. Given that you are running your app in Docker, then you should be able to see the logs by running
That error log from the APM agent shows that the |
This is all that I see in the log:
The |
Okay, so you are getting trace logs. Can you please send the full log output that covers a time period when your |
|
@khteh Thanks. The one line in there that is helpful is this one:
It shows that the APM agent instrumented some activity in your code that would have generated a span, but it didn't because there is no active "transaction". Typically a transaction is created automatically for an incoming HTTP request -- if your app implements an HTTP server. (More details on the types of transactions here: https://www.elastic.co/guide/en/apm/guide/current/data-model-transactions.html) Alternatively, to get tracing for activity in your app that isn't part of an HTTP request you can manually start transactions via the Are you able to give some details on your app? What does it do? What modules does your app use that you expect the APM agent to be generating tracing data for? |
I expect normal HTTP request tracing. This is my startup
How to get it to work? |
I cannot get server.js running. Here is my attempt:
Using this package.json:
and node v19.8.1. Can you share a small repository that reproduces the issue? Looking at spdy-http2/node-spdy#380 I wonder if the Also, if |
How to make it work without "automatically"? |
You would need to use the Agent API (e.g. |
You can start an Next.JS app with https://nextjs.org/learn/basics/create-nextjs-app and start the app with |
I added
but still don't see any data in kibana |
There was a delay. I see the data now. |
Describe the bug
I put the following code snippet at the top of the first file loaded
server.js
:However, there is no data at all in kibana 8.8.0. I have also tried putting this config in
elastic-apm-node.js
but to no avail.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Environment (please complete the following information)
How are you starting the agent? (please tick one of the boxes)
agent.start()
directly (e.g.require('elastic-apm-node').start(...)
)elastic-apm-node/start
from within the source code-r elastic-apm-node/start
Additional context
Agent config options:
Click to expand
package.json
dependencies:Click to expand
The text was updated successfully, but these errors were encountered: