Skip to content

Commit

Permalink
Merge pull request #61 from alphagov/msw/xrayperiments
Browse files Browse the repository at this point in the history
Check for XRAY_PATCH_AWS_SDK env var, and do not patch aws_sdk if unset
  • Loading branch information
barrucadu authored Oct 4, 2018
2 parents 55211b1 + 76a5bd9 commit 77a4018
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Only instrument the `aws_sdk` gem with AWS X-Ray if the
`XRAY_PATCH_AWS_SDK` environment variable is present.

# 1.9.3

* Do not report Sidekiq queue thresholds in healthchecks which are
Expand Down
7 changes: 4 additions & 3 deletions lib/govuk_app_config/govuk_xray.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ def self.initialize(app)
end

def self.start
# if aws-sdk is loaded, we want to instrument that too
patch = Gem.loaded_specs.has_key?('aws-sdk-core') ?
%I[aws_sdk net_http] : %I[net_http]
# patching 'aws_sdk' seem to impose a large memory overhead, so
# don't do that by default
patch = ENV.has_key?('XRAY_PATCH_AWS_SDK') ?
%I[aws_sdk net_http] : %I[net_http]

# if there isn't a name set, attempting to record a segment will
# throw an error
Expand Down

0 comments on commit 77a4018

Please sign in to comment.