Docker Container stats routing.
Supported Repositories:
- Stdout
stdout(for testing) - MongoDB
mongodb(using https://github.com/go-mgo/mgo) - Prometheus
prometheus(as a scapre source, using https://github.com/prometheus/client_golang) - InfluxDB
influxdb(using https://github.com/influxdata/influxdb/tree/master/client) - RestAPI
rest
As a CLI, run the following on a console:
./statspout [-mode=<mode>] [-interval=<interval>] [-repository=<repository>] {options}
If no option is given, the program will run on the default Docker Socket, with an interval of 5 seconds and stdout as
repository (so you can quickly check what this tool does, without setting a DB or service).
mode: mode to create the client:socket,http. Defaultsocketinterval: seconds between each stat, in seconds. Minimum is 1 second. Default5.daemons: number of daemons to handle requests. Default10.repository: which repository to use (they're listed in the Supported Repositories list, in special font) each repository will bound different options. Defaultstdout.ignore: repository names to ignore, separated by comma. By default ignores nothing. Example:--ignore=nginx,kibana
socket.path: unix socket to connect to Docker. Default:/var/run/docker.sock
http.address: Docker API address. Default:localhost:4243
mongo.address: Address of the MongoDB Endpoint. Default:localhost:27017mongo.database: Database for the collection. Default:statspoutmongo.collection: Collection for the stats. Default:stats
prometheus.address: Address on which the Prometheus HTTP Server will publish metrics. Default::8080
influxdb.address: Address of the InfluxDB Endpoint. Default:http://localhost:8086influxdb.database: Database to store data. Default:statspout
rest.address: Address on which the Rest HTTP Server will publish data. Default::8080rest.path: Path on which data is served. Default:/stats
The container version is available at https://hub.docker.com/r/mijara/statspout/
For a quick test, run:
docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 8080:8080 mijara/statspout -repository=rest
Then go to http://IP:8080/stats
And watch JSON stats of your containers.
TODO!