apm-agent-nodejs
apm-agent-nodejs copied to clipboard
filter exceptions configuration
Is your feature request related to a problem? Please describe. filter exceptions configuration like in the Ruby agent: https://www.elastic.co/guide/en/apm/agent/ruby/master/configuration.html#config-filter-exception-types
Describe the solution you'd like Add the feature to the node agent
Describe alternatives you've considered Debugged apm node agent and did not find any alternatives. Some routing errors in express are still send to the APM even we have express middleware to catch it. For example:
URIError: Failed to decode param '//..%c0%af../..%c0%af../..%c0%af../..%c0%af../..%c0%af../..%c0%af../etc/shadow.jsp'
Additional context Add any other context or screenshots about the feature request here.
The Python agent has this too, FWIW: https://www.elastic.co/guide/en/apm/agent/python/current/configuration.html#config-filter-exception-types
@kurigashvili-godaddy I wonder if in Ruby-land there is a much stronger practice of having a separate Error subclass for different types of errors. In Node-land, at least in my experience, many libs just use the base Error
class without subclassing. I suspect the utility would be somewhat less in Node-land. However, it would be straightforward to implement comparing err.name
to a configured array of names to filter out. (Getting into checking err.message
against patterns would be slower.)
Would having:
var apm = require('elastic-apm-node').start({
// ...
filterExceptionTypes: ['URIError']
})
satisfy your use case?
The Python agent has this too, FWIW: https://www.elastic.co/guide/en/apm/agent/python/current/configuration.html#config-filter-exception-types
@kurigashvili-godaddy I wonder if in Ruby-land there is a much stronger practice of having a separate Error subclass for different types of errors. In Node-land, at least in my experience, many libs just use the base
Error
class without subclassing. I suspect the utility would be somewhat less in Node-land. However, it would be straightforward to implement comparingerr.name
to a configured array of names to filter out. (Getting into checkingerr.message
against patterns would be slower.)Would having:
var apm = require('elastic-apm-node').start({ // ... filterExceptionTypes: ['URIError'] })
satisfy your use case?
@trentm yes. it would satisfy our use case. thank you.