Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/springerpe/mtail-boshrelease

https://github.com/google/mtail in bosh
https://github.com/springerpe/mtail-boshrelease

bosh bosh-addon bosh-release cloud-foundry

Last synced: 6 days ago
JSON representation

https://github.com/google/mtail in bosh

Awesome Lists containing this project

README

        

# mtail-boshrelease

PoC of mtail: https://github.com/google/mtail/

# Creating and using a release:

In order to test and create a "non final" (dev) release, run:

```
# Update or sync blobs
./update-blobs.sh
# Create a dev release
bosh create-release --force --tarball=/tmp/release.tgz
# Upload release to bosh director
bosh -e upload-release /tmp/release.tgz
```

For a final release, make sure you have GITHUB_TOKEN defined and `s3cmd`
command with the proper credentials (also populate `config/private.yml`
with the S3 key id and key.

You can deploy an empty vm with this example manifest to provide
a metric per log file with the number of lines (graphite is also
enabled here!):

```
name: mtail

releases:
- name: mtail
version: latest

instance_groups:
- name: mtail
instances: 1
vm_type: small
stemcell: default
vm_extensions: []
azs:
- z1
- z2
- z3
networks:
- name: default
jobs:
- name: mtail
release: mtail
properties:
mtail:
port: 3903
graphite: "localhost:5555"
progs:
- name: mtaillogs
log: "/var/vcap/sys/log/mtail/*.log"
config: |
counter filename_lines by filename
/$/ {
filename_lines[getfilename()]++
}

stemcells:
- alias: default
name: bosh-google-kvm-ubuntu-xenial-go_agent
version: latest

update:
canaries: 1
max_in_flight: 1
serial: false
canary_watch_time: 1000-60000
update_watch_time: 1000-60000
```

A more realistic purpose is to use this release to provide metrics from the gorouter
access logs by using a runtime-config:

```
releases:
- name: mtail
version: "0+dev.4"

addons:
- name: mtail
jobs:
- name: mtail
release: mtail
properties:
mtail:
progs:
- name: gorouter
log: "/var/vcap/sys/log/gorouter/access.log"
config: |
counter gorouter_http_requests_total
counter gorouter_http_requests by route, request_method, status_code
counter gorouter_http_requests_app by route, app_id
/^/ +
/(?P[0-9A-Za-z\.:-]+) / +
/- / +
/\[(?P\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}(\+|-)\d{4})\] / +
/"(?P[A-Z]+) (?P\S+) (?PHTTP\/[0-9\.]+)" / +
/(?P\d{3}) / +
/((?P\d+)|-) / +
/(?P\d+) / +
/"(?P\S+)" / +
/"(?P[[:print:]]+)" / +
/"(?P[[:print:]]+)" / +
/"(?P[[:print:]]+)" / +
/x_forwarded_for:"(?P[[:print:]]+)" / +
/x_forwarded_proto:"(?P[[:print:]]+)" / +
/vcap_request_id:"(?P[[:print:]]+)" / +
/response_time:(?P[0-9\.]+) / +
/app_id:"(?P[[:print:]]+)" / +
/app_index:"(?P\d+)" / +
/tls_client_protocol:"(?P[[:print:]]+)" / +
/tls_client_cipher:"(?P[[:print:]]+)" / +
/.*$/ {
# extra fields todo: zipkin headers
gorouter_http_requests_total++
gorouter_http_requests[$route][$request_method][$status_code]++
gorouter_http_requests_app[$route][$app_id]++
}

include:
deployments:
- cf
jobs:
- name: gorouter
release: cf
```

# Author

(c) Jose Riguera Lopez [email protected]

Springernature Engineering Enablement

MIT License