tpt-rails 1.2.1 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 497582b6de66fdec5dda45c775b2a6df6de864b3ef849cbfbb9c1d563f8f7f03
4
- data.tar.gz: df47f25ac00874f91d34c90cac1a605aa18d8b900f14e14ccf1747236a394655
3
+ metadata.gz: '07648987ff33dc59d3d0d762ffc4561e9afb0ead7dd214288d98f0337fd7c9c3'
4
+ data.tar.gz: 49a7fa8920ed72e28a935cf906f1513a9854980096e16793187e5527121c9ab6
5
5
  SHA512:
6
- metadata.gz: bbb38c7deaf7e76406180c68c21f7c56f9e7918bff3a4b36d65040a0e3930ef4c522d58e97c6b53bb4e7ccdd508da6591b609615e773b5141a2c6a13e908c635
7
- data.tar.gz: f132370dc957a26ded8bc6f7611ccb04a886e12257043a9a1f3a9a11f9429891278ff2ca6f40557e9c0b0d3e64285d594be749a2518465e58529df3d5873b0d3
6
+ metadata.gz: 2453d891668fc96c18d169576a997db5a2f3017aba91b26ac7d347546c1fccc7baf5fc219770b8b7b03a072f17663f701ccbb4f4672248b5e310215c53ae3114
7
+ data.tar.gz: e803f8b9c00da8d637161d0bbe15936aca93ee882e54386e02a9ffbaa35199de498f7dbfa8ca3a935c8c79c6318c4af48e8c69545036a5bdf90510d494d37288
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:
data/lib/tpt/rails.rb CHANGED
@@ -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,6 @@
1
1
  module Tpt
2
2
  module Rails
3
- VERSION = '1.2.1'
3
+ # Do not change this manually. Our tooling will do it automatically.
4
+ VERSION = '1.4.1'
4
5
  end
5
6
  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.1
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - TpT
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-31 00:00:00.000000000 Z
11
+ date: 2021-03-26 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'
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'
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
@@ -72,8 +72,8 @@ dependencies:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '1.4'
75
- description:
76
- email:
75
+ description:
76
+ email:
77
77
  executables: []
78
78
  extensions: []
79
79
  extra_rdoc_files: []
@@ -132,7 +132,7 @@ homepage: https://github.com/TeachersPayTeachers/tpt-rails
132
132
  licenses:
133
133
  - Nonstandard
134
134
  metadata: {}
135
- post_install_message:
135
+ post_install_message:
136
136
  rdoc_options: []
137
137
  require_paths:
138
138
  - lib
@@ -147,8 +147,8 @@ 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
151
- signing_key:
150
+ rubygems_version: 3.1.2
151
+ signing_key:
152
152
  specification_version: 4
153
153
  summary: Utils for TpT Rails apps
154
154
  test_files: []