tpt-rails 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f34cc827a621a48f4a71602ddf6de4c8da4738a1644708136cb5d0e716795be
4
- data.tar.gz: 165dbfd4ffc8e3a149ae0c4a88600ee39319b21ba99882846902ec7d1511fd74
3
+ metadata.gz: d7990c91ca054f067f184b1ba9bb3ddfd43fc21ec0006b1600ed0b5ac54631fa
4
+ data.tar.gz: d4971b9eb12c19ee4cac5053dcea9260cf6edef742e32a2acda6190bca56744a
5
5
  SHA512:
6
- metadata.gz: a9a6507480b7e46bee217c524c243b89c7994135cd06c1353e30b97fa4b57088cf6dcfac699f1bd10407da15fd0d1c872922bf9ad6d52d4d8a1b8680926da1fc
7
- data.tar.gz: bcf18231087259a786e1254c3d81520f383163928043cf42415a0ab4e0af199e28b8aea695ebfa9c2d660c9e5a1e847ddfcb0d0b99a6effd00ebfc3da11d3934
6
+ metadata.gz: 5747eccc8946d8d082aa40c7a815b37b38833a4af2bda0c38ab870c03e8a05f09dfc747478155065e253c10b1979aa59d36e91f218abed503466efac62e12c2a
7
+ data.tar.gz: 36800d28c159f7e3a14e6ab753955dd19d79449bdbb00679544e88920d249d74eab5d460ea991331564d493b85606722f540120d96e61a5d17774e0c3e01280f
data/README.md CHANGED
@@ -117,7 +117,7 @@ Note: this currently only collects metrics when running Puma in _clustered_ mode
117
117
  ### Running tests
118
118
 
119
119
  1. Start `docker-compose up` (provides a real Redis instance for tests)
120
- 2. Run `rails test`
120
+ 2. Run `bin/test`
121
121
 
122
122
  ### Using your local version of this gem in a local app
123
123
 
@@ -131,7 +131,7 @@ gem 'tpt-rails', path: '/your/local/path/to/tpt/rails'
131
131
 
132
132
  First ensure you have permissions to publish to rubygems.org.
133
133
 
134
- Then execute:
134
+ Once you've merged, check out the `master` branch and execute:
135
135
  ```sh
136
136
  bundle exec gem bump --push --tag --version patch # patch/minor/major/X.X.X
137
137
  bundle exec gem release
@@ -9,7 +9,7 @@ image:
9
9
 
10
10
  environment:
11
11
  ENVIRONMENT: staging
12
- APP_ENV: production
12
+ APP_ENV: staging
13
13
  RAILS_ENV: production
14
14
 
15
15
  postgresql:
@@ -68,5 +68,10 @@ module Tpt::Rails
68
68
  def config # :nodoc:
69
69
  configured? ? @config : raise(NotConfigured)
70
70
  end
71
+
72
+ # This should be set by the deployment tool. E.g. Jenkins: https://git.io/JJFiD
73
+ def release_version
74
+ ENV['TPT_RELEASE_VERSION'].presence
75
+ end
71
76
  end
72
77
  end
@@ -29,18 +29,21 @@ class Tpt::Rails::Internal::Datadog # :nodoc:
29
29
  url = @statsd_url || 'statsd://localhost'
30
30
  uri = URI.parse(url)
31
31
 
32
+ tags = ["env:#{Tpt::Rails.app_env}"]
33
+ tags << ["tpt_release_version:#{Tpt::Rails.release_version}"] if Tpt::Rails.release_version
34
+
32
35
  ::Datadog::Statsd.new(
33
36
  uri.host,
34
37
  uri.port || DEFAULT_STATSD_PORT,
35
- {
36
- namespace: Tpt::Rails.app_name,
37
- tags: ["env:#{Tpt::Rails.app_env}"],
38
- }
38
+ namespace: Tpt::Rails.app_name,
39
+ tags: tags,
39
40
  )
40
41
  end
41
42
 
42
43
  def configure_tracing
43
44
  uri = URI.parse(@trace_url)
45
+ tags = { 'env' => Tpt::Rails.app_env }
46
+ tags["tpt_release_version"] = Tpt::Rails.release_version if Tpt::Rails.release_version
44
47
 
45
48
  ::Datadog.configure do |c|
46
49
  # This will activate auto-instrumentation for Rails
@@ -53,8 +56,10 @@ class Tpt::Rails::Internal::Datadog # :nodoc:
53
56
  enabled: true,
54
57
  hostname: uri.host,
55
58
  port: uri.port || DEFAULT_TRACE_PORT,
56
- tags: { 'env' => Tpt::Rails.app_env },
59
+ tags: tags,
57
60
  )
61
+
62
+ c.logger.level = ::Logger::WARN
58
63
  end
59
64
 
60
65
  ::Datadog::Pipeline.before_flush(
@@ -49,6 +49,7 @@ class Tpt::Rails::Internal::ErrorReporter # :nodoc:
49
49
 
50
50
  Bugsnag.configure do |config|
51
51
  config.api_key = @bugsnag_api_key
52
+ config.app_version = Tpt::Rails.release_version if Tpt::Rails.release_version
52
53
  end
53
54
  end
54
55
 
@@ -58,8 +59,10 @@ class Tpt::Rails::Internal::ErrorReporter # :nodoc:
58
59
 
59
60
  Rollbar.configure do |config|
60
61
  config.access_token = @rollbar_access_token
62
+ config.code_version = Tpt::Rails.release_version if Tpt::Rails.release_version
61
63
  config.enabled = @rollbar_enabled
62
64
  config.environment = Tpt::Rails.app_env
65
+ config.populate_empty_backtraces = true
63
66
  end
64
67
  end
65
68
  end
@@ -1,5 +1,5 @@
1
1
  module Tpt
2
2
  module Rails
3
- VERSION = '1.2.0'
3
+ VERSION = '1.4.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tpt-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - TpT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-31 00:00:00.000000000 Z
11
+ date: 2020-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,20 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 6.0.2
19
+ version: 6.0.3
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 6.0.2.1
22
+ version: 6.0.3.3
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: 6.0.2
29
+ version: 6.0.3
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 6.0.2.1
32
+ version: 6.0.3.3
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: dogstatsd-ruby
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.30'
53
+ version: '0.40'
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.30'
60
+ version: '0.40'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: sqlite3
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -130,7 +130,7 @@ files:
130
130
  - lib/tpt/rails/version.rb
131
131
  homepage: https://github.com/TeachersPayTeachers/tpt-rails
132
132
  licenses:
133
- - None
133
+ - Nonstandard
134
134
  metadata: {}
135
135
  post_install_message:
136
136
  rdoc_options: []
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubygems_version: 3.0.3
150
+ rubygems_version: 3.1.2
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: Utils for TpT Rails apps