span is not sent to APM server
See original GitHub issueI see SPAN data with NodeJs agent 1.14.5 but 2.6.0 is failing to capture same JS code stays same only APM agent version is changing
debug output from 1.14.5 version:
init span { id: 'c5231c49-ad8d-4c08-8c54-e35704096dc1' }
intercepted call to http.request { id: 'c5231c49-ad8d-4c08-8c54-e35704096dc1' }
request details: { protocol: 'https:',
host: 'iapi.xyz.com',
id: 'c5231c49-ad8d-4c08-8c54-e35704096dc1' }
start span { id: 'c5231c49-ad8d-4c08-8c54-e35704096dc1',
name: 'GET iapi.xyz.com/xyz/xyz/../up',
type: 'ext.http.http' }
intercepted http.ClientRequest response event { id: 'c5231c49-ad8d-4c08-8c54-e35704096dc1' }
setting transaction result { id: 'c5231c49-ad8d-4c08-8c54-e35704096dc1',
result: 'HTTP 2xx' }
setting default transaction name: GET /up { id: 'c5231c49-ad8d-4c08-8c54-e35704096dc1' }
ended span { id: 'c5231c49-ad8d-4c08-8c54-e35704096dc1',
name: 'GET iapi.xyz.com/xyz/xyz/../up',
type: 'ext.http.http',
truncated: true }
adding transaction to queue { id: 'c5231c49-ad8d-4c08-8c54-e35704096dc1' }
setting timer to flush queue: 4860ms
ended transaction { id: 'c5231c49-ad8d-4c08-8c54-e35704096dc1',
type: 'request',
result: 'HTTP 2xx',
name: 'GET /up' }
flushing queue
sending transactions payload
debug from 2.6.0 version:
intercepted request event call to http.Server.prototype.emit
start trace { trans: '54768b21709fe11d',
parent: undefined,
trace: 'bc3d74b2436610ae1574d7604a0d4c68',
name: null,
type: null }
start span { span: '26737ff7e8c227eb',
parent: '54768b21709fe11d',
trace: 'bc3d74b2436610ae1574d7604a0d4c68',
name: null,
type: 'ext.http.http' }
intercepted call to http.request { id: '54768b21709fe11d' }
request details: { protocol: 'https:',
host: 'iapi.xyz.com',
id: '54768b21709fe11d' }
intercepted http.ClientRequest response event { id: '54768b21709fe11d' }
setting transaction result { trans: '54768b21709fe11d',
parent: undefined,
trace: 'bc3d74b2436610ae1574d7604a0d4c68',
result: 'HTTP 2xx' }
setting default transaction name: GET /up { trans: '54768b21709fe11d',
parent: undefined,
trace: 'bc3d74b2436610ae1574d7604a0d4c68' }
sending transaction { trans: '54768b21709fe11d',
trace: 'bc3d74b2436610ae1574d7604a0d4c68' }
ended transaction { trans: '54768b21709fe11d',
parent: undefined,
trace: 'bc3d74b2436610ae1574d7604a0d4c68',
type: 'request',
result: 'HTTP 2xx',
name: 'GET /up' }
I’m happy to share more details just tell me what would help here.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Spans | APM User Guide [8.5] - Elastic
Missing spansedit Agents stream spans to the APM Server separately from their transactions. Because of this, unforeseen errors may cause spans to go...
Read more >Span (co.elastic.apm:apm-agent-api 1.4.0 API) - javadoc.io
A span contains information about a specific code path, executed as part of a Transaction . If for example a database query happens...
Read more >Elastic APM Java - Transactions & Spans are recorded but not ...
It appears to me, even though the transactions are being captured successfully, those are not reported(sent) to the APM Server.
Read more >apm - Go Packages
If there is no transaction or span in the context, then the returned ... Send enqueues the error for sending to the Elastic...
Read more >elastic-apm-http-client - npm
Data sent to the APM Server as part of the metadata object: ... It's not recommended to set a serverTimeout lower than the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Turns out that up until Node.js v7, the
IncomingMessage
object would emitaborted
if the underlying socket was closedI just used event-debug to see what was going on on both the request, response and the underlying socket. Here’s the result:
As can be seen here the response (
IncomingMessage
) never emits anything else thanreadable
. We currently expect it to emitend
at some point. I think that’s a mistake. But I wonder why it’s not emitting anything else when the underlying socket closes. I would have expected it to emitclose
in that case.