apm_bro 0.1.10 → 0.1.11

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: 4dabb799711a90879b5f520c0838398a048afeee6b4cb79a000e9d86e1b47614
4
- data.tar.gz: 1cbb04c4e1453a006821a77ae4bc394f3a75f24c0b91e49f3893a1cc9fd5fdcd
3
+ metadata.gz: 1763fe75b6723866fbf061cdc8a978105e3a8bd1be612c2dc0937865c576a1da
4
+ data.tar.gz: e1bad4ee3231e2a0783994983986e040cec36314912e30f402c044a41f47bdea
5
5
  SHA512:
6
- metadata.gz: 6e112276ac70979ada88695ea6b975309e2017147d8731672c58b1f1730d13fc0d6f7f36257c5d30ef3cd9d4cd76a774cbafae75f1d0328aa2d5bd7e1668b74e
7
- data.tar.gz: '097cc98f1ed31a4936f6a385ec031db5292225ae71020c252cf64961ca26f8bb89e25fe360ac9a5077aa0b7f152a6989deae2c83bba0fbccda66bb1eec60b918'
6
+ metadata.gz: 070b54479382d040aebd53e2927d0ebd0aff1a0e0e3a8b4ad4045cc674cec680fd64f2cb279c18412aeff347a34eb098de6bb4fcf227094d2a11e61c12b33b67
7
+ data.tar.gz: 17894ab0bb4446d2fb90848ee0f1996683390710e6f81c198fa357f31822a6577fae98b70749feb46f1e2fbba70e71dd38bbb4886252114164b5d8dcac96a652
@@ -80,11 +80,15 @@ module ApmBro
80
80
  return val if present?(val)
81
81
  end
82
82
 
83
- env_val = ENV["HEROKU_SLUG_COMMIT"]
83
+ # Prefer explicit env var, then common platform-specific var
84
+ env_val = ENV["GIT_REV"]
84
85
  return env_val if present?(env_val)
85
86
 
86
- require "securerandom"
87
- SecureRandom.uuid
87
+ heroku_val = ENV["HEROKU_SLUG_COMMIT"]
88
+ return heroku_val if present?(heroku_val)
89
+
90
+ # Fall back to a process-stable ID
91
+ ApmBro.process_deploy_id
88
92
  end
89
93
 
90
94
  def excluded_job?(job_class_name)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApmBro
4
- VERSION = "0.1.10"
4
+ VERSION = "0.1.11"
5
5
  end
data/lib/apm_bro.rb CHANGED
@@ -36,4 +36,13 @@ module ApmBro
36
36
  def self.reset_configuration!
37
37
  @configuration = Configuration.new
38
38
  end
39
+
40
+ # Returns a process-stable deploy identifier used when none is configured.
41
+ # Memoized per-Ruby process to avoid generating a new UUID per request.
42
+ def self.process_deploy_id
43
+ @process_deploy_id ||= begin
44
+ require "securerandom"
45
+ SecureRandom.uuid
46
+ end
47
+ end
39
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apm_bro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emanuel Comsa