This is an attempt to create infrastructure that will allow us to easily visualize and analyze test metrics, log files, etc using the ELK stack.
The solution at the moment is elasticsearch with kibana running on a single Ubuntu node for data storage and visualization.
The data feed can come from a logstash instance or by implementing data push plugins in our CI infrastructure.
You can use it via the provided Vagrantfile
as an example, simply run vagrant up elk-stack
:
The local0 log facility (for both the elk-stack and the log-client VM) is configured to forward all syslog messages via tcp, e.g.:
vagrant ssh elk-stack
(or, if you want to test it from a remote VM use vagrant ssh log-client
)logger -p local0.info 'here goes my message!'
You need ChefDK, Vagrant and either VMWare Workstation + Vagrant VMWare plugin or just VirtualBox.
First, you need to install the required gems:
$ bundle install
...
Next, you can look at the predefined Rake tasks:
$ rake -T
rake chefspec # run chefspec examples
rake foodcritic # run foodcritic lint checks
rake integration # run test-kitchen integration tests
rake rubocop # check Ruby code style with rubocop
rake unit # run all unit-level tests
Now create a new branch, make your changes, add test, send us a pull request...
We use the "standard" set of chef testing frameworks:
For example, you can run rake test
to run all the unit level spec tests and linting checks.
$ rake test
...
Or you run rake integration
to run all the test-kitchen integration tests.
$ rake integration
...
This vm comes preconfigured with a logstash config for feeding elasticsearch with the logfiles of this vm.
Adjust these accordingly.
Have a look at cookbooks/vm/templates/default/logstash/ .