Golang Riemann client
Go Protocol Buffer Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
proto
.gitignore
LICENSE
Make.protobuf
Makefile
README.md
client.go
event.go
marshal.go
state.go
transport.go

README.md

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