errorgap 0.6.0 → 0.7.0

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: 75cf1e4a725d5e1c7f484a577814d71403fbdc4e6c6cd4bcec3d0eca30f00478
4
- data.tar.gz: 98d336466f4eceedc7ad6fc03fff038704d10872e30c6b7f5376528e424dd73b
3
+ metadata.gz: '0841cbcd204e3167a443244774a3f05a4b692dc6b706b76db7cd3af7943296b1'
4
+ data.tar.gz: ec4b272a9c9102c7fc9643c6d66042ded9ee1e7ed9457f5bd59ea05f835293f2
5
5
  SHA512:
6
- metadata.gz: 44e3afd205bce67d34e40e6b71a5c67b43615dc04acc299f7188f0e01d514844e7b836523a0dcae0e95388b7b38875c76f2ffc012d3a83b316450182b5a2fb36
7
- data.tar.gz: b8b2d440abe90925b5750cf6526b34449d00d913d5bd47a8d74339ce8ba9c5622abe55949b66465ad1f1f0b0972ee26446c258086a98280c94dcdff36b66a229
6
+ metadata.gz: '07229bfc0552894549309bb7b0c54363d59d70d09714cf66ccfc0f71d534c78030e55afceb32129e93d55eee0f1fb17a6b81eb2914986db367708fdfcf66c54d'
7
+ data.tar.gz: 96adaebf03ed7d0ef8f5f127ea1ccefafb6e70690235f6029e52b8fb3c7b4bf96d9e2ff263d41941b168a3b95cc9a8c87805ddffe43a2dfd4178328d05b15bd3
data/CHANGELOG.md CHANGED
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.7.0] - 2026-10-03
9
+
10
+ ### Added
11
+
12
+ - **Releases.** `config.release` (default `ENV["ERRORGAP_RELEASE"]`) is sent
13
+ as `context.release` on every notice, tying errors to the deploy that
14
+ shipped them.
15
+ - **Browser trace links.** The Rack middleware reads the `x-errorgap-trace`
16
+ header sent by `@errorgap/browser` 0.3+ and records it as the transaction's
17
+ `trace_id`, so errorgap links a browser API call to the server request that
18
+ answered it. Only well-formed UUIDs are accepted.
19
+
8
20
  ## [0.6.0] - 2026-10-03
9
21
 
10
22
  ### Added
data/README.md CHANGED
@@ -31,9 +31,18 @@ Errorgap.configure do |config|
31
31
  # Skip reporting entirely (errors and APM) in these environments.
32
32
  # Also configurable via ERRORGAP_IGNORE_ENVIRONMENTS="test,development".
33
33
  config.ignore_environments = %w[test development]
34
+
35
+ # The deployed version or commit (defaults to ERRORGAP_RELEASE). Errors carry
36
+ # it, so errorgap ties each one to the deploy that shipped it.
37
+ config.release = ENV["GIT_SHA"]
34
38
  end
35
39
  ```
36
40
 
41
+ When the errorgap browser SDK is on the page, its API calls send an
42
+ `x-errorgap-trace` header; the Rack middleware records it on the request's
43
+ transaction, so the browser's Performance view links each call to the server
44
+ request that answered it.
45
+
37
46
  ## Manual Notification
38
47
 
39
48
  ```ruby
@@ -16,7 +16,8 @@ module Errorgap
16
16
  :apm_sample_rate,
17
17
  :logs_enabled,
18
18
  :minimum_log_level,
19
- :max_breadcrumbs
19
+ :max_breadcrumbs,
20
+ :release
20
21
 
21
22
  def initialize
22
23
  @endpoint = ENV.fetch("ERRORGAP_ENDPOINT", "http://127.0.0.1:3030")
@@ -33,6 +34,9 @@ module Errorgap
33
34
  @logs_enabled = true
34
35
  @minimum_log_level = "info"
35
36
  @max_breadcrumbs = 25
37
+ # The deployed version or commit: errors are attributed to the deploy
38
+ # that shipped them.
39
+ @release = ENV["ERRORGAP_RELEASE"].to_s.strip.empty? ? nil : ENV["ERRORGAP_RELEASE"].strip
36
40
  end
37
41
 
38
42
  def validate!
@@ -61,6 +61,7 @@ module Errorgap
61
61
  environment: @configuration.environment,
62
62
  root_directory: @configuration.root_directory
63
63
  }
64
+ context[:release] = @configuration.release if @configuration.release
64
65
  causes = collect_causes
65
66
  context[:causes] = causes unless causes.empty?
66
67
  context[:breadcrumbs] = @breadcrumbs unless @breadcrumbs.empty?
@@ -35,6 +35,15 @@ module Errorgap
35
35
  raise
36
36
  end
37
37
 
38
+ UUID = /\A\h{8}-\h{4}-\h{4}-\h{4}-\h{12}\z/
39
+
40
+ # The x-errorgap-trace header a browser SDK sent with this call, linking
41
+ # the browser's view of it to this transaction. Only a well-formed UUID.
42
+ def browser_trace_id(env)
43
+ value = env["HTTP_X_ERRORGAP_TRACE"].to_s.strip
44
+ value.match?(UUID) ? value.downcase : nil
45
+ end
46
+
38
47
  def apm_enabled?
39
48
  Errorgap.configuration.apm_enabled
40
49
  end
@@ -43,6 +52,7 @@ module Errorgap
43
52
  spans = SpanCollector.flush
44
53
  txn = Transaction.new(
45
54
  id: transaction_id,
55
+ trace_id: browser_trace_id(env),
46
56
  kind: "web",
47
57
  method: env["REQUEST_METHOD"],
48
58
  path: route_pattern(env),
@@ -17,7 +17,7 @@ module Errorgap
17
17
  end
18
18
 
19
19
  Transaction = Struct.new(
20
- :id, :kind, :method, :path, :path_raw, :status_code,
20
+ :id, :trace_id, :kind, :method, :path, :path_raw, :status_code,
21
21
  :duration_ms, :environment, :occurred_at, :spans,
22
22
  :job_class, :queue,
23
23
  keyword_init: true
@@ -25,6 +25,7 @@ module Errorgap
25
25
  def to_h
26
26
  {
27
27
  id: id,
28
+ trace_id: trace_id,
28
29
  kind: kind,
29
30
  method: method,
30
31
  path: path,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Errorgap
4
- VERSION = "0.6.0"
4
+ VERSION = "0.7.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: errorgap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Errorgap
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-10-03 00:00:00.000000000 Z
11
+ date: 2026-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake