RSpec::Datadog

This gem provides a custom rspec formatter that sends events to DataDog. Events will contain four tags ("full_description:foo", "status:succeeded", "file_path:foo", "line_number:123") plus any defined in DatadogFormatter::BASE_TAGS; more information about Datadog::Event and querying these events can be found in the DataDog API Reference

Installation

Add this line to your application's Gemfile:

gem 'rspec-datadog'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rspec-datadog

Usage

Run as follows:

DATADOG_API_KEY=foo DATADOG_APPLICATION_KEY=bar bundle exec rspec -r rspec/datadog --format DatadogFormatter spec

Running with DEBUG=1 will cause it to print output to stdout instead of emitting to DataDog.

If you have any tags you want applied to all examples, then add this to your spec_helper:

class DatadogFormatter
  BASE_TAGS = %w(foo)
end

Note that all examples in a given run will have a UUID aggregation key added.

If you are using rspec 3, the formatter API has changed - you'll need to run with --require rspec/legacy_formatters and have the rspec-legacy_formatters gem installed.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/lookout/rspec-datadog. Please see the Contributor License Agreement in CONTRIBUTING.

License

The gem is available as open source under the terms of the MIT License.