Giter Club home page Giter Club logo

go-noaa's Introduction

#NOAA

Concourse Status Coverage Status GoDoc

NOAA is a client library to consume metric and log messages from Doppler.

##WARNING

This library does not work with Go 1.3 through 1.3.3, due to a bug in the standard libraries.

We support the two most recent stable versions of Golang.

###Deprecation The consumer of the noaa package has been deprecated in favor of the consumer in the consumer package. When creating a new NOAA consumer, use consumer.New() instead of noaa.NewConsumer(). See the samples for more details.

##Get the Code

This Go project is designed to be imported into $GOPATH, rather than being cloned into any working directory. There are two ways to do this.

  • The easiest way with with go get. This will import the project, along with all dependencies, into your $ GOPATH.

    $ echo $GOPATH
    /Users/myuser/go
    
    $ go get github.com/scalingdata/go-noaa
    
    $ ls ~/go/src/github.com/scalingdata/
    noaa/         sonde-go/
    
  • You can also manually clone the repo into your $GOPATH, but you then have to manually import dependencies.

    $ echo $GOPATH
    /Users/myuser/go
    
    $ cd /Users/myuser/go/src/github.com/scalingdata
    $ git clone [email protected]:cloudfoundry/noaa.git
    $ cd noaa
    $ go get ./...
    

Sample Applications

Prerequisites

In order to use the sample applications below, you will have to export the following environment variables:

  • CF_ACCESS_TOKEN - You can get this value by executing ($ cf oauth-token). Example:
export CF_ACCESS_TOKEN="bearer eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI3YmM2MzllOC0wZGM0LTQ4YzItYTAzYS0xYjkyYzRhMWFlZTIiLCJzdWIiOiI5YTc5MTVkOS04MDc1LTQ3OTUtOTBmOS02MGM0MTU0YTJlMDkiLCJzY29wZSI6WyJzY2ltLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLmFkbWluIiwicGFzc3dvcmQud3JpdGUiLCJzY2ltLndyaXRlIiwib3BlbmlkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSIsImNsb3VkX2NvbnRyb2xsZXIucmVhZCJdLCJjbGllbnRfaWQiOiJjZiIsImNpZCI6ImNmIiwiZ3JhbnRfdHlwZSI6InBhc3N3b3JkIiwidXNlcl9pZCI6IjlhNzkxNWQ5LTgwNzUtNDc5NS05MGY5LTYwYzQxNTRhMmUwOSIsInVzZXJfbmFtZSI6ImFkbWluIiwiZW1haWwiOiJhZG1pbiIsImlhdCI6MTQwNDg0NzU3NywiZXhwIjoxNDA0ODQ4MTc3LCJpc3MiOiJodHRwczovL3VhYS4xMC4yNDQuMC4zNC54aXAuaW8vb2F1dGgvdG9rZW4iLCJhdWQiOlsic2NpbSIsIm9wZW5pZCIsImNsb3VkX2NvbnRyb2xsZXIiLCJwYXNzd29yZCJdfQ.mAaOJthCotW763lf9fysygqdES_Mz1KFQ3HneKbwY4VJx-ARuxxiLh8l_8Srx7NJBwGlyEtfYOCBcIdvyeDCiQ0wT78Zw7ZJYFjnJ5-ZkDy5NbMqHbImDFkHRnPzKFjJHip39jyjAZpkFcrZ8_pUD8XxZraqJ4zEf6LFdAHKFBM"
  • DOPPLER_ADDR - It is based on your environment. Example:
export DOPPLER_ADDR="wss://doppler.10.244.0.34.xip.io:4443"

Application logs

The samples/app_logs/main.go application streams logs for a particular app. The following environment variable needs to be set:

  • APP_GUID - You can get this value from running $ cf app APP --guid. Example:
export APP_GUID=55fdb274-d6c9-4b8c-9b1f-9b7e7f3a346c

Then you can run the sample app like this:

go build -o bin/app_logs samples/app_logs/main.go
bin/app_logs

Logs and metrics firehose

The samples/firehose/main.go application streams metrics data and logs for all apps.

You can run the firehose sample app like this:

go build -o bin/firehose samples/firehose/main.go
bin/firehose

Multiple subscribers may connect to the firehose endpoint, each with a unique subscription_id (configurable in main.go). Each subscriber (in practice, a pool of clients with a common subscription_id) receives the entire stream. For each subscription_id, all data will be distributed evenly among that subscriber's client pool.

Container metrics

The samples/container_metrics/consumer/main.go application streams container metrics for the specified appId.

You can run the container metrics sample app like this:

go build -o bin/container_metrics samples/container_metrics/consumer/main.go
bin/container_metrics

For more information to setup a test environment in order to pull container metrics look at the README.md in the container_metrics sample.

##Development

Use go get -d -v -t ./... && ginkgo --race --randomizeAllSpecs --failOnPending --skipMeasurements --cover to run the tests.

go-noaa's People

Contributors

ajackson avatar bradylove avatar dsabeti avatar ihcsim avatar iplay88keys avatar jasonkeene avatar jmtuley avatar mikeg-rocana avatar mrosecrance avatar nelsam avatar poy avatar roxtar avatar shalako avatar shinji62 avatar tcnksm avatar theone20001 avatar voelzmo avatar wfernandes avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.