#Container Metrics Sample
##Overview We can use Dropsonde to send container metrics to metron which will emit them to Doppler; which is then polled by traffic controller. The endpoint on the traffic controller should report the latest container metric for each instance of the specified app.
main.go connects to the traffic controller and polls the container metrics endpoint.
container_metrics_emitter.go is a sample app that emits container metrics to metron using the dropsonde library.
##To see containter metrics:
cf api api.the-env cf login admin cf push some-app cf app some-app --guid
Copy out the guid value from the last bash line
Paste the guid into the container_metrics_emitter.go and main.go as the appId value at the top of the files
In the main.go update the DopplerAddress value by replacing '10.244.0.34.xip.io' with the value for the environment you are testing.
Start the listener
export CF_ACCESS_TOKEN=`cf oauth-token | tail -n 1` go run main.go
Now build the container_metrics_emitter.go in a new bash window with:
GOPATH=~/go GOOS=linux go build container_metrics_emitter.go
Move the container_metrics_emitter executable onto a machine with metron running inside your cf deployment
ssh-add keyfile scp container_metrics_emitter firstname.lastname@example.org:container_metrics_emitter ssh -A email@example.com
You can get a vm ip by doing bosh vms and selecting an ip
scp container_metrics_emitter firstname.lastname@example.org:container_metrics_emitter ssh email@example.com ./container_metrics_emitter
You should now see metrics appearing in the listener window
###Things to look for:
- the diskBytes value should be increasing.
- the diskBytes value should be skipping some numbers, this is b/c we are listening on a three second window, but publishing on a one second window and are only returning the most recent result
- there should be only entries for the applicationId you entered with multiple instance indexes
There is no documentation for this package.