6.1.3 • Published 7 years ago

good-http v6.1.3

Weekly downloads
7,653
License
BSD-3-Clause
Repository
github
Last release
7 years ago

good-http

Http(s) broadcasting for Good process monitor

Build Status Current Version

Lead Maintainer: Adam Bretz

Usage

good-http is a write stream use to send event to remote endpoints in batches. It makes a "POST" request with a JSON payload to the supplied endpoint. It will make a final "POST" request to the endpoint to flush the rest of the data on "finish".

Good Http

GoodHttp (endpoint, config)

Creates a new GoodHttp object where:

  • endpoint - full path to remote server to transmit logs.
  • config - configuration object
    • [threshold] - number of events to hold before transmission. Defaults to 20. Set to 0 to have every event start transmission instantly. It is strongly suggested to have a set threshold to make data transmission more efficient.
    • [errorThreshold] - number of consecutive failed transmissions allowed (ECONNRESET, ECONNREFUSED, etc). Defaults to 0. Failed events will be included in the next transmission until they are successfully logged or the threshold is reached (whichever comes first) at which point they will be cleared. Set to null to ignore all errors and always clear events.
    • [wreck] - configuration object to pass into wreck. Defaults to { timeout: 60000, headers: {} }. content-type is always "application/json".

Schema

Each POST will match the following schema. The payload that is POSTed to the endpoint has the following schema:

{
  "host":"servername.home",
  "schema":"good-http",
  "timeStamp":1412710565121,
  "events":[
      {
        "event":"request",
        "timestamp":1413464014739,
        ...
      },
      {
        "event":"request",
        "timestamp":1414221317758,
        ...
      },
      {
        "event":"request",
        "timestamp":1415088216608,
        ...
      }
      {
        "event":"log",
        "timestamp":1415180913160,
        ...
      },
      {
        "event":"log",
        "timestamp":1422493874390,
        ...
      }
  ]
}
6.1.3

7 years ago

6.1.2

7 years ago

6.1.1

8 years ago

6.1.0

8 years ago

6.0.2

8 years ago

6.0.1

8 years ago

5.1.1

8 years ago

6.0.0

8 years ago

5.1.0

9 years ago

5.0.0

9 years ago

4.0.0

9 years ago

3.0.2

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.0.0

10 years ago

1.0.0

10 years ago

0.0.1

10 years ago