@erickwendel/ew-agent

1.0.6 • Public • Published

APM Agent

This module is an instrumentation program example responsible for add a custom APM HTTP Header for all your requests and measure performance using Performance Hooks.

Getting started

  1. Install node. The agent runs on v10 and higher. Development work on this module is done with the latest stable release of Node.
  2. Add require('@erickwendel/ew-agent').start() as the first line of the app's main module

Examples

require('@erickwendel/ew-agent').start()
const http = require('http');

function handleRequest(request, response) {
   response.end('Hello, world!');
}

const server = http.createServer(handleRequest);

server.listen(8888);
curl -I http://localhost:8888/
HTTP/1.1 200 OK
X-Instrumented-By: ErickWendel
X-request-id: 1fdf1c84-aa84-4e6f-bbf4-c608f4c6bf23
Date: Tue, 14 Jul 2020 20:43:04 GMT
Connection: keep-alive
Content-Length: 13

Testing

npm test

Readme

Keywords

Package Sidebar

Install

npm i @erickwendel/ew-agent

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

4.14 kB

Total Files

6

Last publish

Collaborators

  • erickwendel