Skip to content

Commit

Permalink
fix: latest version of dd-trace broke the gem (#85)
Browse files Browse the repository at this point in the history
* update dependency

* update `lambda.rb`

breaking changes in `dd-trace-rb@1.15.0`

* update snapshots

* update `extension.rb`

also broken by `dd-trace`
  • Loading branch information
duncanista authored Oct 11, 2023
1 parent b351224 commit 5ba4800
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN gem build datadog-lambda

# Install ddtrace gem
RUN gem install datadog-lambda --install-dir "/opt/ruby/gems/$runtime"
RUN gem install ddtrace -v 1.14.0 --install-dir "/opt/ruby/gems/$runtime"
RUN gem install ddtrace -v 1.15.0 --install-dir "/opt/ruby/gems/$runtime"

WORKDIR /opt
# Remove native extension debase-ruby_core_source (25MB) runtimes below Ruby 2.6
Expand Down
2 changes: 1 addition & 1 deletion datadog-lambda.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'dogstatsd-ruby', '~> 5.0'
# We don't add this as a direct dependency, because it has
# native modules that are difficult to package for lambda
spec.add_development_dependency 'ddtrace', '~>1.14.0'
spec.add_development_dependency 'ddtrace', '~>1.15.0'

# Development dependencies
spec.add_development_dependency 'rake', '~> 12.3'
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/snapshots/logs/async-metrics_ruby27.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ D, [XXXX] DEBUG -- : metrics are going to be handled by the forwarder
END Duration: XXXX ms (init: XXXX ms) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux-gnu","version":"1.14.0","lang":"ruby","lang_version":"2.7.8","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-2.7.8","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux-gnu","version":"1.15.0","lang":"ruby","lang_version":"2.7.8","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-2.7.8","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - PROFILING - {"profiling_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - TRACING - {"enabled":true,"agent_url":null,"analytics_enabled":false,"sample_rate":null,"sampling_rules":null,"integrations_loaded":"aws@","partial_flushing_enabled":false,"priority_sampling_enabled":false,"integration_aws_analytics_enabled":"false","integration_aws_analytics_sample_rate":"1.0","integration_aws_enabled":"true","integration_aws_service_name":"aws","integration_aws_peer_service":""}
Processed APIGateway request
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/snapshots/logs/async-metrics_ruby32.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ D, [XXXX] DEBUG -- : metrics are going to be handled by the forwarder
END Duration: XXXX ms (init: XXXX ms) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux","version":"1.14.0","lang":"ruby","lang_version":"3.2.2","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-3.2.2","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux","version":"1.15.0","lang":"ruby","lang_version":"3.2.2","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-3.2.2","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - PROFILING - {"profiling_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - TRACING - {"enabled":true,"agent_url":null,"analytics_enabled":false,"sample_rate":null,"sampling_rules":null,"integrations_loaded":"aws@","partial_flushing_enabled":false,"priority_sampling_enabled":false,"integration_aws_analytics_enabled":"false","integration_aws_analytics_sample_rate":"1.0","integration_aws_enabled":"true","integration_aws_service_name":"aws","integration_aws_peer_service":""}
Processed APIGateway request
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/snapshots/logs/http-error_ruby27.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ D, [XXXX] DEBUG -- : metrics are going to be handled by the forwarder
END Duration: XXXX ms (init: XXXX ms) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux-gnu","version":"1.14.0","lang":"ruby","lang_version":"2.7.8","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-2.7.8","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux-gnu","version":"1.15.0","lang":"ruby","lang_version":"2.7.8","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-2.7.8","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - PROFILING - {"profiling_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - TRACING - {"enabled":true,"agent_url":null,"analytics_enabled":false,"sample_rate":null,"sampling_rules":null,"integrations_loaded":"aws@","partial_flushing_enabled":false,"priority_sampling_enabled":false,"integration_aws_analytics_enabled":"false","integration_aws_analytics_sample_rate":"1.0","integration_aws_enabled":"true","integration_aws_service_name":"aws","integration_aws_peer_service":""}
START
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/snapshots/logs/http-error_ruby32.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ D, [XXXX] DEBUG -- : metrics are going to be handled by the forwarder
END Duration: XXXX ms (init: XXXX ms) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux","version":"1.14.0","lang":"ruby","lang_version":"3.2.2","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-3.2.2","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux","version":"1.15.0","lang":"ruby","lang_version":"3.2.2","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-3.2.2","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - PROFILING - {"profiling_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - TRACING - {"enabled":true,"agent_url":null,"analytics_enabled":false,"sample_rate":null,"sampling_rules":null,"integrations_loaded":"aws@","partial_flushing_enabled":false,"priority_sampling_enabled":false,"integration_aws_analytics_enabled":"false","integration_aws_analytics_sample_rate":"1.0","integration_aws_enabled":"true","integration_aws_service_name":"aws","integration_aws_peer_service":""}
START
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/snapshots/logs/http-requests_ruby27.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ D, [XXXX] DEBUG -- : metrics are going to be handled by the forwarder
END Duration: XXXX ms (init: XXXX ms) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux-gnu","version":"1.14.0","lang":"ruby","lang_version":"2.7.8","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-2.7.8","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux-gnu","version":"1.15.0","lang":"ruby","lang_version":"2.7.8","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-2.7.8","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - PROFILING - {"profiling_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - TRACING - {"enabled":true,"agent_url":null,"analytics_enabled":false,"sample_rate":null,"sampling_rules":null,"integrations_loaded":"aws@","partial_flushing_enabled":false,"priority_sampling_enabled":false,"integration_aws_analytics_enabled":"false","integration_aws_analytics_sample_rate":"1.0","integration_aws_enabled":"true","integration_aws_service_name":"aws","integration_aws_peer_service":""}
START
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/snapshots/logs/http-requests_ruby32.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ D, [XXXX] DEBUG -- : metrics are going to be handled by the forwarder
END Duration: XXXX ms (init: XXXX ms) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux","version":"1.14.0","lang":"ruby","lang_version":"3.2.2","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-3.2.2","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux","version":"1.15.0","lang":"ruby","lang_version":"3.2.2","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-3.2.2","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - PROFILING - {"profiling_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - TRACING - {"enabled":true,"agent_url":null,"analytics_enabled":false,"sample_rate":null,"sampling_rules":null,"integrations_loaded":"aws@","partial_flushing_enabled":false,"priority_sampling_enabled":false,"integration_aws_analytics_enabled":"false","integration_aws_analytics_sample_rate":"1.0","integration_aws_enabled":"true","integration_aws_service_name":"aws","integration_aws_peer_service":""}
START
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ D, [XXXX] DEBUG -- : metrics are going to be handled by the forwarder
END Duration: XXXX ms (init: XXXX ms) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux-gnu","version":"1.14.0","lang":"ruby","lang_version":"2.7.8","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-2.7.8","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux-gnu","version":"1.15.0","lang":"ruby","lang_version":"2.7.8","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-2.7.8","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - PROFILING - {"profiling_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - TRACING - {"enabled":true,"agent_url":null,"analytics_enabled":false,"sample_rate":null,"sampling_rules":null,"integrations_loaded":"aws@","partial_flushing_enabled":false,"priority_sampling_enabled":false,"integration_aws_analytics_enabled":"false","integration_aws_analytics_sample_rate":"1.0","integration_aws_enabled":"true","integration_aws_service_name":"aws","integration_aws_peer_service":""}
START
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ D, [XXXX] DEBUG -- : metrics are going to be handled by the forwarder
END Duration: XXXX ms (init: XXXX ms) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux","version":"1.14.0","lang":"ruby","lang_version":"3.2.2","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-3.2.2","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux","version":"1.15.0","lang":"ruby","lang_version":"3.2.2","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-3.2.2","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - PROFILING - {"profiling_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - TRACING - {"enabled":true,"agent_url":null,"analytics_enabled":false,"sample_rate":null,"sampling_rules":null,"integrations_loaded":"aws@","partial_flushing_enabled":false,"priority_sampling_enabled":false,"integration_aws_analytics_enabled":"false","integration_aws_analytics_sample_rate":"1.0","integration_aws_enabled":"true","integration_aws_service_name":"aws","integration_aws_peer_service":""}
START
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/snapshots/logs/sync-metrics_ruby27.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ D, [XXXX] DEBUG -- : metrics are going to be handled by the forwarder
END Duration: XXXX ms (init: XXXX ms) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux-gnu","version":"1.14.0","lang":"ruby","lang_version":"2.7.8","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-2.7.8","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux-gnu","version":"1.15.0","lang":"ruby","lang_version":"2.7.8","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-2.7.8","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - PROFILING - {"profiling_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - TRACING - {"enabled":true,"agent_url":null,"analytics_enabled":false,"sample_rate":null,"sampling_rules":null,"integrations_loaded":"aws@","partial_flushing_enabled":false,"priority_sampling_enabled":false,"integration_aws_analytics_enabled":"false","integration_aws_analytics_sample_rate":"1.0","integration_aws_enabled":"true","integration_aws_service_name":"aws","integration_aws_peer_service":""}
Processed APIGateway request
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/snapshots/logs/sync-metrics_ruby32.log
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ D, [XXXX] DEBUG -- : metrics are going to be handled by the forwarder
END Duration: XXXX ms (init: XXXX ms) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
END Duration: XXXX ms (init: XXXX) Memory Used: XXXX MB
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux","version":"1.14.0","lang":"ruby","lang_version":"3.2.2","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-3.2.2","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - CORE - {"date":"XXXX","os_name":"x86_64-pc-linux","version":"1.15.0","lang":"ruby","lang_version":"3.2.2","env":null,"service":"runtime","dd_version":null,"debug":false,"tags":"_dd.origin:lambda","runtime_metrics_enabled":false,"vm":"ruby-3.2.2","health_metrics_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - PROFILING - {"profiling_enabled":false}
I, [XXXX] INFO XXXX[ddtrace] DATADOG CONFIGURATION - TRACING - {"enabled":true,"agent_url":null,"analytics_enabled":false,"sample_rate":null,"sampling_rules":null,"integrations_loaded":"aws@","partial_flushing_enabled":false,"priority_sampling_enabled":false,"integration_aws_analytics_enabled":"false","integration_aws_analytics_sample_rate":"1.0","integration_aws_enabled":"true","integration_aws_service_name":"aws","integration_aws_peer_service":""}
Processed APIGateway request
Expand Down
4 changes: 2 additions & 2 deletions lib/datadog/lambda.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module Lambda
# See https://github.com/DataDog/dd-trace-rb/blob/master/docs/GettingStarted.md#quickstart-for-ruby-applications
def self.configure_apm
require 'datadog/tracing'
require 'ddtrace/transport/io'
require 'datadog/tracing/transport/io'

@patch_http = false
# Needed to keep trace flushes on a single line
Expand All @@ -40,7 +40,7 @@ def self.configure_apm
Datadog.configure do |c|
unless Datadog::Utils.extension_running?
c.tracing.writer = Datadog::Tracing::SyncWriter.new(
transport: Datadog::Transport::IO.default
transport: Datadog::Tracing::Transport::IO.default
)
end
c.tags = { "_dd.origin": 'lambda' }
Expand Down
4 changes: 2 additions & 2 deletions lib/datadog/lambda/utils/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def self.send_end_invocation_request(response:)

request = Net::HTTP::Post.new(END_INVOCATION_URI)
request.body = response.to_json
request[Datadog::Transport::Ext::HTTP::HEADER_DD_INTERNAL_UNTRACED_REQUEST] = 1
request[Datadog::Core::Transport::Ext::HTTP::HEADER_DD_INTERNAL_UNTRACED_REQUEST] = 1

trace = Datadog::Tracing.active_trace
Tracing::Propagation::HTTP.inject!(trace, request)
Expand All @@ -64,7 +64,7 @@ def self.request_headers
{
# Header used to avoid tracing requests that are internal to
# Datadog products.
Datadog::Transport::Ext::HTTP::HEADER_DD_INTERNAL_UNTRACED_REQUEST.to_sym => 'true'
Datadog::Core::Transport::Ext::HTTP::HEADER_DD_INTERNAL_UNTRACED_REQUEST.to_sym => 'true'
}
end
end
Expand Down

0 comments on commit 5ba4800

Please sign in to comment.