I have a Nuxtjs application, and I start the apm using CMD node -r ./server/node_modules/elastic-apm-node/start.js ./server/index.mjs
.
I have configed the below environment variables.
ELASTIC_APM_ENVIRONMENT=myenv
ELASTIC_APM_SERVICE_NAME=myproject
ELASTIC_APM_SERVER_URL=http://my-apm-server
ELASTIC_APM_TRANSACTION_SAMPLE_RATE=1
ELASTIC_APM_CAPTURE_BODY=all
ELASTIC_APM_USE_ELASTIC_TRACEPARENT_HEADER=true
ELASTIC_APM_TRACE_CONTINUATION_STRATEGY=restart
ELASTIC_APM_LOG_LEVEL=trace
The Nuxtjs server is behind another X server, and when user visit X server, the server send http request to Nuxtjs server. However, I trigger this flow from X server and see request in Nuxtjs, and I cannot see any transaction of Nuxjs server. I have tried all 3 different values for ELASTIC_APM_TRACE_CONTINUATION_STRATEGY already.
What is the possible reasonable for this?
Kibana version: 8.12.2
Elasticsearch version: 8.12.2
APM Server version: 8.12.2
APM Agent language and version: elastic-apm-node 4.7.0
Original install method (e.g. download page, yum, deb, from source, etc.) and version: npm
Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
I cannot see any transaction, but I can see the metrics
Provide logs and/or server output (if relevant):
{"log.level":"warn","@timestamp":"2024-07-18T09:44:13.171Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","message":"unknown log levelName \"Trace\": cannot setLogLevel"}
{"log.level":"info","@timestamp":"2024-07-18T09:44:13.176Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","agentVersion":"4.7.0","env":{"pid":1,"proctitle":"node","os":"linux 5.15.133+","arch":"x64","host":"myproject-576bf9784f-42j4r","timezone":"UTC-0400","runtime":"Node.js v20.6.0"},"config":{"captureBody":{"source":"environment","value":"all","commonName":"capture_body"},"environment":{"source":"environment","value":"Staging"},"logLevel":{"source":"environment","value":"Trace","commonName":"log_level"},"serverUrl":{"source":"environment","value":"http://apm-server","commonName":"server_url"},"traceContinuationStrategy":{"source":"environment","value":"restart","commonName":"trace_continuation_strategy"},"transactionSampleRate":{"source":"environment","value":1,"commonName":"transaction_sample_rate","sourceValue":"1"},"useElasticTraceparentHeader":{"source":"environment","value":true,"sourceValue":"true"},"serviceName":{"source":"environment","value":"myproject","commonName":"service_name"},"serviceVersion":{"source":"default","value":"0.0.0","commonName":"service_version"}},"activationMethod":"preload","message":"Elastic APM Node.js Agent v4.7.0"} {"log.level":"trace","@timestamp":"2024-07-18T09:44:13.257Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","message":"corking (cloudMetadataFetcher)"}
{"log.level":"debug","@timestamp":"2024-07-18T09:44:13.260Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","message":"adding Node.js module loader hooks"}
{"log.level":"debug","@timestamp":"2024-07-18T09:44:13.260Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","message":"instrumenting fetch"}
{"log.level":"trace","@timestamp":"2024-07-18T09:44:13.454Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","message":"azure metadata server responded, but there was an error parsing the result: {}"}
{"log.level":"debug","@timestamp":"2024-07-18T09:44:13.554Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","message":"gcp metadata server responded, but there was an error parsing the result: {}"}
{"log.level":"trace","@timestamp":"2024-07-18T09:44:13.555Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","message":"aws metadata server responded, but there was an error parsing the result: {}"}
{"log.level":"debug","@timestamp":"2024-07-18T09:44:13.556Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","message":"no cloud metadata servers responded"}
{"log.level":"trace","@timestamp":"2024-07-18T09:44:13.556Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","message":"getCloudMetadata err: Error: no response from any callback, no cloud metadata will be set (normal outside of cloud env.)"}
{"log.level":"trace","@timestamp":"2024-07-18T09:44:13.557Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","_encodedMetadata":"{\"metadata\":{\"service\":{\"name\":\"myproject\",\"environment\":\"Staging\",\"runtime\":{\"name\":\"node\",\"version\":\"20.6.0\"},\"language\":{\"name\":\"javascript\"},\"agent\":{\"name\":\"nodejs\",\"version\":\"4.7.0\",\"activation_method\":\"preload\"},\"version\":\"0.0.0\"},\"process\":{\"pid\":1,\"ppid\":0,\"title\":\"node\",\"argv\":[\"/usr/local/bin/node\",\"/app/server/index.mjs\"]},\"system\":{\"architecture\":\"x64\",\"platform\":\"linux\",\"detected_hostname\":\"myproject-576bf9784f-42j4r\"}}}\n","message":"_resetEncodedMetadata"}
{"log.level":"trace","@timestamp":"2024-07-18T09:44:13.557Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","message":"uncorked (cloudMetadataFetcher)"}
{"log.level":"trace","@timestamp":"2024-07-18T09:44:13.558Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","_encodedMetadata":"{\"metadata\":{\"service\":{\"name\":\"myproject\",\"environment\":\"Staging\",\"runtime\":{\"name\":\"node\",\"version\":\"20.6.0\"},\"language\":{\"name\":\"javascript\"},\"agent\":{\"name\":\"nodejs\",\"version\":\"4.7.0\",\"activation_method\":\"preload\"},\"version\":\"0.0.0\"},\"process\":{\"pid\":1,\"ppid\":0,\"title\":\"node\",\"argv\":[\"/usr/local/bin/node\",\"/app/server/index.mjs\"]},\"system\":{\"architecture\":\"x64\",\"platform\":\"linux\",\"detected_hostname\":\"myproject-576bf9784f-42j4r\"}}}\n","message":"_resetEncodedMetadata"}
{"log.level":"debug","@timestamp":"2024-07-18T09:44:13.558Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","apmServerVersion":"8.10.3","message":"fetched APM Server version"}
{"log.level":"debug","@timestamp":"2024-07-18T09:44:13.560Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","remoteConf":{},"message":"central config received"}
{"log.level":"trace","@timestamp":"2024-07-18T09:44:13.660Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","reqId":"d7cc7cf1a38215e9b31a3b664c0eab02","message":"intake request start"}
{"log.level":"trace","@timestamp":"2024-07-18T09:44:13.661Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","fullTimeMs":5.45473,"numEvents":1,"numBytes":898,"message":"_write: encode object"}
{"log.level":"trace","@timestamp":"2024-07-18T09:44:13.662Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","reqId":"d7cc7cf1a38215e9b31a3b664c0eab02","message":"intakeReq \"socket\": unref it"}
Listening on http://[::]:5314
{"log.level":"debug","@timestamp":"2024-07-18T09:44:19.766Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","message":"no active transaction found - cannot build new span"}
...
{"log.level":"trace","@timestamp":"2024-07-18T09:47:23.290Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","reqId":"960d17340bffd882f71eb36987172bca","concluded":false,"message":"completePart intakeReq"}
{"log.level":"trace","@timestamp":"2024-07-18T09:47:23.295Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","reqId":"960d17340bffd882f71eb36987172bca","statusCode":202,"reqFinished":true,"message":"intakeReq \"response\""}
{"log.level":"trace","@timestamp":"2024-07-18T09:47:23.296Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","reqId":"960d17340bffd882f71eb36987172bca","message":"intakeRes \"end\""}
{"log.level":"trace","@timestamp":"2024-07-18T09:47:23.296Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","reqId":"960d17340bffd882f71eb36987172bca","concluded":false,"message":"completePart intakeRes"}
{"log.level":"trace","@timestamp":"2024-07-18T09:47:23.296Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","reqId":"960d17340bffd882f71eb36987172bca","timeline":[[10001.372483,"completePart gzipStream",null],[10001.704373,"completePart intakeReq",null],[10007.856263,"completePart intakeRes",null]],"bytesWritten":644,"backoffDelayMs":0,"message":"conclude intake request: success"}
{"log.level":"trace","@timestamp":"2024-07-18T09:47:43.289Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","reqId":"c8f5424184da22dfd24d2ae765732e2b","message":"intake request start"}
{"log.level":"trace","@timestamp":"2024-07-18T09:47:43.289Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","fullTimeMs":1.396559,"numEvents":1,"numBytes":925,"message":"_write: encode object"}
{"log.level":"trace","@timestamp":"2024-07-18T09:47:43.289Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","reqId":"c8f5424184da22dfd24d2ae765732e2b","message":"intakeReq \"socket\": unref it"}
{"log.level":"trace","@timestamp":"2024-07-18T09:47:43.682Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","event.module":"apmclient","message":"_pollConfig: no new central config since last poll"}
{"log.level":"debug","@timestamp":"2024-07-18T09:47:44.567Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","message":"no active transaction found - cannot build new span"}
[INFORMATION] 2024-07-18T09:47:44.653Z [23907d94-8e65-4149-a9e1-0cb1a181ca6e] - [access] 2024-07-18T09:47:44.653Z POST http localhost /api/public/getToggle - 200 89 ::1 [-] [-] [-]
{"log.level":"debug","@timestamp":"2024-07-18T09:47:44.664Z","log.logger":"elastic-apm-node","ecs.version":"8.10.0","message":"no active transaction found - cannot build new span"}