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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +3 -3
- data/lib/coolhand/ruby/api_service.rb +1 -1
- data/lib/coolhand/ruby/interceptor.rb +15 -14
- data/lib/coolhand/ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 04f5762e1c9b3dad57c3b65fbe6860a0394fd793f49e67538eaf8c68584ccae5
|
|
4
|
+
data.tar.gz: d666c068c33af71f895228030d6342008ccdae290de4c603dec687cf07b5645d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 [
|
|
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 [
|
|
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://
|
|
383
|
+
- **API Docs**: [API Documentation](https://coolhandlabs.com/docs) - Direct API integration documentation
|
|
384
384
|
|
|
385
385
|
## Community
|
|
386
386
|
|
|
@@ -5,32 +5,33 @@ module Coolhand
|
|
|
5
5
|
ORIGINAL_METHOD_ALIAS = :coolhand_original_initialize
|
|
6
6
|
|
|
7
7
|
def self.patch!
|
|
8
|
-
return if
|
|
8
|
+
return if @patched
|
|
9
9
|
|
|
10
|
+
@patched = true
|
|
10
11
|
Coolhand.log "📡 Monitoring outbound requests ..."
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
+
super
|
|
17
17
|
|
|
18
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
33
|
+
def self.patched?
|
|
34
|
+
@patched
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
def call(env)
|
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
|
+
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-
|
|
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.
|