Skip to content

Go library for sending monitoring metrics to Carbon

License

Notifications You must be signed in to change notification settings

meinzone/carbon-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

carbon-golang

What is carbon-golang?

A Go-based library written to make it easier to send Carbon metrics to a Carbon cache.

How do I use it?

From your binary,

import (
    "github.com/jforman/carbon-golang"
)

package main

func main() {
    var string carbonHost
    var int carbonPort
    var bool carbonNoop
    var bool carbonVerbose
    carbonReceiver, err := carbon.NewCarbon(carbonHost, carbonPort, carbonNoop, carbonVerbose)
    metrics := []carbon.Metric
    metrics := append(metrics, carbon.Metric{Name: "foo.bar.min", Value: 2, Timestamp: 1234567890})
    metrics := append(metrics, carbon.Metric{Name: "foo.bar.max", Value: 10, Timestamp: 1234567890})
    carbonReciever.SendMetrics(metrics)
}

Or in shot: Create an instance of a carbon receiver, make a list of metrics, and send the metrics in.

What's next?

I plan to refactor the code to make it more correct, and add helper functions to make sending metrics in even more straightforward and easy.

About

Go library for sending monitoring metrics to Carbon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages