logbrew-sdk 0.1.13 → 0.1.14

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: 9f4065e8e726690a78d3b682ba49d4c35d931e4e81619ea2ff11a4170f4572cc
4
- data.tar.gz: 29252ab423d8a184ed96724a76d57aafca1fd4008c383df86f44721eb6b511cf
3
+ metadata.gz: ba29c0ee35c6f7287dbdeadcc2f215b32270218de626d2338de40d8082be04a4
4
+ data.tar.gz: efade8df92a9d851cf9fce4f482ff632a50bcc79038157b048cdb792e6a4fb30
5
5
  SHA512:
6
- metadata.gz: 972aaa22ee930144da4508ce6a80e3e149a6b1cdad744178e3c5056349c43974b7681769d1b2338ce318547de5fefc6122d6c9066481858698e3d54a954603a4
7
- data.tar.gz: 0c7acd8d564f9bda21ce4b44d541e6b4d3417eb3afd46adb57487ed6802a72953ecd19449a0c8f8546f01bc7315c63731e949e87376091737e89beb58d2b082a
6
+ metadata.gz: a2e498a092d5cbaa2f09b7b9be07112e7656e33df61f73614c09cd4cd1d8d7830d3dd24b6daf1169c834847415acc19898cc0c994ca6bb6a47c972a612e13395
7
+ data.tar.gz: 62b25847c01ab391d7122aca956e8b591961cb2a2020b2af837d75d65c2ae508955c088663b0d78d70e0597d99f97efd0e786bc428227a3180c975567ae64a44
data/README.md CHANGED
@@ -23,7 +23,7 @@ needed:
23
23
 
24
24
  ```ruby
25
25
  # Gemfile
26
- gem "logbrew-sdk", "~> 0.1.13"
26
+ gem "logbrew-sdk", "~> 0.1.14"
27
27
  ```
28
28
 
29
29
  ```bash
@@ -47,7 +47,7 @@ module LogBrew
47
47
  end
48
48
 
49
49
  @instrumentation.send(:capture_span, self, error)
50
- @instrumentation.send(:capture_terminal_issue, self) if error && terminal_failure && !cancellation?(error)
50
+ @instrumentation.send(:capture_terminal_issue, self, error) if error && terminal_failure && !cancellation?(error)
51
51
  rescue StandardError => capture_error
52
52
  @instrumentation.send(:report_capture_error, capture_error)
53
53
  end
@@ -79,20 +79,22 @@ module LogBrew
79
79
  }
80
80
  end
81
81
 
82
- def issue_attributes
83
- {
84
- "title" => "Sidekiq job failed",
85
- "level" => "error",
86
- "metadata" => {
87
- "source" => @source,
88
- "sampled" => @context.sampled,
89
- "retryCount" => @retry_count + 1
90
- }
82
+ def issue_attributes(error)
83
+ exception_type = IssueDiagnostics.safe_exception_type(error)
84
+ frame = IssueDiagnostics.stack_frames_from_exception(error).first
85
+ metadata = {
86
+ "source" => @source,
87
+ "sampled" => @context.sampled,
88
+ "retryCount" => @retry_count + 1,
89
+ "errorName" => exception_type
91
90
  }
92
- end
93
-
94
- def retry_count
95
- @retry_count
91
+ unless frame.nil?
92
+ metadata["errorFrameFile"] = frame.fetch("filename")
93
+ metadata["errorFrameLine"] = frame.fetch("line")
94
+ end
95
+ IssueDiagnostics.from_exception(
96
+ error, title: exception_type, mechanism_type: "sidekiq.job", handled: false, metadata: metadata
97
+ )
96
98
  end
97
99
 
98
100
  def failure_key
@@ -381,7 +383,7 @@ module LogBrew
381
383
  )
382
384
  end
383
385
 
384
- def capture_terminal_issue(operation)
386
+ def capture_terminal_issue(operation, error)
385
387
  key = operation.failure_key
386
388
  reserved = @failure_mutex.synchronize do
387
389
  next false if @reported_failures.key?(key)
@@ -396,7 +398,7 @@ module LogBrew
396
398
  @client.issue(
397
399
  "ruby_sidekiq_issue_#{operation.context.span_id}",
398
400
  Time.now.utc.iso8601,
399
- operation.issue_attributes
401
+ operation.issue_attributes(error)
400
402
  )
401
403
  rescue StandardError
402
404
  @failure_mutex.synchronize { @reported_failures.delete(key) }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LogBrew
4
- VERSION = "0.1.13"
4
+ VERSION = "0.1.14"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logbrew-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - LogBrew
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-02 00:00:00.000000000 Z
11
+ date: 2026-09-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Public LogBrew Ruby SDK with typed issue diagnostics, automatic Rails
14
14
  request/error capture, and standard-library delivery.