No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.final_builds
config
git-hooks
jobs/statsd_injector
manifests
packages
releases/statsd-injector
scripts
src
.envrc
.gitignore
.gitmodules
LICENSE
NOTICE
README.md

README.md

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

git submodule update --init --recursive
bosh 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.

    releases:
    +  - name: statsd-injector
    +    version: latest
       - name: loggregator
         version: latest

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

  3. Colocate the job that has metron_agent.

    jobs:
      - name: some_job_z1
      templates:
      - name: metron_agent
        release: loggegator
    + - name: statsd_injector
    +   release: statsd-injector
      instances: 1
      resource_pool: default
      networks:
        - name: default
      properties:
        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.

  4. 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:

    echo "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>

  5. Validate the metric can be seen.

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

    cf nozzle -filter CounterEvent | grep <metric_name>