GithubHelp home page GithubHelp logo

stackdriver-ruby's Introduction

StackDriver Ruby Client

A ruby client to send custom metrics to StackDriver.

Usage

require 'stackdriver'

# One time setup
api_key = "foo"
StackDriver.init api_key

# Send single metric value
StackDriver.send_metric "test_metric", 666, Time.now.to_i

# Send single metric value with instance id
Stackdriver.send_metric "test_metric", 666, Time.now.to_i, "i-12345"

# Send multiple metric values with instance_id
Stackdriver.send_multi_metric data_point_array

where data is an array of this type:
data = [
  {
     'name': 'my_custom_metric1',
     'value': 32,
     #Note: Stackdriver rejects when the collected_at value is older than 2 hours.
     'collected_at': 1325394000,
     #Note: Include an instance value if your metric is tied to an instance.
     #'instance': 'i-XXXXXXXX',
  },
  {
     'name': 'my_custom_metric2',
     'value': 37,
     #Note: Stackdriver rejects when the collected_at value is older than 2 hours.
     'collected_at': 1325394000,
     #Note: Include an instance value if your metric is tied to an instance.
     #'instance': 'i-XXXXXXXX',
  }
]

Delete single metric value

Note that the removal will take effect roughly two hours after the request has been sent

StackDriver.delete_metric "test_metric", Time.now.to_i

Software Verification

This gem is signed with rubygems-openpgp. You can verify its integrity by running:

gem install stackdriver --verify

Much more information on signing is available at the rubygems-openpgp Certificate Authority.

Signing key:

pub   2048R/E3B5806F 2010-01-11 [expires: 2014-01-03]
      Key fingerprint = A530 C31C D762 0D26 E2BA  C384 B6F6 FFD0 E3B5 806F
uid                  Grant T. Olson (Personal email) <[email protected]>
uid                  Grant T Olson <[email protected]>
uid                  Grant T. Olson (pikimal) <[email protected]>
sub   2048R/6A8F7CF6 2010-01-11 [expires: 2014-01-03]
sub   2048R/A18A54D6 2010-03-01 [expires: 2014-01-03]
sub   2048R/D53982CE 2010-08-31 [expires: 2014-01-03]

stackdriver-ruby's People

Contributors

sammarx avatar grant-olson avatar jorgemoratilla avatar

Stargazers

Christo De Lange avatar Jeroen Visser avatar Lloyd Philbrook avatar Jeremy Katz avatar

Watchers

Jeremy Katz avatar Lloyd Philbrook avatar  avatar

stackdriver-ruby's Issues

No need to pass customer id to the Stackdriver API

I just noticed that the ruby gem is still requiring people to set and pass in the customer id. This hasn't been required for quite a while at this point as we derive it on the backend based on the api key.

And then it'd be easier for people as they won't have to find their customer id.

New Stackdriver API

Stackdriver is releasing a more robust API.

The URL is different for this new API.
I'm about to take a first pass at some of the new functionality.
Would you like to wrap that functionality in this gem, or just start another one?

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.