Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cloudwatch-metrics

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudwatch-metrics

  • 1.1.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

CloudwatchMetrics

CloudwatchMetrics is a Ruby gem for writing custom metrics to AWS Cloudwatch.

Installation

Add this line to your application's Gemfile:

gem 'cloudwatch-metrics'

And then execute:

bundle install

To create the initializer:

rails generate cloudwatch_metrics:initializer

The initializer contains descriptions for all available options. More detailed descriptions are available in the user guide, linked below. The only option you must provide a value for is namespace.

Usage

See How To: Publish Custom Metrics to CloudWatch for the user guide.

Local development

By default, CloudWatchMetrics only publishes to Cloudwatch in the production environment. In other environments it will write to the configured logger. These settings can be changed in the initializer.

AWS Credentials

See HOWTO Assume AWS role for info about setting up AWS credential locally. You can read more about AWS SDK configuration in the AWS docs.

The short version: Create a file ~/.aws/config and add your access keys there:

[default]
aws_access_key_id = $AWS_ACCESS_KEY_ID
aws_secret_access_key = $AWS_SECRET_ACCESS_KEY

You'll also want an ~/.aws/config file to set the default region

[default]
region = us-west-2
output = json

Changing this gem

Development

Run bundle install to update gemlock file Run rake to run tests

Deploy new gem

If you make changes to this gem you need to do a few things to make those updates available to clients.

Prerequisites: You will need an account on rubygems.org and you will need to be added as an owner of this gem. Talk to Seth for this. (Managing Owners)

  1. Bump the version in lib/cloudwatch_metrics/version.rb
  2. Build the updated gem with gem build cloudwatch_metrics.gemspec
  3. Push the updated to gem to rubygems with gem push ./cloudwatch-metrics-[VERSION].gem

When the change has been published clients can update to the latest version with bundle update cloudwatch-metrics.

FAQs

Package last updated on 19 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc