coolhand 0.1.4 → 0.1.5

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: 4b8242433c93dec62fb833fc641c5917f6bb68c01e59e3061f2ac6300ec674c5
4
- data.tar.gz: 7e6019bc86a3268df2ddebf4e0a9cfcabd32a72e3e8618a473c2035921aa0ff0
3
+ metadata.gz: 04f5762e1c9b3dad57c3b65fbe6860a0394fd793f49e67538eaf8c68584ccae5
4
+ data.tar.gz: d666c068c33af71f895228030d6342008ccdae290de4c603dec687cf07b5645d
5
5
  SHA512:
6
- metadata.gz: 2255984a1e9238a8bfd1fedecf19aece7a552b25635873ec51803390ae679d206eb69dd0ff31d9df3d6169d78d9ba7503321eaf4bd048b2e59d3337b5c05758c
7
- data.tar.gz: 44a5dc44c6a74385adf1e70057bf49f463c0401bea5f69b5850d697b414292fe0f9ebe208903f46325db80e0a638bf548c4a1dfcebe0d3b808f67a32b2167cdf
6
+ metadata.gz: 4a9de9973617ef1a0816811a5d29dc43ebdda8eb11540474d15e350670a675f4826ff6d9eac56aad5e82dbebdeb50a812ab8bc96d8a16a9f522d27294e6f8035
7
+ data.tar.gz: 382033854564a57ced160afad00bec423d551a2aaeda70a69cfc9a1a2eaf83843dfe6c3479ca3733ff71a436516032a06c0d1b7dc7f8bc937bd49e5376f51049
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ 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.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.5] - 2024-12-09
9
+
10
+ ### 🐛 Critical Bug Fixes
11
+ - **Fixed SystemStackError with APM tools** - Resolved critical conflict with Datadog and other APM tools that caused applications to crash on startup with "stack level too deep" error
12
+ - **Replaced alias_method with prepend** - Changed monkey-patching approach from `alias_method` to `prepend` for better compatibility with other instrumentation libraries
13
+ - **Added duplicate interceptor prevention** - Ensures only one Coolhand interceptor is added to each Faraday connection
14
+
8
15
  ## [0.1.3] - 2024-10-23
9
16
 
10
17
  ### ✨ New Features
data/README.md CHANGED
@@ -10,7 +10,7 @@ gem 'coolhand'
10
10
 
11
11
  ## Getting Started
12
12
 
13
- 1. **Get API Key**: Visit [coolhand.io](https://coolhand.io/) to create a free account
13
+ 1. **Get API Key**: Visit [coolhandlabs.com](https://coolhandlabs.com/) to create a free account
14
14
  2. **Install**: `gem install coolhand`
15
15
  3. **Initialize**: Add configuration to your Ruby application
16
16
  4. **Configure**: Set your API key in the configuration block
@@ -351,7 +351,7 @@ end
351
351
 
352
352
  ## API Key
353
353
 
354
- 🆓 **Sign up for free** at [coolhand.io](https://coolhand.io/) to get your API key and start monitoring your LLM usage.
354
+ 🆓 **Sign up for free** at [coolhandlabs.com](https://coolhandlabs.com/) to get your API key and start monitoring your LLM usage.
355
355
 
356
356
  **What you get:**
357
357
  - Complete LLM request and response logging
@@ -380,7 +380,7 @@ The monitor handles errors gracefully:
380
380
  ## Other Languages
381
381
 
382
382
  - **Node.js**: [coolhand-node package](https://github.com/coolhand-io/coolhand-node) - Coolhand monitoring for Node.js applications
383
- - **API Docs**: [API Documentation](https://coolhand.io/docs) - Direct API integration documentation
383
+ - **API Docs**: [API Documentation](https://coolhandlabs.com/docs) - Direct API integration documentation
384
384
 
385
385
  ## Community
386
386
 
@@ -8,7 +8,7 @@ require_relative "collector"
8
8
  module Coolhand
9
9
  module Ruby
10
10
  class ApiService
11
- BASE_URI = "https://coolhand.io/api"
11
+ BASE_URI = "https://coolhandlabs.com/api"
12
12
 
13
13
  attr_reader :api_endpoint
14
14
 
@@ -5,32 +5,33 @@ module Coolhand
5
5
  ORIGINAL_METHOD_ALIAS = :coolhand_original_initialize
6
6
 
7
7
  def self.patch!
8
- return if Faraday::Connection.private_method_defined?(ORIGINAL_METHOD_ALIAS)
8
+ return if @patched
9
9
 
10
+ @patched = true
10
11
  Coolhand.log "📡 Monitoring outbound requests ..."
11
12
 
12
- Faraday::Connection.class_eval do
13
- alias_method ORIGINAL_METHOD_ALIAS, :initialize
14
-
13
+ # Use prepend instead of alias_method to avoid conflicts with other gems
14
+ Faraday::Connection.prepend(Module.new do
15
15
  def initialize(url = nil, options = nil, &block)
16
- send(ORIGINAL_METHOD_ALIAS, url, options, &block)
16
+ super
17
17
 
18
- use Interceptor
18
+ # Only add interceptor if it's not already present
19
+ use Coolhand::Interceptor unless @builder.handlers.any? { |h| h.klass == Coolhand::Interceptor }
19
20
  end
20
- end
21
+ end)
21
22
 
22
23
  Coolhand.log "🔧 Setting up monitoring for Faraday ..."
23
24
  end
24
25
 
25
26
  def self.unpatch!
26
- return unless Faraday::Connection.private_method_defined?(ORIGINAL_METHOD_ALIAS)
27
-
28
- Faraday::Connection.class_eval do
29
- alias_method :initialize, ORIGINAL_METHOD_ALIAS
30
- remove_method ORIGINAL_METHOD_ALIAS
31
- end
27
+ # NOTE: With prepend, there's no clean way to unpatch
28
+ # We'll mark it as unpatched so it can be re-patched
29
+ @patched = false
30
+ Coolhand.log "🔌 Faraday monitoring disabled ..."
31
+ end
32
32
 
33
- Coolhand.log "🔌 Faraday unpatched ..."
33
+ def self.patched?
34
+ @patched
34
35
  end
35
36
 
36
37
  def call(env)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Coolhand
4
4
  module Ruby
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coolhand
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Carroll
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2025-12-06 00:00:00.000000000 Z
12
+ date: 2025-12-09 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A Ruby gem to automatically monitor and log external LLM requests. It
15
15
  patches Net::HTTP to capture request and response data.