appsignal 4.5.11-java → 4.5.13-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 +16 -0
- data/ext/appsignal_extension.c +2 -2
- 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: 05ad2b9b80e1a2b333edb705217ea1a5b372c735275c042a48051c8a5b1ffb1a
         | 
| 4 | 
            +
              data.tar.gz: abfeb2be7e98cad19da981bcc54206fad3a6a07308ed5d4ac0b03043c471b716
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 06613e5878a38093819be635c9b7a5c994ed16496959764074ca0efb0e498c3a8b380387d52c7376cbb1de63d84219bd15179b878049dc7a80993b83d230eb86
         | 
| 7 | 
            +
              data.tar.gz: 26e857ed78d111e6c504715de0a967992a9c2b16cf22defe5bb388516db882104fe296b93375e77457f60b87c938290f1e010c90f4f2b1a8a881a67964e358cb
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,21 @@ | |
| 1 1 | 
             
            # AppSignal for Ruby gem Changelog
         | 
| 2 2 |  | 
| 3 | 
            +
            ## 4.5.13
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            _Published on 2025-05-12._
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            ### Fixed
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            - Fix the C extension function definitions. On install, the Ruby gem extension would print warnings or fail to compile. (patch [c93f8e20](https://github.com/appsignal/appsignal-ruby/commit/c93f8e20860168929721f0c2b3e642a02dbde936))
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            ## 4.5.12
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            _Published on 2025-05-12._
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            ### Added
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            - 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))
         | 
| 18 | 
            +
             | 
| 3 19 | 
             
            ## 4.5.11
         | 
| 4 20 |  | 
| 5 21 | 
             
            _Published on 2025-05-08._
         | 
    
        data/ext/appsignal_extension.c
    CHANGED
    
    | @@ -838,7 +838,7 @@ static void track_allocation(rb_event_flag_t flag, VALUE arg1, VALUE arg2, ID ar | |
| 838 838 | 
             
              appsignal_track_allocation();
         | 
| 839 839 | 
             
            }
         | 
| 840 840 |  | 
| 841 | 
            -
            static VALUE install_allocation_event_hook() {
         | 
| 841 | 
            +
            static VALUE install_allocation_event_hook(VALUE self) {
         | 
| 842 842 | 
             
              // This event hook is only available on Ruby 2.1 and 2.2
         | 
| 843 843 | 
             
              #if defined(RUBY_INTERNAL_EVENT_NEWOBJ)
         | 
| 844 844 | 
             
              rb_add_event_hook(
         | 
| @@ -851,7 +851,7 @@ static VALUE install_allocation_event_hook() { | |
| 851 851 | 
             
              return Qnil;
         | 
| 852 852 | 
             
            }
         | 
| 853 853 |  | 
| 854 | 
            -
            static VALUE running_in_container() {
         | 
| 854 | 
            +
            static VALUE running_in_container(VALUE self) {
         | 
| 855 855 | 
             
              return appsignal_running_in_container() == 1 ? Qtrue : Qfalse;
         | 
| 856 856 | 
             
            }
         | 
| 857 857 |  | 
| @@ -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.13
         | 
| 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
         |