Logstash

Prefix Graphite metrics with organization and space GUID

By default, Graphite metrics generated by the a9s Logstash have the form:

<service_guid>.<data_service>.<host>.<metric> = <value>

Let's assume we have a RabbitMQ instance with the GUID 76816f88-9ada-41cf-99a4-5d6b7adb0e84 running on host d97432b-mq-0.node.dc1.consul. Then a metric looks like this:

76816f88-9ada-41cf-99a4-5d6b7adb0e84.rabbitmq.d97432b-mq-0.node.dc1.consul.<metric> = <value>

For some administrative and operational tasks it is also useful to have the GUIDs of the CF organization and CF space in which the service instance has been created. To add these to the prefix of the Graphite metrics you can use the ops/prefix-metrics-with-org-and-space-guid.yml Ops file. The metrics will then have the form:

<organization_guid>.<space_guid>.<service_guid>.<service_type>.<host>.<metric> = <value>

To use this Ops file it must be applied when deploying the corresponding data service. Subsequently, the templates must be uploaded using the Template Uploader Errand and the existing instances must be updated, if necessary, using the Deployment Updater Errand.

For example: RabbitMQ

bosh -d rabbitmq-service deploy rabbitmq-service/rabbitmq-service.yml -l config/iaas-config.yml -l config/rabbitmq.yml -o ops/prefix-metrics-with-org-and-space-guid.yml
bosh -d rabbitmq-service run-errand templates-uploader
bosh -d rabbitmq-service run-errand deployment_updater