octri 1.0.0 → 1.0.1

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +18 -0
  3. data/README.md +19 -17
  4. data/lib/octri.rb +11 -5
  5. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7710dbc38e8c6678e6e5a38456e0dfdf26ce8098b580e5cad6a00ed7ef210e2
4
- data.tar.gz: b3496fdae687f5e386361fa122bf61d80af342a2d22a6cc239cccbc2c74fcb9c
3
+ metadata.gz: 0bae18c311de3d67d561b38c42c0c32ec50dd6cdbdd69fbb33671658fb0bb1c4
4
+ data.tar.gz: fb7db736fa76a53ddbf395d2bcc94b539e7cb04b1fb3c4d67103d6b60651e3b3
5
5
  SHA512:
6
- metadata.gz: cd2be05e16cd704c0e1118dbf477b632e764c3cc5f770f3ce6fbfb821b72d67a97ecf912b2d12ab1e15239fa247ed15947d61e830c1da0d5c7d32abd23f66893
7
- data.tar.gz: 6d0783dd74030d6657e45b7c507add769195eeab6d07bf9024e4b2c79e3f4ab9dbc5b58d1228d2cfc38bc2a16790f3780a8b8579729ae46713704f44dcef3556
6
+ metadata.gz: 76178a0d41df4536d8beb2b7a7a00c007414f618783795dbc9aa511977a037015f531275f5719d8ede4765a9174dc8b587faf5e398a3c379a0dc5ed66f4f066d
7
+ data.tar.gz: 35cdb51b77150bfe8f23b0e0827b3758d3e327137a85728208fabae9c2e775c5708d483451e67697d4b0919e6f8600c021988e9225eb9df93886349b1c617c29
data/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # Changelog
2
+
3
+ ## 1.0.1
4
+
5
+ - Source context is now read only for frames in your own code, skips files
6
+ over 512 KB, and keeps a bounded cache, so a deep or unusual stack cannot
7
+ pull dependency source into a report or grow memory without limit.
8
+
9
+ ## 1.0.0
10
+
11
+ First public release.
12
+
13
+ - Error reporting with original source context for each in-app stack frame.
14
+ - Request and sub-span timing, drawn as a waterfall in the dashboard.
15
+ - W3C `traceparent` propagation, so a server error links to the client SDK
16
+ error for the same request.
17
+ - Standalone events with idempotent, best-effort delivery.
18
+ - Rack middleware for Rack and Rails, plus automatic instrumentation of outbound HTTP.
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  or Rails with original-source context per stack frame, time every request and any
5
5
  sub-span you open into a waterfall, and join each server error to the client SDK
6
6
  error for the same request through the W3C `traceparent` header. In the
7
- dashboard you see the full client → server stack under one trace.
7
+ dashboard you see the full client and server stack under one trace.
8
8
 
9
9
  Octri turns an OpenAPI spec into a documentation site, client SDKs for ten
10
10
  languages, an MCP server your AI assistant can call, and monitoring for the
@@ -70,7 +70,7 @@ Octri.instrument(cache, [:get, :set], op: "cache")
70
70
  ```
71
71
 
72
72
  Every instrumented call (and every outbound HTTP request) becomes a sub-span
73
- under the current request — no per-call code. Calls to your monitoring backend
73
+ under the current request, with no per-call code. Calls to your monitoring backend
74
74
  are never traced (no feedback loop).
75
75
 
76
76
  ## Sub-spans (where time goes)
@@ -86,7 +86,7 @@ value = cache.read(key)
86
86
  s.finish
87
87
  ```
88
88
 
89
- `op` ("db", "cache", "http", …) color-codes the waterfall; nested `Octri.span`
89
+ `op` ("db", "cache", "http", and so on) color-codes the waterfall; nested `Octri.span`
90
90
  calls nest correctly.
91
91
 
92
92
  ## Manual error capture
@@ -113,19 +113,21 @@ end
113
113
 
114
114
  ### Monitoring runtimes
115
115
 
116
- [Node](https://github.com/octridev/octri-node) ·
117
- [Python](https://github.com/octridev/octri-python) ·
118
- [Go](https://github.com/octridev/octri-go) ·
119
- [Ruby](https://github.com/octridev/octri-ruby) ·
120
- [Rust](https://github.com/octridev/octri-rust) ·
121
- [PHP](https://github.com/octridev/octri-php) ·
122
- [Java](https://github.com/octridev/octri-java) ·
123
- [Kotlin](https://github.com/octridev/octri-kotlin) ·
124
- [Swift](https://github.com/octridev/octri-swift) ·
125
- [Dart](https://github.com/octridev/octri-dart)
126
-
127
- [Documentation](https://docs.octri.dev/docs) ·
128
- [Pricing](https://octri.dev/pricing) ·
129
- [Changelog](https://docs.octri.dev/changelog)
116
+ - [Node](https://github.com/octridev/octri-node)
117
+ - [Python](https://github.com/octridev/octri-python)
118
+ - [Go](https://github.com/octridev/octri-go)
119
+ - [Ruby](https://github.com/octridev/octri-ruby)
120
+ - [Rust](https://github.com/octridev/octri-rust)
121
+ - [PHP](https://github.com/octridev/octri-php)
122
+ - [Java](https://github.com/octridev/octri-java)
123
+ - [Kotlin](https://github.com/octridev/octri-kotlin)
124
+ - [Swift](https://github.com/octridev/octri-swift)
125
+ - [Dart](https://github.com/octridev/octri-dart)
126
+
127
+ ### More
128
+
129
+ - [Documentation](https://docs.octri.dev/docs)
130
+ - [Pricing](https://octri.dev/pricing)
131
+ - [Changelog](https://docs.octri.dev/changelog)
130
132
 
131
133
  MIT licensed.
data/lib/octri.rb CHANGED
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Octri — server-side error monitoring for Ruby backends.
3
+ # Octri: server-side error monitoring for Ruby backends.
4
4
  #
5
5
  # Add it to your live API; it reports backend errors to your Octri monitoring
6
6
  # project (with original-source context per stack frame) and links each one to
7
- # the client SDK error for the same request via the W3C `traceparent` header —
7
+ # the client SDK error for the same request via the W3C `traceparent` header,
8
8
  # so the dashboard shows the full client -> server stack under one trace. It also
9
9
  # times requests (and any sub-spans you open) into the request waterfall.
10
10
  #
@@ -24,6 +24,8 @@ module Octri
24
24
  Trace = Struct.new(:trace_id, :parent_span_id)
25
25
 
26
26
  CONTEXT_LINES = 5
27
+ MAX_SOURCE_BYTES = 512 * 1024
28
+ MAX_CACHED_SOURCES = 256
27
29
  REQUEST_TIMEOUT_SECONDS = 5
28
30
  MAX_IDEMPOTENCY_KEY_LENGTH = 256
29
31
  TRACEPARENT_RE = /\A00-([0-9a-f]{32})-([0-9a-f]{16})-[0-9a-f]{2}\z/i.freeze
@@ -224,7 +226,7 @@ module Octri
224
226
  Time.now.utc.iso8601(3)
225
227
  end
226
228
 
227
- # True when host:port is the monitoring backend — used to avoid tracing our
229
+ # True when host:port is the monitoring backend, used to avoid tracing our
228
230
  # own reporting requests (which would recurse).
229
231
  def monitoring_endpoint?(host, port)
230
232
  return false if @config.nil? || @config.url.nil?
@@ -292,7 +294,8 @@ module Octri
292
294
  path = loc.absolute_path || loc.path
293
295
  lineno = loc.lineno
294
296
  frame = { function: loc.label, filename: path, lineno: lineno, colno: 0, inApp: in_app?(path) }
295
- lines = read_source(path)
297
+ # Only your own files: the dashboard shows them, gem source is noise.
298
+ lines = frame[:inApp] ? read_source(path) : nil
296
299
  if lines && lineno >= 1 && lineno <= lines.length
297
300
  idx = lineno - 1
298
301
  frame[:contextLine] = lines[idx]
@@ -319,10 +322,13 @@ module Octri
319
322
  return @source_cache[path] if @source_cache.key?(path)
320
323
 
321
324
  lines = begin
322
- File.readlines(path, chomp: true)
325
+ # Big files are skipped, not truncated, so line numbers keep lining up.
326
+ File.size(path) <= MAX_SOURCE_BYTES ? File.readlines(path, chomp: true) : nil
323
327
  rescue StandardError
324
328
  nil
325
329
  end
330
+ # A stack can name any number of files, so the cache is bounded too.
331
+ @source_cache.shift if @source_cache.size >= MAX_CACHED_SOURCES
326
332
  @source_cache[path] = lines
327
333
  lines
328
334
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octri
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Octri
@@ -16,6 +16,7 @@ executables: []
16
16
  extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
+ - CHANGELOG.md
19
20
  - LICENSE
20
21
  - README.md
21
22
  - lib/octri.rb