govuk_app_config 1.20.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/govuk_app_config.gemspec +0 -1
- data/lib/govuk_app_config/railtie.rb +0 -8
- data/lib/govuk_app_config/version.rb +1 -1
- data/lib/govuk_app_config.rb +0 -1
- metadata +2 -17
- data/lib/govuk_app_config/govuk_xray.rb +0 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d095181af00a273d5c4735c509da18678cfcc86747139d257ba6f88f4857106f
|
4
|
+
data.tar.gz: 74837394f4cd9f10a10dd0ba1b8a6f99d7df183bab0481c68edb8bcd8377bdc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0276ab12ade1cbbfc9469830c2fd0d36fba74f9cf96bc67d162adbd749761da96c866207f14a69ca89e0619642ef26bfaee10fd62ff9589a0e151cbb548f847c
|
7
|
+
data.tar.gz: 673b25db9f343d4595db63c757a287f2e0bbbb27a9300cdfdf9ac51acd77654758e5acaa2e5be434f77b80ac04cf1b190e18f9245b34631b2a3dcf8114eaf596
|
data/CHANGELOG.md
CHANGED
data/govuk_app_config.gemspec
CHANGED
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
23
|
spec.require_paths = %w[lib]
|
24
24
|
|
25
|
-
spec.add_dependency "aws-xray-sdk", "~> 0.10.0"
|
26
25
|
spec.add_dependency "logstasher", ">= 1.2.2", "< 1.4.0"
|
27
26
|
spec.add_dependency "sentry-raven", ">= 2.7.1", "< 2.12.0"
|
28
27
|
spec.add_dependency "statsd-ruby", "~> 1.4.0"
|
@@ -1,15 +1,7 @@
|
|
1
1
|
module GovukAppConfig
|
2
2
|
class Railtie < Rails::Railtie
|
3
|
-
initializer('govuk_app_config') do |app|
|
4
|
-
GovukXRay.initialize(app) if Rails.env.production? && !ENV.has_key?("GOVUK_APP_CONFIG_DISABLE_XRAY")
|
5
|
-
end
|
6
|
-
|
7
3
|
config.before_initialize do
|
8
4
|
GovukLogging.configure if Rails.env.production?
|
9
5
|
end
|
10
|
-
|
11
|
-
config.after_initialize do
|
12
|
-
GovukXRay.start if Rails.env.production? && !ENV.has_key?("GOVUK_APP_CONFIG_DISABLE_XRAY")
|
13
|
-
end
|
14
6
|
end
|
15
7
|
end
|
data/lib/govuk_app_config.rb
CHANGED
@@ -5,7 +5,6 @@ require "govuk_app_config/govuk_healthcheck"
|
|
5
5
|
# This require is deprecated and should be removed on next major version bump
|
6
6
|
# and should be required by applications directly.
|
7
7
|
require "govuk_app_config/govuk_unicorn"
|
8
|
-
require "govuk_app_config/govuk_xray"
|
9
8
|
require "govuk_app_config/configure"
|
10
9
|
|
11
10
|
if defined?(Rails)
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_app_config
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: aws-xray-sdk
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 0.10.0
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: 0.10.0
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: logstasher
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -232,7 +218,6 @@ files:
|
|
232
218
|
- lib/govuk_app_config/govuk_logging.rb
|
233
219
|
- lib/govuk_app_config/govuk_statsd.rb
|
234
220
|
- lib/govuk_app_config/govuk_unicorn.rb
|
235
|
-
- lib/govuk_app_config/govuk_xray.rb
|
236
221
|
- lib/govuk_app_config/railtie.rb
|
237
222
|
- lib/govuk_app_config/version.rb
|
238
223
|
homepage: https://github.com/alphagov/govuk_app_config
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require 'aws-xray-sdk/facets/rack'
|
2
|
-
require 'aws-xray-sdk/facets/rails/ex_middleware'
|
3
|
-
|
4
|
-
module GovukXRay
|
5
|
-
def self.initialize(app)
|
6
|
-
app.middleware.insert 0, XRay::Rack::Middleware
|
7
|
-
app.middleware.use XRay::Rails::ExceptionMiddleware
|
8
|
-
end
|
9
|
-
|
10
|
-
def self.start
|
11
|
-
# patching 'aws_sdk' seem to impose a large memory overhead, so
|
12
|
-
# don't do that by default
|
13
|
-
patch = ENV.has_key?('XRAY_PATCH_AWS_SDK') ?
|
14
|
-
%I[aws_sdk net_http] : %I[net_http]
|
15
|
-
|
16
|
-
# if there isn't a name set, attempting to record a segment will
|
17
|
-
# throw an error
|
18
|
-
govuk_app_name = ENV['GOVUK_APP_NAME']
|
19
|
-
name = govuk_app_name.blank? ? 'xray' : govuk_app_name
|
20
|
-
|
21
|
-
XRay.recorder.configure(
|
22
|
-
name: name,
|
23
|
-
patch: patch,
|
24
|
-
context_missing: 'LOG_ERROR',
|
25
|
-
sampling_rules: {
|
26
|
-
version: 1,
|
27
|
-
default: {
|
28
|
-
'fixed_target': ENV.fetch('XRAY_SAMPLE_TARGET', 0).to_i,
|
29
|
-
'rate': ENV.fetch('XRAY_SAMPLE_RATE', 0.01).to_f,
|
30
|
-
},
|
31
|
-
rules: [],
|
32
|
-
},
|
33
|
-
)
|
34
|
-
end
|
35
|
-
end
|