forge_ops_tracker 0.21.0 → 0.22.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: c51ad9b51fd30d2f2524c60fabb955dbd2840a756138a4cf4b9cda47dbd56b49
4
- data.tar.gz: 8a4b895fa3ba817ea0d352cfaaedfd5dc083e4abf69fb25020a523b890ded319
3
+ metadata.gz: e7d188230dabf677fd36901f2dc5fa06087a101a2a6a1cac1254926f8908692b
4
+ data.tar.gz: adf0303ee68a7f629efb58fed79b03d9b44f94f8a1be3f3b66c8192ef1a02f91
5
5
  SHA512:
6
- metadata.gz: 22e8833e29f4de32284cb8203d135dff386a50845de5235c52ab3a39a5574448a2e14e4e85cada210f1b2a44f0367193d1d6d96e97764f0cb3650b1d31a600af
7
- data.tar.gz: 31f1973e9840e5b7396ce7a96fc757288468cb50f65b7ba6de5f8bef6625a7211eb340e0fe6043f644602532a708cfb2d6c2c3453c879c9306e40e2fd7eecfe5
6
+ metadata.gz: ca4daee44d94287061c5ca2acd2eb99e723e5e2b8703b318a13d9a756a1f378cfea3fdaf750bd29eacfb03dc8457167a7f5e81b05b772138c2325d4dde3a2802
7
+ data.tar.gz: 2d4b2b0fc99fd80bf9b3dc1e8c97d958ed140e830a8a9969f990b6b92f1538960cbb951212fb341b5c4af5d4b284f8990ec5fba3148aaa588126a6aa17761b93
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.22.0 (2026-10-28)
4
+
5
+ - `config.trace_ignore_paths`: requests whose path starts with one of these prefixes are never traced, however
6
+ slow, for health checks or anything else not worth a trace.
7
+
3
8
  ## 0.21.0 (2026-10-23)
4
9
 
5
10
  - PII scrubbing catches card numbers however they're grouped (bare, 4-4-4-4, Amex's 4-6-5, or next to a
data/README.md CHANGED
@@ -446,6 +446,7 @@ A fast, successful request never sends anything.
446
446
  ForgeOpsTracker.configure do |config|
447
447
  config.track_tracing = false # opt out of recording spans entirely
448
448
  config.trace_capture_threshold_ms = 500 # default 1000
449
+ config.trace_ignore_paths = [ "/health" ] # never trace requests under these path prefixes
449
450
  end
450
451
  ```
451
452
 
@@ -16,7 +16,7 @@ module ForgeOpsTracker
16
16
  attr_accessor :track_failures, :failure_event_flush_interval
17
17
  attr_accessor :metric_flush_interval, :infrastructure_metric_flush_interval
18
18
  attr_accessor :gauge_poll_interval
19
- attr_accessor :track_tracing, :trace_capture_threshold_ms
19
+ attr_accessor :track_tracing, :trace_capture_threshold_ms, :trace_ignore_paths
20
20
  attr_accessor :explain_slow_queries, :explain_threshold_ms
21
21
  attr_accessor :propagate_traces, :trace_propagation_targets
22
22
  attr_accessor :detect_changes, :track_env_var_names
@@ -129,6 +129,10 @@ module ForgeOpsTracker
129
129
  # PerformanceSample-derived threshold elsewhere in this gem: those describe a trend across
130
130
  # many requests, this describes a single one being outright slow.
131
131
  @trace_capture_threshold_ms = 1_000
132
+ # Requests whose path starts with one of these are never traced at all. For an app that
133
+ # reports to itself (ForgeOps on ForgeOps), its own ingestion endpoints: storing a slow trace
134
+ # is a slow request, whose trace would be sent back to be stored, and so on.
135
+ @trace_ignore_paths = []
132
136
  # Opt-in: for a SELECT on PostgreSQL that took at least explain_threshold_ms, ask Postgres for
133
137
  # its plan (plain EXPLAIN, never EXPLAIN ANALYZE, so the query is never run again) and send
134
138
  # it, masked, so ForgeOps can show why the query was slow. Off by default because it runs one
@@ -34,6 +34,7 @@ module ForgeOpsTracker
34
34
 
35
35
  def call(env)
36
36
  return app.call(env) unless configuration.track_tracing && configuration.enabled?
37
+ return app.call(env) if ignored_path?(env)
37
38
 
38
39
  state = RequestState.for(env)
39
40
  buffer = SpanBuffer.new(trace_id: state.trace_id, parent_span_id: state.parent_span_id)
@@ -49,6 +50,11 @@ module ForgeOpsTracker
49
50
  private
50
51
  attr_reader :app, :configuration
51
52
 
53
+ def ignored_path?(env)
54
+ path = env["PATH_INFO"].to_s
55
+ Array(configuration.trace_ignore_paths).any? { |prefix| path.start_with?(prefix) }
56
+ end
57
+
52
58
  def send_trace?(buffer, state)
53
59
  return true if buffer.slow?(configuration.trace_capture_threshold_ms)
54
60
 
@@ -1,3 +1,3 @@
1
1
  module ForgeOpsTracker
2
- VERSION = "0.21.0"
2
+ VERSION = "0.22.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forge_ops_tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ForgeOps