Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: latest version of dd-trace broke the gem #85

Merged
merged 4 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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