Skip to content

Commit

Permalink
Merge 0.12-dev into master (#416)
Browse files Browse the repository at this point in the history
Releasing 0.12.0 stable
  • Loading branch information
Emanuele Palazzetti authored May 8, 2018
2 parents d4a2613 + 6ba8d07 commit 3621e5c
Show file tree
Hide file tree
Showing 78 changed files with 4,283 additions and 1,548 deletions.
9 changes: 5 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,24 @@ if RUBY_VERSION < '2.4.0' && RUBY_PLATFORM != 'java'

if RUBY_VERSION >= '2.2.2'
appraise 'rails5-mysql2' do
gem 'rails', '5.0.1'
gem 'rails', '5.1.5'
gem 'mysql2', '< 0.5', platform: :ruby
end

appraise 'rails5-postgres' do
gem 'rails', '5.0.1'
gem 'rails', '5.1.5'
gem 'pg', '< 1.0', platform: :ruby
end

appraise 'rails5-postgres-redis' do
gem 'rails', '5.0.1'
gem 'rails', '5.1.5'
gem 'pg', '< 1.0', platform: :ruby
gem 'redis-rails'
gem 'redis'
end

appraise 'rails5-postgres-sidekiq' do
gem 'rails', '5.0.1'
gem 'rails', '5.1.5'
gem 'pg', '< 1.0', platform: :ruby
gem 'sidekiq'
gem 'activejob'
Expand All @@ -115,6 +115,7 @@ if RUBY_VERSION >= '2.2.2' && RUBY_PLATFORM != 'java'
appraise 'contrib' do
gem 'elasticsearch-transport'
gem 'mongo', '< 2.5'
gem 'graphql'
gem 'grape'
gem 'rack'
gem 'rack-test'
Expand Down
70 changes: 68 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,70 @@

## [Unreleased (beta)]

## [0.12.0] - 2018-05-08

Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.12.0

Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0

### Added
- GraphQL integration (supporting graphql 1.7.9+) (#295)
- ActiveRecord object instantiation tracing (#311, #334)
- Subscriber module for ActiveSupport::Notifications tracing (#324, #380, #390, #395) (@dasch)
- HTTP quantization module (#384)
- Partial flushing option to tracer (#247, #397)

### Changed
- Rack applies URL quantization by default (#371)
- Elasticsearch applies body quantization by default (#362)
- Context for a single trace now has hard limit of 100,000 spans (#247)
- Tags with `rails.db.x` to `active_record.db.x` instead (#396)

### Fixed
- Loading the ddtrace library after Rails has fully initialized can result in load errors. (#357)
- Some scenarios where `middleware_names` could result in bad resource names (#354)
- ActionController instrumentation conflicting with some gems that monkey patch Rails (#391)

### Deprecated
- Use of `:datadog_rack_request_span` variable in favor of `'datadog.rack_request_span'` in Rack. (#365, #392)

### Refactored
- Racecar to use ActiveSupport::Notifications Subscriber module (#381)
- Rails to use ActiveRecord integration instead of its own implementation (#396)
- ActiveRecord to use ActiveSupport::Notifications Subscriber module (#396)

## [0.12.0.rc1] - 2018-04-11

Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.12.0.rc1

Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0.rc1

### Added
- GraphQL integration (supporting graphql 1.7.9+) (#295)
- ActiveRecord object instantiation tracing (#311, #334)
- Subscriber module for ActiveSupport::Notifications tracing (#324, #380, #390, #395) (@dasch)
- HTTP quantization module (#384)
- Partial flushing option to tracer (#247, #397)

### Changed
- Rack applies URL quantization by default (#371)
- Elasticsearch applies body quantization by default (#362)
- Context for a single trace now has hard limit of 100,000 spans (#247)
- Tags with `rails.db.x` to `active_record.db.x` instead (#396)

### Fixed
- Loading the ddtrace library after Rails has fully initialized can result in load errors. (#357)
- Some scenarios where `middleware_names` could result in bad resource names (#354)
- ActionController instrumentation conflicting with some gems that monkey patch Rails (#391)

### Deprecated
- Use of `:datadog_rack_request_span` variable in favor of `'datadog.rack_request_span'` in Rack. (#365, #392)

### Refactored
- Racecar to use ActiveSupport::Notifications Subscriber module (#381)
- Rails to use ActiveRecord integration instead of its own implementation (#396)
- ActiveRecord to use ActiveSupport::Notifications Subscriber module (#396)

## [0.12.0.beta2] - 2018-02-28

Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.12.0.beta2
Expand Down Expand Up @@ -221,8 +285,10 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1

Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1

[Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.3...master
[Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0.beta2...0.12-dev
[Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...master
[Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...0.13-dev
[0.12.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0
[0.12.0.rc1]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0.rc1
[0.12.0.beta2]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0.beta1...v0.12.0.beta2
[0.12.0.beta1]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.2...v0.12.0.beta1
[0.11.4]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.3...v0.11.4
Expand Down
139 changes: 11 additions & 128 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,123 +1,22 @@
# dd-trace-rb
# Datadog Trace Client

[![CircleCI](https://circleci.com/gh/DataDog/dd-trace-rb/tree/master.svg?style=svg&circle-token=b0bd5ef866ec7f7b018f48731bb495f2d1372cc1)](https://circleci.com/gh/DataDog/dd-trace-rb/tree/master)

## Documentation

You can find the latest documentation on [rubydoc.info][docs]

[docs]: http://gems.datadoghq.com/trace/docs/
``ddtrace`` is Datadog’s tracing client for Ruby. It is used to trace requests as they flow across web servers,
databases and microservices so that developers have great visiblity into bottlenecks and troublesome requests.

## Getting started

### Install

Install the Ruby client with the ``gem`` command:

```
gem install ddtrace
```

If you're using ``Bundler``, just update your ``Gemfile`` as follows:

```ruby
source 'https://rubygems.org'

# tracing gem
gem 'ddtrace'
```

To use a development/preview version, use:

```ruby
gem 'ddtrace', :github => 'DataDog/dd-trace-rb', :branch => 'me/my-feature-branch'
```

### Quickstart (manual instrumentation)

If you aren't using a supported framework instrumentation, you may want to to manually instrument your code.
Adding tracing to your code is very simple. As an example, let’s imagine we have a web server and we want
to trace requests to the home page:

```ruby
require 'ddtrace'
require 'sinatra'
require 'active_record'

# a generic tracer that you can use across your application
tracer = Datadog.tracer

get '/' do
tracer.trace('web.request') do |span|
# set some span metadata
span.service = 'my-web-site'
span.resource = '/'
span.set_tag('http.method', request.request_method)
For a basic product overview, check out our [setup documentation][setup docs].

# trace the activerecord call
tracer.trace('posts.fetch') do
@posts = Posts.order(created_at: :desc).limit(10)
end
For installation, configuration, and details about using the API, check out our [API documentation][api docs] and [gem documentation][gem docs].

# trace the template rendering
tracer.trace('template.render') do
erb :index
end
end
end
```
For descriptions of terminology used in APM, take a look at the [official documentation][visualization docs].

### Quickstart (integration)

Instead of doing the above manually, whenever an integration is available,
you can activate it. The example above would become:

```ruby
require 'ddtrace'
require 'sinatra'
require 'active_record'

Datadog.configure do |c|
c.use :sinatra
c.use :active_record
end

# now write your code naturally, it's traced automatically
get '/' do
@posts = Posts.order(created_at: :desc).limit(10)
erb :index
end
```

This will automatically trace any app inherited from `Sinatra::Application`.
To trace apps inherited from `Sinatra::Base`, you should manually register
the tracer inside your class.

```ruby
require "ddtrace"
require "ddtrace/contrib/sinatra/tracer"

class App < Sinatra::Base
register Datadog::Contrib::Sinatra::Tracer
end
```

To configure the Datadog Tracer, you can define the `configure` block as follows:

```ruby
Datadog.configure do |c|
c.tracer enabled: false, hostname: 'trace-agent.local'
# [...]
end
```

For a list of available options, check the [Tracer documentation](http://gems.datadoghq.com/trace/docs/#Configure_the_tracer).


To know if a given framework or lib is supported by our client,
please consult our [integrations][contrib] list.

[contrib]: http://www.rubydoc.info/github/DataDog/dd-trace-rb/Datadog/Contrib
[setup docs]: https://docs.datadoghq.com/tracing/setup/ruby/
[api docs]: https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md
[gem docs]: http://gems.datadoghq.com/trace/docs/
[visualization docs]: https://docs.datadoghq.com/tracing/visualization/

## Development

Expand All @@ -136,23 +35,7 @@ You can launch tests using the following Rake commands:
...

Run ``rake --tasks`` for the list of available Rake tasks.

Available appraisals are:

* ``contrib``: default for integrations
* ``contrib-old``: default for integrations, with version suited for old Ruby (possibly unmaintained) versions
* ``rails3-mysql2``: Rails3 with Mysql
* ``rails3-postgres``: Rails 3 with Postgres
* ``rails3-postgres-redis``: Rails 3 with Postgres and Redis
* ``rails3-postgres-sidekiq``: Rails 3 with Postgres and Sidekiq
* ``rails4-mysql2``: Rails4 with Mysql
* ``rails4-postgres``: Rails 4 with Postgres
* ``rails4-postgres-redis``: Rails 4 with Postgres and Redis
* ``rails4-postgres-sidekiq``: Rails 4 with Postgres and Sidekiq
* ``rails5-mysql2``: Rails5 with Mysql
* ``rails5-postgres``: Rails 5 with Postgres
* ``rails5-postgres-redis``: Rails 5 with Postgres and Redis
* ``rails5-postgres-sidekiq``: Rails 5 with Postgres and Sidekiq
Run ``appraisal list`` for the list of available appraisals.

The test suite requires many backing services (PostgreSQL, MySQL, Redis, ...) and we're using
``docker`` and ``docker-compose`` to start these services in the CI.
Expand Down
54 changes: 29 additions & 25 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,34 @@ namespace :spec do
end

[
:active_record,
:active_support,
:aws,
:dalli,
:elasticsearch,
:http,
:redis,
:sinatra,
:sidekiq,
:rack,
:faraday,
:grape,
:aws,
:sucker_punch,
:graphql,
:http,
:mongodb,
:racecar,
:rack,
:redis,
:resque,
:active_record,
:dalli
:sidekiq,
:sinatra,
:sucker_punch
].each do |contrib|
RSpec::Core::RakeTask.new(contrib) do |t|
t.pattern = "spec/ddtrace/contrib/#{contrib}/*_spec.rb"
t.pattern = "spec/ddtrace/contrib/#{contrib}/**/*_spec.rb"
end
end
end

namespace :test do
task all: [:main,
:rails, :railsredis, :railssidekiq, :railsactivejob,
:elasticsearch, :http, :redis, :sidekiq, :sinatra, :monkey]
:elasticsearch, :http, :sidekiq, :sinatra, :monkey]

Rake::TestTask.new(:main) do |t|
t.libs << %w[test lib]
Expand Down Expand Up @@ -108,18 +110,17 @@ namespace :test do
end

[
:aws,
:elasticsearch,
:http,
:redis,
:sinatra,
:sidekiq,
:rack,
:faraday,
:grape,
:aws,
:sucker_punch,
:http,
:mongodb,
:resque
:resque,
:rack,
:resque,
:sidekiq,
:sinatra,
:sucker_punch
].each do |contrib|
Rake::TestTask.new(contrib) do |t|
t.libs << %w[test lib]
Expand Down Expand Up @@ -207,32 +208,35 @@ task :ci do
when 1
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:elasticsearch'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:http'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:redis'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sinatra'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:rack'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:grape'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:faraday'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:aws'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:mongodb'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sucker_punch'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:resque'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:monkey'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:elasticsearch'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:http'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:redis'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:sinatra'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:rack'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:faraday'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:aws'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:mongodb'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:sucker_punch'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:resque'
# RSpec
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:active_record'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:active_support'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:dalli'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:faraday'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:graphql'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:racecar'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:dalli'
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:redis'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:active_record'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:active_support'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:dalli'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:faraday'
sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:redis'
when 2
sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sidekiq'
sh 'rvm $SIDEKIQ_OLD_VERSIONS --verbose do appraisal contrib-old rake test:sidekiq'
Expand Down
Loading

0 comments on commit 3621e5c

Please sign in to comment.