Skip to content

Commit

Permalink
Merge pull request #828 from DataDog/bump_to_version_0.28.0
Browse files Browse the repository at this point in the history
Bump to version 0.28.0
  • Loading branch information
marcotc authored Oct 1, 2019
2 parents e9326de + 389fe11 commit aac7784
Show file tree
Hide file tree
Showing 27 changed files with 530 additions and 124 deletions.
70 changes: 66 additions & 4 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -596,11 +596,42 @@ elsif Gem::Version.new('2.5.0') <= Gem::Version.new(RUBY_VERSION) \
gem 'activejob'
end

appraise 'rails6-mysql2' do
gem 'rails', '~> 6.0.0'
gem 'mysql2', '< 0.6', platform: :ruby
end

appraise 'rails6-postgres' do
gem 'rails', '~> 6.0.0'
gem 'pg', '< 1.0', platform: :ruby
end

appraise 'rails6-postgres-redis' do
gem 'rails', '~> 6.0.0'
gem 'pg', '< 1.0', platform: :ruby
gem 'redis-rails'
gem 'redis'
end

appraise 'rails6-postgres-redis-activesupport' do
gem 'rails', '~> 6.0.0'
gem 'pg', '< 1.0', platform: :ruby
gem 'redis-rails'
gem 'redis'
end

appraise 'rails6-postgres-sidekiq' do
gem 'rails', '~> 6.0.0'
gem 'pg', '< 1.0', platform: :ruby
gem 'sidekiq'
gem 'activejob'
end

appraise 'contrib' do
gem 'actionpack'
gem 'actionview'
gem 'active_model_serializers', '>= 0.10.0'
gem 'activerecord', '< 5.1.5'
gem 'activerecord'
gem 'aws-sdk'
gem 'concurrent-ruby'
gem 'dalli'
Expand All @@ -626,7 +657,7 @@ elsif Gem::Version.new('2.5.0') <= Gem::Version.new(RUBY_VERSION) \
gem 'shoryuken'
gem 'sidekiq'
gem 'sinatra'
gem 'sqlite3', '~> 1.3.6'
gem 'sqlite3', '~> 1.4.1'
gem 'sucker_punch'
gem 'typhoeus'
end
Expand Down Expand Up @@ -664,11 +695,42 @@ elsif Gem::Version.new('2.6.0') <= Gem::Version.new(RUBY_VERSION)
gem 'activejob'
end

appraise 'rails6-mysql2' do
gem 'rails', '~> 6.0.0'
gem 'mysql2', '< 0.6', platform: :ruby
end

appraise 'rails6-postgres' do
gem 'rails', '~> 6.0.0'
gem 'pg', '< 1.0', platform: :ruby
end

appraise 'rails6-postgres-redis' do
gem 'rails', '~> 6.0.0'
gem 'pg', '< 1.0', platform: :ruby
gem 'redis-rails'
gem 'redis'
end

appraise 'rails6-postgres-redis-activesupport' do
gem 'rails', '~> 6.0.0'
gem 'pg', '< 1.0', platform: :ruby
gem 'redis-rails'
gem 'redis'
end

appraise 'rails6-postgres-sidekiq' do
gem 'rails', '~> 6.0.0'
gem 'pg', '< 1.0', platform: :ruby
gem 'sidekiq'
gem 'activejob'
end

appraise 'contrib' do
gem 'actionpack'
gem 'actionview'
gem 'active_model_serializers', '>= 0.10.0'
gem 'activerecord', '< 5.1.5'
gem 'activerecord'
gem 'aws-sdk'
gem 'concurrent-ruby'
gem 'dalli'
Expand All @@ -694,7 +756,7 @@ elsif Gem::Version.new('2.6.0') <= Gem::Version.new(RUBY_VERSION)
gem 'shoryuken'
gem 'sidekiq'
gem 'sinatra'
gem 'sqlite3', '~> 1.3.6'
gem 'sqlite3', '~> 1.4.1'
gem 'sucker_punch'
gem 'typhoeus'
end
Expand Down
22 changes: 18 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
# Changelog

## [Unreleased (stable)]
## [Unreleased]

## [Unreleased (beta)]
## [0.28.0] - 2019-10-01

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

Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.27.0...v0.28.0

### Added

- Support for Rails 6.0 (#814)
- Multiplexing on hostname/port for Dalli (#823)
- Support for Redis array arguments (#796, #817) (@brafales)

### Refactored

- Encapsulate span resource name in Faraday integration (#811) (@giancarlocosta)

## [0.27.0] - 2019-09-04

Expand Down Expand Up @@ -929,8 +943,8 @@ 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.27.0...master
[Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.27.0...0.28-dev
[Unreleased]: https://github.com/DataDog/dd-trace-rb/compare/v0.28.0...master
[0.28.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.27.0...v0.28.0
[0.27.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.26.0...v0.27.0
[0.26.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.25.1...v0.26.0
[0.25.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.25.0...v0.25.1
Expand Down
18 changes: 18 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,18 @@ task :ci do
sh 'bundle exec appraisal rails5-postgres-sidekiq rake test:railssidekiq'
sh 'bundle exec appraisal rails5-postgres-sidekiq rake test:railsactivejob'
sh 'bundle exec appraisal rails5-postgres rake test:railsdisableenv'
sh 'bundle exec appraisal rails6-mysql2 rake test:rails'
sh 'bundle exec appraisal rails6-postgres rake test:rails'
sh 'bundle exec appraisal rails6-postgres-redis rake test:railsredis'
sh 'bundle exec appraisal rails6-postgres-redis-activesupport rake test:railsredis'
sh 'bundle exec appraisal rails6-postgres-sidekiq rake test:railssidekiq'
sh 'bundle exec appraisal rails6-postgres-sidekiq rake test:railsactivejob'
sh 'bundle exec appraisal rails6-postgres rake test:railsdisableenv'
# Rails specs
sh 'bundle exec appraisal rails5-mysql2 rake spec:rails'
sh 'bundle exec appraisal rails5-postgres rake spec:rails'
sh 'bundle exec appraisal rails6-mysql2 rake spec:rails'
sh 'bundle exec appraisal rails6-postgres rake spec:rails'
end
elsif Gem::Version.new('2.6.0') <= Gem::Version.new(RUBY_VERSION)
# Main library
Expand Down Expand Up @@ -607,9 +616,18 @@ task :ci do
sh 'bundle exec appraisal rails5-postgres-sidekiq rake test:railssidekiq'
sh 'bundle exec appraisal rails5-postgres-sidekiq rake test:railsactivejob'
sh 'bundle exec appraisal rails5-postgres rake test:railsdisableenv'
sh 'bundle exec appraisal rails6-mysql2 rake test:rails'
sh 'bundle exec appraisal rails6-postgres rake test:rails'
sh 'bundle exec appraisal rails6-postgres-redis rake test:railsredis'
sh 'bundle exec appraisal rails6-postgres-redis-activesupport rake test:railsredis'
sh 'bundle exec appraisal rails6-postgres-sidekiq rake test:railssidekiq'
sh 'bundle exec appraisal rails6-postgres-sidekiq rake test:railsactivejob'
sh 'bundle exec appraisal rails6-postgres rake test:railsdisableenv'
# Rails specs
sh 'bundle exec appraisal rails5-mysql2 rake spec:rails'
sh 'bundle exec appraisal rails5-postgres rake spec:rails'
sh 'bundle exec appraisal rails6-mysql2 rake spec:rails'
sh 'bundle exec appraisal rails6-postgres rake spec:rails'
end
end
end
Expand Down
15 changes: 8 additions & 7 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,11 @@ For a list of available integrations, and their configuration options, please re
| Name | Key | Versions Supported | How to configure | Gem source |
| ------------------------ | -------------------------- | ------------------------ | ----------------------------------- | ------------------------------------------------------------------------------ |
| Action View | `action_view` | `>= 3.2, < 6.0` | *[Link](#action-view)* | *[Link](https://github.com/rails/rails/tree/master/actionview)* |
| Action View | `action_view` | `>= 3.2` | *[Link](#action-view)* | *[Link](https://github.com/rails/rails/tree/master/actionview)* |
| Active Model Serializers | `active_model_serializers` | `>= 0.9` | *[Link](#active-model-serializers)* | *[Link](https://github.com/rails-api/active_model_serializers)* |
| Action Pack | `action_pack` | `>= 3.2, < 6.0` | *[Link](#action-pack)* | *[Link](https://github.com/rails/rails/tree/master/actionpack)* |
| Active Record | `active_record` | `>= 3.2, < 6.0` | *[Link](#active-record)* | *[Link](https://github.com/rails/rails/tree/master/activerecord)* |
| Active Support | `active_support` | `>= 3.2, < 6.0` | *[Link](#active-support)* | *[Link](https://github.com/rails/rails/tree/master/activesupport)* |
| Action Pack | `action_pack` | `>= 3.2` | *[Link](#action-pack)* | *[Link](https://github.com/rails/rails/tree/master/actionpack)* |
| Active Record | `active_record` | `>= 3.2` | *[Link](#active-record)* | *[Link](https://github.com/rails/rails/tree/master/activerecord)* |
| Active Support | `active_support` | `>= 3.2` | *[Link](#active-support)* | *[Link](https://github.com/rails/rails/tree/master/activesupport)* |
| AWS | `aws` | `>= 2.0` | *[Link](#aws)* | *[Link](https://github.com/aws/aws-sdk-ruby)* |
| Concurrent Ruby | `concurrent_ruby` | `>= 0.9` | *[Link](#concurrent-ruby)* | *[Link](https://github.com/ruby-concurrency/concurrent-ruby)* |
| Dalli | `dalli` | `>= 2.7` | *[Link](#dalli)* | *[Link](https://github.com/petergoldstein/dalli)* |
Expand All @@ -345,7 +345,7 @@ For a list of available integrations, and their configuration options, please re
| Net/HTTP | `http` | *(Any supported Ruby)* | *[Link](#nethttp)* | *[Link](https://ruby-doc.org/stdlib-2.4.0/libdoc/net/http/rdoc/Net/HTTP.html)* |
| Racecar | `racecar` | `>= 0.3.5` | *[Link](#racecar)* | *[Link](https://github.com/zendesk/racecar)* |
| Rack | `rack` | `>= 1.4.7` | *[Link](#rack)* | *[Link](https://github.com/rack/rack)* |
| Rails | `rails` | `>= 3.2, < 6.0` | *[Link](#rails)* | *[Link](https://github.com/rails/rails)* |
| Rails | `rails` | `>= 3.2` | *[Link](#rails)* | *[Link](https://github.com/rails/rails)* |
| Rake | `rake` | `>= 12.0` | *[Link](#rake)* | *[Link](https://github.com/ruby/rake)* |
| Redis | `redis` | `>= 3.2, < 4.0` | *[Link](#redis)* | *[Link](https://github.com/redis/redis-rb)* |
| Resque | `resque` | `>= 1.0, < 2.0` | *[Link](#resque)* | *[Link](https://github.com/resque/resque)* |
Expand Down Expand Up @@ -1103,8 +1103,9 @@ Where `options` is an optional `Hash` that accepts the following parameters:
| 2.0 | 3.0 - 3.2 |
| 2.1 | 3.0 - 4.2 |
| 2.2 - 2.3 | 3.0 - 5.2 |
| 2.4 - 2.5 | 4.2.8 - 5.2 |
| 2.6 | 5.0 - 5.2 |
| 2.4 | 4.2.8 - 5.2 |
| 2.5 | 4.2.8 - 6.0 |
| 2.6 | 5.0 - 6.0 |

### Rake

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
require 'ddtrace/contrib/action_view/ext'

module Datadog
module Contrib
module ActionView
module Instrumentation
# Instrumentation for partial rendering
module PartialRenderer
def render(*args, &block)
datadog_tracer.trace(
Ext::SPAN_RENDER_PARTIAL,
span_type: Datadog::Ext::HTTP::TEMPLATE
) do |span|
with_datadog_span(span) { super(*args) }
end
end

def render_partial(*args)
begin
template = datadog_template(*args)

datadog_render_partial(template)
rescue StandardError => e
Datadog::Tracer.log.debug(e.message)
end

# execute the original function anyway
super(*args)
end

def datadog_render_partial(template)
template_name = Utils.normalize_template_name(template.try('identifier'))

if template_name
active_datadog_span.set_tag(
Ext::TAG_TEMPLATE_NAME,
template_name
)
end
end

private

attr_accessor :active_datadog_span

def datadog_tracer
Datadog.configuration[:action_view][:tracer]
end

def with_datadog_span(span)
self.active_datadog_span = span
yield
ensure
self.active_datadog_span = nil
end

# Rails < 6 partial rendering
module RailsLessThan6
include PartialRenderer

def datadog_template(*args)
@template
end
end

# Rails >= 6 partial rendering
module Rails6Plus
include PartialRenderer

def datadog_template(*args)
args[1]
end
end
end
end
end
end
end
Loading

0 comments on commit aac7784

Please sign in to comment.