foam-ruby 0.1.0.alpha5 → 0.1.0.alpha6

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: 57eba0f562797a93af9440bf8cc80c2e80009200837d5ac647e01c832a85e07e
4
- data.tar.gz: 9c68ec68a95f652a90840cb21c285746ca317724c92b10ba272e25708210104e
3
+ metadata.gz: '039cdc9710beb8c5ebc5caf48a4d26ebc906af5843a2effcaa6e23516de0a5e0'
4
+ data.tar.gz: 239ff4c8bfcaf6d56659bdb306cdabf93452c8db7713772bdfe4ef37080b326d
5
5
  SHA512:
6
- metadata.gz: 2f8f50ce67167cdb2e48382c6166abd767b22aa86b6ff01cc3762fa5fa8305cea5ce766b06877c6a257878b6e52c64cb063fc521e2f7b3a3cf41645e9fd306e7
7
- data.tar.gz: 8ab6d387a971d5111e3ee7b864715eb15872ab976e5ab7f06a215b0d3e6c943e401050a883f725f35bfb46d4c8e6db1760eb40d2236da586d78cf76b267b8e9e
6
+ metadata.gz: 73478d74ae9823f7c9c88f58da21f1eab4fe6338d67e25b847d83f024b86229217f6a41170f1799161670680b45cfa4e602ba2dea9c06fe53282159afab56bd7
7
+ data.tar.gz: 654295ea96663ef4399f01ccb6d98bc6fa17f2eac3f6cc81523e8a9f6f6de7ca0bec0f23743b9c241d1c961ebc38d3ef0c268ee42868c64843474ffc9630496c
data/README.md CHANGED
@@ -43,17 +43,6 @@ That's it. The gem will:
43
43
  | `OTEL_SERVICE_NAME` | Service name for telemetry | `rails-app` |
44
44
  | `FOAM_OTEL_ENDPOINT` | OTLP collector endpoint | `https://otel.api.foam.ai` |
45
45
 
46
- ### Disabling signals
47
-
48
- ```ruby
49
- Foam::Ruby.init(
50
- token: ENV["FOAM_API_TOKEN"],
51
- service_name: "my-rails-app",
52
- traces: false, # disable trace collection
53
- logs: true
54
- )
55
- ```
56
-
57
46
  ## How It Works
58
47
 
59
48
  ### Rails.logger → OTel Logs
@@ -5,15 +5,12 @@ module Foam
5
5
  class Configuration
6
6
  FOAM_OTEL_ENDPOINT = "https://otel.api.foam.ai"
7
7
 
8
- attr_accessor :token, :service_name, :endpoint,
9
- :traces_enabled, :logs_enabled
8
+ attr_accessor :token, :service_name, :endpoint
10
9
 
11
10
  def initialize
12
11
  @token = ENV["FOAM_API_TOKEN"]
13
12
  @service_name = ENV.fetch("OTEL_SERVICE_NAME", "rails-app")
14
13
  @endpoint = ENV.fetch("FOAM_OTEL_ENDPOINT", FOAM_OTEL_ENDPOINT)
15
- @traces_enabled = true
16
- @logs_enabled = true
17
14
  end
18
15
 
19
16
  def otel_headers
@@ -12,8 +12,8 @@ module Foam
12
12
  module_function
13
13
 
14
14
  def configure!(config)
15
- configure_traces(config) if config.traces_enabled
16
- configure_logs(config) if config.logs_enabled
15
+ configure_traces(config)
16
+ configure_logs(config)
17
17
  end
18
18
 
19
19
  def configure_traces(config)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Foam
4
4
  module Ruby
5
- VERSION = "0.1.0.alpha5"
5
+ VERSION = "0.1.0.alpha6"
6
6
  end
7
7
  end
data/lib/foam/ruby.rb CHANGED
@@ -10,15 +10,12 @@ module Foam
10
10
  @initialized == true
11
11
  end
12
12
 
13
- def init(token: nil, service_name: nil, endpoint: nil, **options)
13
+ def init(token: nil, service_name: nil)
14
14
  return unless production?
15
15
 
16
16
  config = configuration
17
17
  config.token = token if token
18
18
  config.service_name = service_name if service_name
19
- config.endpoint = endpoint if endpoint
20
- config.traces_enabled = options.fetch(:traces, true)
21
- config.logs_enabled = options.fetch(:logs, true)
22
19
 
23
20
  unless config.valid?
24
21
  warn "[foam-ruby] Missing token — set FOAM_API_TOKEN or pass token: to Foam::Ruby.init"
@@ -29,7 +26,7 @@ module Foam
29
26
  require_relative "ruby/log_subscriber"
30
27
 
31
28
  OtelSetup.configure!(config)
32
- schedule_logger_attach! if config.logs_enabled
29
+ schedule_logger_attach!
33
30
  bridge_sentry!
34
31
  @initialized = true
35
32
  rescue Exception => e # rubocop:disable Lint/RescueException
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foam-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha5
4
+ version: 0.1.0.alpha6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foam