Novo recurso
Adicionada a filtragem de atributo de agente por meio de regras de inclusão e exclusão.
Os atributos do agente agora podem ser controlados usando regras refinadas de inclusão e exclusão. Essas regras, descritas abaixo, substituem
capture_paramseignored_params. Quaisquer atributos listados emignored_paramsserão migrados paraattributes.excludeinternamente, a menos queattributes.excludeseja definido explicitamente.Três novas propriedades de configuração foram adicionadas à configuração raiz e a cada destino (mais sobre destinos adiante). Essas novas configurações são:
attributes.enabled- Permite a coleta de atributos para o destino.attributes.include- Uma lista de atributos ou regras de curinga para incluir.attributes.exclude- Uma lista de atributos ou regras de curinga para excluir.
As regras de inclusão e exclusão podem ser regras exatas (por exemplo,
request.headers.contentLength) ou regras curinga que correspondem apenas ao início das chaves de atributo (por exemplo,request.headers.*corresponderia a qualquer cabeçalho de requisição).Essas regras podem ser especificadas globalmente na raiz da configuração, ou para destinos específicos. Esses destinos são:
transaction_tracer- Controla os atributos de trace da transação.transaction_events- Controla atributos de evento de transação.error_collector- Controla os atributos de evento de erro.browser_monitoring- Controla atributos de transação de navegador/RUM.
addCustomParameterrenomeado paraaddCustomAttribute.O método
addCustomParameteragora está descontinuado e será removido em uma versão futura do agente. O métodoaddCustomAttributeé um substituto direto para ele.Adicionado cache à filtragem de atributo do agente.
Para minimizar a sobrecarga de aplicação de regras de atributo, o agente armazena em cache os resultados da filtragem de chaves de atributo e destinos específicos. O cache é limitado a 1.000 pares de destino-chave por padrão, mas pode ser configurado com
attributes.filter_cache_limit. Esse cache oferece uma melhoria de 10x na aplicação de regras de filtro para ocorrências no cache.Adicionado
allow_all_headersàs opções de configuração e atualizada a instrumentação dehttp.Quando definido como
true, o agente coletará todos os cabeçalhos de solicitação. Essa coleta respeita as regras de inclusão e exclusão de atributo do agente. Um conjunto padrão de regras de exclusão é fornecido emnewrelic.js. Essas regras excluem todos os cookies e cabeçalhos de autenticação.Os segmentos agora podem ser sinalizados como opacos, fazendo com que os segmentos internos sejam omitidos do trace da transação.
Melhorias
Foram adicionados limites para atributos de agente para manter a sobrecarga de monitoramento baixa.
As chaves e os valores de atributo são limitados a 255 bytes cada. Chaves que são maiores que 255 bytes são descartadas, e uma mensagem de aviso é registrada. Valores maiores que 255 bytes são truncados para 255 bytes, respeitando a codificação UTF-8 multibyte. Atributos personalizados estão limitados a 64 por transação. Atributos além do 64º são ignorados silenciosamente.
Erro adicionado à mensagem do log de falha de conexão do coletor.
Atributo
request_urirenomeado pararequest.uri.Isso alinha o nome do atributo com todos os outros atributos de solicitação.
Dependência
https-proxy-agentatualizada de^0.3.5para^0.3.6.Testes versionados atualizados, quando aplicável, para garantir que a maioria das versões menores dos módulos instrumentados funcione conforme o esperado.
Corrigido o teste travado para a linha v1 do driver do Mongo.
Adicionados testes para verificar se as transações 404 do Hapi resultam em métricas nomeadas corretamente.
A instrumentação do Hapi estava fazendo o correto, mas não havia testes para este caso específico.
Correções de bugs
O agente não travará mais quando
crypto.DEFAULT_ENCODINGfor alterado.Anteriormente, o agente assumia que o resultado de
hash.digest()era uma instância de um Buffer. Secrypto.DEFAULT_ENCODINGfor alterado,hash.digest()retornará uma string e o agente travaria. O agente agora garante que o valor seja uma instância de Buffer antes de prosseguir.Corrigido erro se
process.config.variables.node_prefixestiver ausente.Se
process.config.variables.node_prefixfor falso (o que pode acontecer ao usar o electron, levando a este problema https://support.newrelic.com/s/hubtopic/aAX8W0000008ZMO/new-relic-on-electron-nodejs) a funçãogetGlobalPackagesemlib/environment.jsdará um erro quando não deveria.Agradecemos a Jarred Filmer (@BrighTide) pela correção!
Improvements
- Added regression test for promise instrumentation and stack overflows.
Bug fixes
Fixed naming bug in Restify instrumentation regarding parameters to
next.The instrumentation previously considered any truthy value passed to
nextto be an error. It is possible to pass a string or boolean tonextin Restify to control further routing of the request. This would cause the middleware's mounting path to be erroneously appended to the transaction name.Fixed access to
bluebird.coroutine.addYieldHandler.This was accidentally not copied by our instrumentation making access to the function fail. This has been resolved and tests expanded to ensure no other properties were missed.
New features
Added
transaction_tracer.hide_internalsconfiguration.This configuration controls the enumerability of the internal properties of the agent. Making these properties non-enumerable can have an impact on the performance of the agent. Disabling this option may decrease agent overhead.
Improvements
Refactored promise instrumentation.
This new instrumentation is far more performant than the previous and maintains a more sensible trace structure under a wider range of sequences.
Added concurrent environment scanning, limited to 2 reads at a time.
This improves the performance of dependency scanning at agent startup, allowing the agent to connect to our services more quickly.
Refactored instrumentation tests to run against wide range of module versions.
Instrumentation tests will be run against all supported major versions of every instrumented module. For releases, we will test against every supported minor version of the modules. This vastly improves our test coverage and should reduce the instances of regressions for specific versions of modules.
Added tests for all of bluebird's promise methods.
These tests ensure that we 100% instrument bluebird. Some gaps in instrumentation were found and fixed. Anyone using bluebird should upgrade.
Bug fixes
Fixed a crashing error in the hapi instrumentation.
When recording the execution of an extension listening to a server event (for example, 'onPreStart') the agent would crash due to the lack of a
rawproperty on the first argument passed to the extension handler. The agent now checks the event before wrapping the extension handler and checks for the existence of therawproperty before attempting to dereference off of it.Fixed an incompatibility with the npm module
mimic-response.The agent's HTTP instrumentation previously did not play well with the way
mimic-responsecopied properties from anhttp.IncomingMessage. This caused modules that relied on that process, such asgot, to hang.Fixed naming rule testing tool to use same url scrubbing as the agent itself.
New features
Added hapi v17 instrumentation
Hapi v17 added support for promise-based middleware which broke transaction tracking in the agent. This caused issues in naming, as the agent will name the transaction after the path to the middleware that responded to a request.
Added instrumentation for
vision@5Due to the way
visionis mounted to the hapi server when using hapi v17.x, the agent's instrumentation would not pick up on the middleware being mounted. This new instrumentation now correctly times rendering done in thevisionmiddleware.Added
unwrapOncemethod to shim objectThis new method can be used to unwrap a single layer of instrumentation.
unwrapOnceis useful in cases where multiple instrumentations wrap the same method and unwrapping of the top level is required.Added
isErrorWarechecks aroundnameState.appendPath/nameState.popPathcalls to avoid doubling up paths in transaction namesPreviously, the agent would append its transaction name with the path fragment where an error handler middleware was mounted. The extraneous path fragment will now be omitted, and the transaction will be named properly after the middleware that threw the error.
Added support for
pg6 on Node 5 or higher
Improvements
- Added
parentproperty to webframework-shim segment description - Refactored existing hapi instrumentation for different
server.ext()invocations - Refactored webframework-shim
_recordMiddlewareto construct different segment descriptions for callback- or promise-based middleware - Updated
node-postgres@^6versioned tests to avoid deprecation warning on direct moduleconnectandendcalls - Fixed running domain tests on Node 9.3.0.
- Improved logging for CAT headers and transaction name-state management.
- All
json-safe-stringifycalls now wrapped intry/catch - Removed
lib/util/safe-json
Bug fixes
- Fixed creating supportability metric when mysql2 goes uninstrumented.
- Added a
segmentStack.popto the middlewareafterin cases when an error is caught and there is no next handler - Fixed determining parents for middleware segments when transaction state is lost and reinstated
- Added check to
_recordMiddlewareto avoid prepending a slash if originalrouteis an array - Changed logic in http instrumentation to attach
response.statusto the transaction as a string - Updated
startWebTransactionandstartBackgroundTransactionto add nested transactions as segments to parent transactions
Notes
- Added Peter Svetlichny to the contributors list!
Improvements
- Optimized
NameState#getPath. - Optimized
shim.record. - Optimized
shim.recordMiddleware. - Upgraded
eslintto v4.
Bug fixes
- Fixed parsing SQL for queries containing newlines.
Improvements
- Added promise benchmarks to test non-async_hooks instrumentation.
- Added logging for external calls made outside of a transaction.
- Added logging for when
unhandledRejectionis noticed. - Improved performance of creating and merging metrics.
- Improved performance of
tracer.bindFunction. - Removed try-catch around internal property setting on older versions of Node.
Bug fixes
- Moved
requirecalls for vendor metadata to module-level.
New features
Instrumentation will now only modify the arity of wrapped functions when needed.
This can be controlled with the
matchArityproperty on aWrapSpec. Disabling arity matching has a significant, positive impact on the performance of instrumentation.
Improvements
Added benchmarks for shimmer methods.
Pinned hapi tests at v16 due to incompatibility in hapi v17 with Node.js versions <8.
The agent's parsed queries will now only hold onto the stack that the query was made at, instead of an error object instance.
Previously, the parsed query objects would hold onto an error instance, which would in turn hold onto references to all the functions in the stack when the error was created. This could cause memory issues if the functions were holding onto references to other pieces of data.
Bug fixes
Revert wrapping of
httpsfor Node^8.9.1.The original cause for this problem was reverted by Node.
Improvements
- Added Node 9 to test suite.
- Removed problematic tests for ancient version of Hapi (7.1).
- Document purpose of
throwin tracer to prevent developer confusion. - Added script for running agent micro benchmarks.
- Added benchmarks for all the
ShimandTracermethods.
Bug fixes
- Fixed a bug with Node >=8.9 that prevented https externals from being recorded.
Improvements
- Agent will attempt to reconnect to the collector forever after backing off to 5 minute delays.
Bug fixes
- Refactored environment scan to improve startup time and fix cyclical symlink resolving.
New features
- The agent will now support the Node 8
awaitkeyword by default.
Improvements
- Added benchmark for performance of function wrapping.
- Added Garbage Collection information to async_hooks benchmark.
- Improved trace-level logging for capturing queries.
- Added cases for omitting the agent with and without async hooks to the async hooks microbenchmark.
Bug fixes
- Pinned version of Mocha to 3.x due to the incompatibility of Mocha v4 and Node v0.10 and v0.12.