railswatch_gem 0.4.5 → 0.4.6

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: e1412167d3260e84e0b79c29cb804cbd2367d1c649e628600187ad299515cdd0
4
- data.tar.gz: 03ad36695d1d39f2cbeaf43013b683cc6024fcd3d7c60e9d273b692771c82066
3
+ metadata.gz: 56f90a1cd650436b42cb5dbc1803ab9e06152e81b4aa181e0569b043bfbab027
4
+ data.tar.gz: 7b74205cb09811e2e20c1d4d167cd2645aebc027d850e8343b3e32027127d7da
5
5
  SHA512:
6
- metadata.gz: 4e296fb462b136d7fea292d0656701b03b1b79b6572f9873e3668020aba90b697000a455c37fdf36a54c201cfa43bd8a653e8d009a01bef648d639a454a670a7
7
- data.tar.gz: c7122fa7cadb8ace87b0d95ec06a2ab919f4e196b81edf2e462c832479c35626b633f424773942934580b761549aa6942cc441e5244e4a0089ef4427a44c3c45
6
+ metadata.gz: 6728b84504368b5c935cfbec5cf84e8eb85b1802f755f906e487e881517fa2a562b27941862de2fc55d755548cf84155ffabf63d0eb310f5f6824205e3d9130c
7
+ data.tar.gz: 5ec9b3fa55f72480b0c0095444c69dd945f46412b460c6e5be2f4ace6cd4b96e8682489e03dd0641cb59341b339d42cdbee71a7656f731da2ee1c08a03be8573
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailswatchGem
4
+ module Instrumentation
5
+ module HTTPClients
6
+ def self.install
7
+ install_net_http
8
+ install_faraday
9
+ install_httpclient
10
+ install_excon
11
+ install_typhoeus
12
+ install_httparty
13
+ end
14
+
15
+ private
16
+
17
+ def self.install_net_http
18
+ begin
19
+ require "opentelemetry/instrumentation/net_http"
20
+ instrumentation = OpenTelemetry::Instrumentation::NetHTTP::Instrumentation.instance
21
+ instrumentation.install unless instrumentation.installed?
22
+ Rails.logger.debug "[RailswatchGem] Net::HTTP instrumentation installed" if defined?(Rails.logger)
23
+ rescue LoadError => e
24
+ Rails.logger.debug "[RailswatchGem] Net::HTTP instrumentation not available: #{e.message}" if defined?(Rails.logger)
25
+ rescue => e
26
+ Rails.logger.warn "[RailswatchGem] Failed to install Net::HTTP instrumentation: #{e.message}" if defined?(Rails.logger)
27
+ end
28
+ end
29
+
30
+ def self.install_faraday
31
+ begin
32
+ require "opentelemetry/instrumentation/faraday"
33
+ instrumentation = OpenTelemetry::Instrumentation::Faraday::Instrumentation.instance
34
+ instrumentation.install unless instrumentation.installed?
35
+ Rails.logger.debug "[RailswatchGem] Faraday instrumentation installed" if defined?(Rails.logger)
36
+ rescue LoadError => e
37
+ Rails.logger.debug "[RailswatchGem] Faraday instrumentation not available: #{e.message}" if defined?(Rails.logger)
38
+ rescue => e
39
+ Rails.logger.warn "[RailswatchGem] Failed to install Faraday instrumentation: #{e.message}" if defined?(Rails.logger)
40
+ end
41
+ end
42
+
43
+ def self.install_httpclient
44
+ begin
45
+ require "opentelemetry/instrumentation/httpclient"
46
+ instrumentation = OpenTelemetry::Instrumentation::HTTPClient::Instrumentation.instance
47
+ instrumentation.install unless instrumentation.installed?
48
+ Rails.logger.debug "[RailswatchGem] HTTPClient instrumentation installed" if defined?(Rails.logger)
49
+ rescue LoadError => e
50
+ Rails.logger.debug "[RailswatchGem] HTTPClient instrumentation not available: #{e.message}" if defined?(Rails.logger)
51
+ rescue => e
52
+ Rails.logger.warn "[RailswatchGem] Failed to install HTTPClient instrumentation: #{e.message}" if defined?(Rails.logger)
53
+ end
54
+ end
55
+
56
+ def self.install_excon
57
+ begin
58
+ require "opentelemetry/instrumentation/excon"
59
+ instrumentation = OpenTelemetry::Instrumentation::Excon::Instrumentation.instance
60
+ instrumentation.install unless instrumentation.installed?
61
+ Rails.logger.debug "[RailswatchGem] Excon instrumentation installed" if defined?(Rails.logger)
62
+ rescue LoadError => e
63
+ Rails.logger.debug "[RailswatchGem] Excon instrumentation not available: #{e.message}" if defined?(Rails.logger)
64
+ rescue => e
65
+ Rails.logger.warn "[RailswatchGem] Failed to install Excon instrumentation: #{e.message}" if defined?(Rails.logger)
66
+ end
67
+ end
68
+
69
+ def self.install_typhoeus
70
+ begin
71
+ require "opentelemetry/instrumentation/ethon"
72
+ instrumentation = OpenTelemetry::Instrumentation::Ethon::Instrumentation.instance
73
+ instrumentation.install unless instrumentation.installed?
74
+ Rails.logger.debug "[RailswatchGem] Typhoeus (via Ethon) instrumentation installed" if defined?(Rails.logger)
75
+ rescue LoadError => e
76
+ Rails.logger.debug "[RailswatchGem] Typhoeus instrumentation not available: #{e.message}" if defined?(Rails.logger)
77
+ rescue => e
78
+ Rails.logger.warn "[RailswatchGem] Failed to install Typhoeus instrumentation: #{e.message}" if defined?(Rails.logger)
79
+ end
80
+ end
81
+
82
+ def self.install_httparty
83
+ begin
84
+ require "opentelemetry/instrumentation/httparty"
85
+ instrumentation = OpenTelemetry::Instrumentation::HTTParty::Instrumentation.instance
86
+ instrumentation.install unless instrumentation.installed?
87
+ Rails.logger.debug "[RailswatchGem] HTTParty instrumentation installed" if defined?(Rails.logger)
88
+ rescue LoadError => e
89
+ Rails.logger.debug "[RailswatchGem] HTTParty instrumentation not available: #{e.message}" if defined?(Rails.logger)
90
+ rescue => e
91
+ Rails.logger.warn "[RailswatchGem] Failed to install HTTParty instrumentation: #{e.message}" if defined?(Rails.logger)
92
+ end
93
+ end
94
+ end
95
+ end
96
+ end
97
+
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailswatchGem
4
- VERSION = "0.4.5"
4
+ VERSION = "0.4.6"
5
5
  end
@@ -6,6 +6,7 @@ require "railswatch_gem/helpers"
6
6
  require "railswatch_gem/instrumentation/ai_helper"
7
7
  require "railswatch_gem/instrumentation/openai"
8
8
  require "railswatch_gem/instrumentation/anthropic"
9
+ require "railswatch_gem/instrumentation/http_clients"
9
10
 
10
11
  require "opentelemetry/sdk"
11
12
  require "opentelemetry/exporter/otlp"
@@ -54,7 +55,11 @@ module RailswatchGem
54
55
  c.use_all
55
56
  end
56
57
 
58
+ # Install custom instrumentations
57
59
  RailswatchGem::Instrumentation::OpenAI.install
60
+ RailswatchGem::Instrumentation::Anthropic.install
61
+ RailswatchGem::Instrumentation::HTTPClients.install
62
+
58
63
  @started = true
59
64
  puts "[Railswatch] Observability started for #{config.service_name} (JSON/Gzip)"
60
65
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railswatch_gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler Hammett
@@ -78,6 +78,7 @@ files:
78
78
  - lib/railswatch_gem/helpers.rb
79
79
  - lib/railswatch_gem/instrumentation/ai_helper.rb
80
80
  - lib/railswatch_gem/instrumentation/anthropic.rb
81
+ - lib/railswatch_gem/instrumentation/http_clients.rb
81
82
  - lib/railswatch_gem/instrumentation/openai.rb
82
83
  - lib/railswatch_gem/query_source_processor.rb
83
84
  - lib/railswatch_gem/railtie.rb