README.md in ndr_stats-0.2.1 vs README.md in ndr_stats-0.2.2

- old
+ new

@@ -1,6 +1,6 @@ -# NdrStats [![Build Status](https://travis-ci.org/PublicHealthEngland/ndr_stats.svg?branch=master)](https://travis-ci.org/PublicHealthEngland/ndr_stats) +# NdrStats [![Build Status](https://github.com/NHSDigital/ndr_stats/workflows/Test/badge.svg)](https://github.com/NHSDigital/ndr_stats/actions?query=workflow%3Atest) [![Gem Version](https://badge.fury.io/rb/ndr_stats.svg)](https://badge.fury.io/rb/ndr_stats) Provides pain-free setup of stats collecting to Ruby/Rails projects. ## Assumed Architecture @@ -30,19 +30,31 @@ NdrStats.configure(host: 'localhost', port: 9125) ``` ### Rails -When used in a Rails application, you can store configuration in `config/stats.yml`. +When used in a Rails application, you have the option to auto-configure `NdrStats`. +#### File-based + +Add configuration in `config/stats.yml`: + ```yaml --- host: localhost port: 9125 ``` +#### Environment config + +Alternatively, you can use environment variables `NDR_STATS_{HOST,PORT,SYSTEM,STACK}` to provide config parameters. +Environment variables override any file-based configuration that's also found. + +#### System / Stack + It's additionally possible to specify `system` and `stack`, which will be automatically added as tags on all stats. If the host application's enclosing module responds to the `flavour` or `stack` methods, these will be used if not otherwise specified. + ## Usage Basic usage is as follows: