cloudfoundry/statsd-injector-release

Name: statsd-injector-release

Owner: Cloud Foundry

Description: null

Created: 2016-12-23 19:04:25.0

Updated: 2018-03-22 21:37:52.0

Pushed: 2018-05-23 21:08:32.0

Homepage: null

Size: 106

Language: Shell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

statsd-injector slack.cloudfoundry.org

Companion component to Metron that receives Statsd and emits to Metron.

Usage

statsd_injector is to be colocated with a metron_agent. It receives metrics via UDP and will emit to metron-agent via the Loggregator v2 api which is built on gRPC.

Creating a release
submodule update --init --recursive
 create-release
Deployment

These instructions are colocating the job with metron_agent.

  1. Generate certs for statsd_injector by running scripts/generate-certs <loggregator-ca.crt> <loggregator-ca.key>. The Loggregator CA cert is generated from the loggregator release.

    This script generates two files in ./statsd-injector-certs that are used as bosh properties.

  2. Add the release to your deployment manifest.

    ases:
    
    • name: statsd-injector
  3. version: latest

    • name: loggregator version: latest

    Then bosh upload release the latest statsd-injector-release bosh release.

  4. Colocate the job that has metron_agent.

    :
    name: some_job_z1
    mplates:
    name: metron_agent
    release: loggegator
    name: statsd_injector
    release: statsd-injector
    stances: 1
    source_pool: default
    tworks:
    - name: default
    operties:
    metron_agent:
      zone: z1
    statsd_injector:
      deployment: some_deployment_name
    loggregator:
      tls:
        ca_cert: loggregator_cert
        metron:
          cert: metron_cert
          key: metron_key
        statsd_injector:
          cert: <cert from script generation>
          key: <key from script generation>
    

    Then bosh deploy this updated manifest.

  5. Send it a metric

    You can emit statsd metrics to the injector by sending a correctly formatted message to udp port 8125 on the job's VM.

    As an example using nc:

     "origin.some.counter:1|c" | nc -u -w0 127.0.0.1 8125
    

    NOTE: The injector expects the the name of the metric to be of the form <origin>.<metric_name>

  6. Validate the metric can be seen.

    Assuming you are using statsd-injector with CF Release, you can use the CF Nozzle plugin

    ozzle -filter CounterEvent | grep <metric_name>
    

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.