New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

elastic-apm-utils

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elastic-apm-utils

Utilities for Elastic APM

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
190
increased by111.11%
Maintainers
1
Weekly downloads
 
Created
Source

elastic-apm-utils

Utilities for Elastic APM

Installation

$ npm install elastic-apm-utils

API

APM

apmUtils.apm.filter({ keepRequest, keepResponse, keepSocket })

Filters request and response properties.

apmClient.addFilter(apmUtils.apm.filter({
    // list of request headers to keep, optional
    keepRequest: [ 'referer', 'user-agent' ], 

    // list of response headers to keep, optional
    keepResponse: [], 

    // list of socket properties to keep, optional
    keepSocket: [], 
}));

Express integration

apmUtils.express.middleware(apmClient, { setAddress, setOrigin })

Returns an express middleware.

server.use(apmUtils.express.middleware(apmCient, {
    // set remote IP address as a tag to allow filtering in Kibana
    setAddress: true,
    
    // set request origin / referrer hostname as a tag to allow filtering in Kibana
    setOrigin: true,
}));

Koa integration

apmUtils.koa.middleware(apmClient, { prefix, setAddress, setOrigin, setRouteName })

Returns a koa middleware.

router.use(apmUtils.koa.middleware(apmCient, {
    // a prefix for all transaction names, only used if setRouteName = true
    prefix: '',
    
    // set remote IP address as a tag to allow filtering in Kibana
    setAddress: true,
    
    // set request origin / referrer hostname as a tag to allow filtering in Kibana
    setOrigin: true,
    
    // more accurate route names when using koa-router
    setRouteName: true,
}));

License

Copyright (c) 2018 Martin Kolárik. Released under the MIT license.

FAQs

Package last updated on 10 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc