GithubHelp home page GithubHelp logo

dizhaung / goryman Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cjgdev/goryman

0.0 0.0 0.0 231 KB

Golang Riemann client

Home Page: http://riemann.io

License: MIT License

Makefile 1.83% Go 92.33% Protocol Buffer 5.84%

goryman's Introduction

Riemann client (Golang)

GoDoc

Introduction

Go client library for Riemann.

This client library was inspired by Raidman, and Riemann NodeJS Client.

Features:

  • Idiomatic concurrency
  • Sending events, state updates, queries.
  • Feature parity with the reference implementation written in Ruby.

Installation

To install the package for use in your own programs:

go get github.com/bigdatadev/goryman

If you're a developer, Riemann uses Google Protocol Buffers, so make sure that's installed and available on your PATH.

go get github.com/golang/protobuf/{proto,protoc-gen-go}

Getting Started

First we'll need to import the library:

import (
    "github.com/bigdatadev/goryman"
)

Next we'll need to establish a new client:

c := goryman.NewGorymanClient("localhost:5555")
err := c.Connect()
if err != nil {
    panic(err)
}

Don't forget to close the client connection when you're done:

defer c.Close()

Just like the Riemann Ruby client, the client sends small events over UDP by default. TCP is used for queries, and large events. There is no acknowledgement of UDP packets, but they are roughly an order of magnitude faster than TCP. We assume both TCP and UDP are listening on the same port.

Sending events is easy (list of valid event properties):

err = c.SendEvent(&goryman.Event{
    Service: "moargore",
    Metric:  100,
    Tags: []string{"nonblocking"},
})
if err != nil {
    panic(err)
}

You can also query events:

events, err := c.QueryEvents("host = \"goryman\"")
if err != nil {
    panic(err)
}

The Hostname and Time in events will automatically be replaced with the hostname of the server and the current time if none is specified.

Integrations

Martini: GoryMartini

Contributing

Just send me a pull request. Please take a look at the project issues and see how you can help. Here are some tips:

  • please add more tests.
  • please check your syntax.

Author

Christopher Gilbert

Copyright

See LICENSE document

goryman's People

Contributors

cjgdev 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.