You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constexpress=require('express');constapp=express();functionErrorGenerator(a,b){if(b===0){thrownewError('Division by zero error');}returna/b;}app.get('/',(req,res)=>{constresult=ErrorGenerator(10,0);console.log('Result:',result);res.send("Here is results of highest computed maths");});app.use((err,req,res,next)=>{console.error('An error occurred:',err.message);res.status(400).send('Bad Request: '+err.message);next(err);});constport=6002;app.listen(port,()=>{console.log(`Server is running on port ${port}`);});
What did you expect to see?
On hitting the endpoint get a span with exception in event array. Somewhat similar to this:
{traceId: '7d57f374b49081a2c46aee1b9334d1c7',parentId: undefined,traceState: undefined,name: 'GET',id: 'dfdebec418911ea9',kind: 2,timestamp: 1714033150562000,duration: 3011281.152,attributes: {'http.url': 'http://169.254.169.254/computeMetadata/v1/instance','http.method': 'GET','http.target': '/computeMetadata/v1/instance','net.peer.name': '169.254.169.254','http.host': '169.254.169.254:80','http.error_name': 'Error','http.error_message': 'socket hang up'},status: {code: 2,message: 'socket hang up'},events: [{name: 'exception',attributes: {'exception.type': 'ECONNRESET','exception.message': 'socket hang up','exception.stacktrace': 'Error: socket hang up\n'+' at Socket.socketCloseListener (node:_http_client:473:25)\n'+' at Socket.emit (node:events:530:35)\n'+' at TCP.<anonymous> (node:net:337:12)\n'+' at TCP.callbackTrampoline (node:internal/async_hooks:130:17)'},time: [1714033153,573273845],droppedAttributesCount: 0}],links: []}
What version of OpenTelemetry are you using?
"@opentelemetry/api": "1.8.0"
"@opentelemetry/auto-instrumentations-node": "0.44.0"
What version of Node are you using?
v20.12.2
What did you do?
Ran a simple express app which raises exception.
What did you expect to see?
On hitting the endpoint get a span with exception in event array. Somewhat similar to this:
What did you see instead?
The text was updated successfully, but these errors were encountered: