railswatch_gem 0.2.1 → 0.2.2
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/lib/railswatch_gem/version.rb +1 -1
- data/lib/railswatch_gem.rb +3 -9
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ab1600349c2d7702f4e7972b165296254f2aefcb5b4714bb7a45dd286f180065
|
|
4
|
+
data.tar.gz: d1a43e912c06c23a56d32872bc9ccf31bb691ff66960c49dd02c6c736ad3b7e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 57cec176ed6376bc0ea49d46fe04c2c288e1fef27b7d67c97ea8b2451b2a15d03133ab010bcab193a59e0f550435407206c29a9127aeb33f670a66832c245bc7
|
|
7
|
+
data.tar.gz: 981333528bdad9a2e4fb5eaaeff5c155f2d3655a672a66afc6d516686f823429255e2e95942b975dbc91e501e119f8947f68333ae34b441fd0b430c45b827726
|
data/lib/railswatch_gem.rb
CHANGED
|
@@ -29,32 +29,26 @@ module RailswatchGem
|
|
|
29
29
|
return unless config.enabled
|
|
30
30
|
return if @started
|
|
31
31
|
|
|
32
|
-
# 1. Initialize OpenTelemetry SDK
|
|
33
32
|
OpenTelemetry::SDK.configure do |c|
|
|
34
33
|
c.service_name = config.service_name
|
|
35
34
|
|
|
36
|
-
# 2. Add the OTLP Exporter
|
|
37
|
-
# We use BatchSpanProcessor for performance (buffers traces)
|
|
38
35
|
c.add_span_processor(
|
|
39
36
|
OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(
|
|
40
37
|
OpenTelemetry::Exporter::OTLP::Exporter.new(
|
|
41
38
|
endpoint: config.ingest_url,
|
|
42
39
|
headers: { "X-Railswatch-Token" => config.api_key },
|
|
43
|
-
protocol:
|
|
44
|
-
compression:
|
|
40
|
+
protocol: :http_json,
|
|
41
|
+
compression: :gzip
|
|
45
42
|
)
|
|
46
43
|
)
|
|
47
44
|
)
|
|
48
45
|
|
|
49
|
-
# 3. Enable Standard Instrumentation (Rails, Sidekiq, PG, Redis, etc.)
|
|
50
46
|
c.use_all
|
|
51
47
|
end
|
|
52
48
|
|
|
53
|
-
# 4. Enable Custom AI Instrumentation
|
|
54
49
|
RailswatchGem::Instrumentation::OpenAI.install
|
|
55
|
-
|
|
56
50
|
@started = true
|
|
57
|
-
puts "[Railswatch] Observability started for #{config.service_name}"
|
|
51
|
+
puts "[Railswatch] Observability started for #{config.service_name} (JSON/Gzip)"
|
|
58
52
|
end
|
|
59
53
|
end
|
|
60
54
|
end
|