appsignal 4.5.11-java → 4.5.12-java
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/appsignal/hooks/active_job.rb +25 -5
- data/lib/appsignal/version.rb +1 -1
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1898de9e58f6078d8371400ef6c2e7d71f80ef444cee4a6256c880f63664badc
         | 
| 4 | 
            +
              data.tar.gz: a67f81c67c9d1077cae2a8f3b0d40f8c344b6f6d9a1cb067f4e4905d255d4c9f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: e6052b48fe35b2c828221866627ecea99da969faaefaf5c95a352bfa673a73500a401088dc58e86501e255b239194d6b01b6f7d9f911313ff4143538551e3b48
         | 
| 7 | 
            +
              data.tar.gz: 95a4cde7460998afa89e76a8008512c0d718fc3fbc44677c0ea405de9dff697c99660b99361355a159aa5ae5c4104c20e169c6fcd55dbf78aef8b61b831f9067
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,13 @@ | |
| 1 1 | 
             
            # AppSignal for Ruby gem Changelog
         | 
| 2 2 |  | 
| 3 | 
            +
            ## 4.5.12
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            _Published on 2025-05-12._
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            ### Added
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            - Report the Active Job queue time as the `active_job_queue_time` metric. This metric can be used to track the queue time per Active Job queue. (patch [906f4458](https://github.com/appsignal/appsignal-ruby/commit/906f4458ceab3a922ffb1437e5bc85416589b809))
         | 
| 10 | 
            +
             | 
| 3 11 | 
             
            ## 4.5.11
         | 
| 4 12 |  | 
| 5 13 | 
             
            _Published on 2025-05-08._
         | 
| @@ -42,7 +42,16 @@ module Appsignal | |
| 42 42 | 
             
                  end
         | 
| 43 43 |  | 
| 44 44 | 
             
                  module ActiveJobClassInstrumentation
         | 
| 45 | 
            -
                    def execute(job)
         | 
| 45 | 
            +
                    def execute(job) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
         | 
| 46 | 
            +
                      enqueued_at = job["enqueued_at"]
         | 
| 47 | 
            +
                      queue_start = Time.parse(enqueued_at) if enqueued_at
         | 
| 48 | 
            +
                      queue_time =
         | 
| 49 | 
            +
                        if queue_start
         | 
| 50 | 
            +
                          time_now = Time.now.utc
         | 
| 51 | 
            +
                          # Calculate queue time and store it as milliseconds
         | 
| 52 | 
            +
                          (time_now - queue_start) * 1_000
         | 
| 53 | 
            +
                        end
         | 
| 54 | 
            +
             | 
| 46 55 | 
             
                      job_status = nil
         | 
| 47 56 | 
             
                      has_wrapper_transaction = Appsignal::Transaction.current?
         | 
| 48 57 | 
             
                      transaction =
         | 
| @@ -73,10 +82,8 @@ module Appsignal | |
| 73 82 | 
             
                      raise exception
         | 
| 74 83 | 
             
                    ensure
         | 
| 75 84 | 
             
                      if transaction
         | 
| 76 | 
            -
                         | 
| 77 | 
            -
                         | 
| 78 | 
            -
                          transaction.set_queue_start((Time.parse(enqueued_at).to_f * 1_000).to_i)
         | 
| 79 | 
            -
                        end
         | 
| 85 | 
            +
                        # Present in Rails 6 and up
         | 
| 86 | 
            +
                        transaction.set_queue_start((queue_start.to_f * 1_000).to_i) if queue_start
         | 
| 80 87 |  | 
| 81 88 | 
             
                        unless has_wrapper_transaction
         | 
| 82 89 | 
             
                          # Only complete transaction if ActiveJob is not wrapped in
         | 
| @@ -94,6 +101,15 @@ module Appsignal | |
| 94 101 | 
             
                        ActiveJobHelpers.increment_counter metric_name, 1,
         | 
| 95 102 | 
             
                          tags.merge(:status => :processed)
         | 
| 96 103 | 
             
                      end
         | 
| 104 | 
            +
             | 
| 105 | 
            +
                      queue_name = job["queue_name"]
         | 
| 106 | 
            +
                      if queue_time && queue_name
         | 
| 107 | 
            +
                        ActiveJobHelpers.add_distribution_value(
         | 
| 108 | 
            +
                          "queue_time",
         | 
| 109 | 
            +
                          queue_time,
         | 
| 110 | 
            +
                          :queue => queue_name
         | 
| 111 | 
            +
                        )
         | 
| 112 | 
            +
                      end
         | 
| 97 113 | 
             
                    end
         | 
| 98 114 |  | 
| 99 115 | 
             
                    private
         | 
| @@ -172,6 +188,10 @@ module Appsignal | |
| 172 188 | 
             
                    def self.increment_counter(key, value, tags = {})
         | 
| 173 189 | 
             
                      Appsignal.increment_counter "active_job_#{key}", value, tags
         | 
| 174 190 | 
             
                    end
         | 
| 191 | 
            +
             | 
| 192 | 
            +
                    def self.add_distribution_value(key, value, tags = {})
         | 
| 193 | 
            +
                      Appsignal.add_distribution_value("active_job_#{key}", value, tags)
         | 
| 194 | 
            +
                    end
         | 
| 175 195 | 
             
                  end
         | 
| 176 196 | 
             
                end
         | 
| 177 197 | 
             
              end
         | 
    
        data/lib/appsignal/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: appsignal
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 4.5. | 
| 4 | 
            +
              version: 4.5.12
         | 
| 5 5 | 
             
            platform: java
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Robert Beekman
         | 
| @@ -10,7 +10,7 @@ authors: | |
| 10 10 | 
             
            autorequire:
         | 
| 11 11 | 
             
            bindir: bin
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date: 2025-05- | 
| 13 | 
            +
            date: 2025-05-12 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: logger
         | 
| @@ -331,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 331 331 | 
             
                - !ruby/object:Gem::Version
         | 
| 332 332 | 
             
                  version: '0'
         | 
| 333 333 | 
             
            requirements: []
         | 
| 334 | 
            -
            rubygems_version: 3. | 
| 334 | 
            +
            rubygems_version: 3.5.23
         | 
| 335 335 | 
             
            signing_key:
         | 
| 336 336 | 
             
            specification_version: 4
         | 
| 337 337 | 
             
            summary: Logs performance and exception data from your app to appsignal.com
         |