A good-reporter
for use with InfluxDB.
host
- The host, including protocol, port, and optional credentials, where InfluxDB is runningoptions
database
- The name of the database data will be written to. Defaults togood
.events
- Theevents
configuration property as supported bygood-reporter
.threshold
- The number of events to queue before flushing to the database. Defaults to 25.username
- The username for the InfluxDB user. This value is overridden by host credentials, if available. (Requirespassword
.)password
- The password for the InfluxDB user. This value is overridden by host credentials, if available. (Requiresusername
.)precision
- The precision specified for InfluxDB timestamp. Defaults toms
(milliseconds).n
- nanosecondsu
- microsecondsms
- milliseconds (default)s
- secondsm
- minutesh
- hours
time | id | method | status | duration | path | labels | host | pid |
---|
Each request is recorded as a point in the request
data series. The request series can then be broken down into sub-series via continuous queries. For example, to get requests per process per host you can run
select * from "request" into request.[host].[pid]
Once that query is complete, InfluxDB will dynamically create series for each new host
and pid
combination recorded.
time | url | method | message | stack | host | pid |
---|
Responses that result in 500 status code are logged as errors. Each error contains the error message and stacktrace, in addition to the url and HTTP method pertaiing to the failed request.
time | cpu1m | cpu5m | cpu15m | totalmem | freemem | uptime | host | pid |
---|
OS-level details are also recorded, including the columns above. NOTE: Currently there is no deduping of data, therefore if multiple processes are running on the same host, duplicate OS data will be recorded to Influx.
time | memory | rss | heapTotal | heapUsed | delay | uptime | host | pid |
---|
process-leve details, including the event loop delay, are recorded into a process
series.
time | data | tags | host | pid |
---|
Server logs, including tags are also recorded as points in the log
series.
When logging a custom event a series will be created using that event name. Additionally, custom events wil automatically get logged with time
, host
, and pid
columns. Additionally, any other fields/properties are logged as columns into InfluxDB. Some types are handled specially, however: primitives (string, boolean, number) are logged as-is, dates are converted to date strings, arrays are logged as comma-separated values, and objects are JSON stringified prior to logging.