Giter Club home page Giter Club logo

go-wavefront's Introduction

Golang Wavefront Client GoDoc Build Status

Golang SDK for interacting with the Wavefront v2 API, and sending metrics through a Wavefront proxy.

Usage

API Client

Presently support for:

  • Querying
  • Searching
  • Dashboard Management
  • Alert (and Alert Target) Management
  • Events Management

Please see the examples directory for an example on how to use each, or check out the documentation.

package main

import (
    "log"

    wavefront "github.com/spaceapegames/go-wavefront"
)

func main() {
    client, err := wavefront.NewClient{
        &wavefront.Config{
            Address: "test.wavefront.com",
            Token:   "xxxx-xxxx-xxxx-xxxx-xxxx",
        },
    }

    query := client.NewQuery(
        wavefront.NewQueryParams(`ts("cpu.load.1m.avg", dc=dc1)`),
    )

    if result, err := query.Execute(); err != nil {
        log.Fatal(err)
    }

    fmt.Println(result.TimeSeries[0].Label)
    fmt.Println(result.TimeSeries[0].DataPoints[0])
}

Writer

Writer has full support for metric tagging etc.

Again, see examples for a more detailed explanation.

package main

import (
    "log"
    "os"

    wavefront "github.com/spaceapegames/go-wavefront/writer"
)

func main() {
    source, _ := os.Hostname()

    wf, err := wavefront.NewWriter("wavefront-proxy.example.com", 2878, source, nil)
    if err != nil {
        log.Fatal(err)
    }
    defer wf.Close()

    wf.Write(wavefront.NewMetric("something.very.good.count", 33))
}

Contributing

Pull requests are welcomed.

If you'd like to contribute to this project, please raise an issue and indicate that you'd like to take on the work prior to submitting a pull request.

go-wavefront's People

Contributors

chengwang86 avatar fr0stbyte avatar ggpaue avatar louism517 avatar nathmclean avatar pacejackson avatar sanoojm avatar siralvarex avatar

Watchers

 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.