Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

RSS

metric_maker (5) Versions 0.4.0

AWS CloudWatch custom metrics made easy

Berkshelf/Librarian
Policyfile
Knife
cookbook 'metric_maker', '~> 0.4.0'
cookbook 'metric_maker', '~> 0.4.0', :supermarket
knife cookbook site install metric_maker
knife cookbook site download metric_maker
README
Dependencies
Quality 22%

metric_maker-cookbook

AWS CloudWatch metric publisher which runs from cron, you provide a script to gather the metric (collectors). Pair the collector up with a metric_maker resource call after installing.

Requirements

  • ruby

Supported Platforms

Tested on:

  • Amazon Linux 2018
  • Ubuntu 16

Attributes

Key Type Description Default
['metric_mater']['root'] String Path to base directory for metric maker to be installed /opt/metric_maker
['metric_maker']['interval'] Number Minute interval to run 1
['metric_maker']['region_override'] String Set the region not on EC2 instance with meta-data or would rather send metrics to a different region than that of the EC2 instance. (auto)

Usage

Simply include the metric_maker recipe to install the cron script, such as a run list of recipe[metric_maker] or a cookbook include_recipe 'metric_maker'.

To include with Berksfile use: cookbook 'metric_maker', git: 'git@bitbucket.org:corpinfo/metric-maker.git'

And metadata use: depends 'metric_maker', '~> 0.3.2'

Built in metric resources

There are are a few built in resource collectors. These resources include metric_maker_disk, metric_maker_cpu, metric_maker_free_mem. Here's an example of metric_maker_disk:

Root Disk Utilization Example

metric_maker_disk 'root_disk' do
  namespace 'prod'
  dimensions [
    {role: 'web-app'},
    {ip: '10.16.46.1'}
  ]
end

Each of the built ins support the following (replace metric_maker_resource with one of the above)

metric_maker_resource 'name' do
 namespace                   String
 dimensions                  Array # list of {Key, Value} String pairs
 publish_with_no_dimension   True, False # default False
end

Example collector files/default/wave.rb:

#!/usr/bin/env ruby

puts (Math.sin(Time.now.min * 3 * 0.0174533) * 100).round(2)

Example metric_maker resource

metric_maker 'heart_beat' do
  namespace 'env'
  script 'wave.rb'
  unit 'Count'
  dimensions [
    {role: 'app-name'}
    {instance_id: instance_id}
  ]
  publish_with_no_dimension true
end

Full syntax for metric_maker

metric_maker 'name' do
 metric_name                 String # defaults to name
 namespace                   String # required
 dimensions                  Array # list of {Key, Value} String pairs default is []
 publish_with_no_dimension   True, False # default False
 script_content              String # use this for inline script collector definitions - first line should include the interpreter required if script not defined
 script_cookbook             String # if using script type you can define from which cookbook to read the cookbook_file from default is nil not required
 script                      cookbook_file String # use this for target your collector file - first line should include the interpreter. Required if not defining script_content
 unit                        String # default Count one of the following: ["Seconds", "Microseconds", "Milliseconds", "Bytes", "Kilobytes", "Megabytes", "Gigabytes", "Terabytes", "Bits", "Kilobits", "Megabits", "Gigabits", "Terabits", "Percent", "Count", "Bytes/Second", "Kilobytes/Second", "Megabytes/Second", "Gigabytes/Second", "Terabytes/Second", "Bits/Second", "Kilobits/Second", "Megabits/Second", "Gigabits/Second", "Terabits/Second", "Count/Second"]
 action                      Symbol # default :create [:create, :install]
end

Resource Helpers

insatnce_id is a function defined to return the an EC2 instance ID from meta-data

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

There are no cookbooks that are contingent upon this one.

Collaborator Number Metric
            

0.4.0 failed this metric

Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

0.4.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file

Foodcritic Metric
            

0.4.0 failed this metric

FC064: Ensure issues_url is set in metadata: metric_maker/metadata.rb:1
FC065: Ensure source_url is set in metadata: metric_maker/metadata.rb:1
FC066: Ensure chef_version is set in metadata: metric_maker/metadata.rb:1
FC067: Ensure at least one platform supported in metadata: metric_maker/metadata.rb:1
FC069: Ensure standardized license defined in metadata: metric_maker/metadata.rb:1
Run with Foodcritic Version 13.0.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric
            

0.4.0 failed this metric

metric_maker does not have a valid open source license.
Acceptable licenses include Apache-2.0, apachev2, Apache 2.0, MIT, mit, GPL-2.0, gplv2, GNU Public License 2.0, GPL-3.0, gplv3, GNU Public License 3.0.

No Binaries Metric
            

0.4.0 passed this metric

Publish Metric
            

0.4.0 passed this metric

Supported Platforms Metric
            

0.4.0 failed this metric

metric_maker should declare what platform(s) it supports.

Testing File Metric
            

0.4.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file

Version Tag Metric
            

0.4.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number