Friday, November 30, 2018

To determine Vue current development mode

In main.js:

windows['VueMode'] = process.env.NODE_ENV;

Note: If you would like to use process.env.NODE_ENV in a sub component, put it inside one of the lifecycle hooks. For example, created, or mounted.

Friday, November 16, 2018

mtail - extract whitebox monitoring data from application logs for collection in a timeseries database

mtail - extract whitebox monitoring data from application logs for collection in a timeseries database

$ curl -L https://github.com/google/mtail/releases/download/v3.0.0-rc16/mtail_v3.0.0-rc16_linux_amd64 -o mtail

$ vim linecounter.mtail

# simple line counter
counter line_count
/$/ {
  line_count++
}

$ mtail --progs linecounter.mtail --logs debug.log

$ echo hi1 >> debug.log
$ echo hi2 >> debug.log

$ curl http://localhost:3903/metrics

Reference:

https://groob.io/posts/prometheus-intro/

https://github.com/google/mtail