foam-otel 1.0.0 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb0ea8b43b76506cdd72000ba735c36e0bd903b26d83347779cca5fc309b716b
4
- data.tar.gz: 1a35c9ee39299519c146efb826aa9c02598df6ca23e018b0d8c8e62932a9e234
3
+ metadata.gz: 55498709d9b6b79c84356755456455766ce4cc3293174efce14e21e4666a19d2
4
+ data.tar.gz: f7e5a00c801883644e33995415c538ae0410cd52926515be110c35803dfe7222
5
5
  SHA512:
6
- metadata.gz: e689868d02fc414fa6d05eddbc2cb73dd9b5b13b4819a68c669c1fb183bfdea8086e75bd2468661b44e2677f381369d6c3a815e5a0135e7ed9c22a8c86a7bb95
7
- data.tar.gz: fc80c105460917ad1c126604cf6c092c61d7a8c4263ce00d9296a16911f9b25412ee0d5f132619307ebb8862ff4af03c28794935f4758a3a19ad7b5894f4bbd0
6
+ metadata.gz: fbc098c14d51948a8849f4f1fd8522876fcde089a1e065bded46547d4298148c8465c4d630803ace66aa7d38612f4a07f20ad1c921eea8dfeeb24ea99bb76a69
7
+ data.tar.gz: 3d19f5acc8ab0acd77d3ce0f0f851cd84edcb24afa84335d283ace4680e648a50b4720d3117c93bdd5a9c2edce6755a5c3a0ff6d13e0b904cfb30f3e2cd14930
data/README.md CHANGED
@@ -48,7 +48,7 @@ Foam::Otel.init(
48
48
  name: "checkout-api", # → service.name
49
49
  environment: ENV.fetch("APP_ENV", "development"), # → deployment.environment.name (verbatim)
50
50
  enabled: !%w[test ci].include?(ENV["APP_ENV"]), # silence tests/CI; export everywhere else
51
- token: ENV.fetch("FOAM_TOKEN"), # required WHEN enabled — wire it explicitly
51
+ token: ENV.fetch("FOAM_OTEL_TOKEN"), # required WHEN enabled — wire it explicitly
52
52
  version: ENV["GIT_SHA"] # → service.version (recommended; optional)
53
53
  )
54
54
  ```
@@ -68,7 +68,7 @@ now flows to foam, with the redaction floor applied on the wire.
68
68
  | `name:` | String | yes | — | `service.name`. Blank → raises at boot. |
69
69
  | `environment:` | String | yes | — | `deployment.environment.name`, exported verbatim. A value outside `{production, staging, development, test}` warns but is never rewritten. Blank → raises. |
70
70
  | `enabled:` | Boolean | yes | — | The config switch. `false` = fully inert (no SDK, no providers, no network, helpers no-op). `true` = export, in EVERY environment. No default — you write the logic. |
71
- | `token:` | String | when enabled | — | `Authorization: Bearer` for export. Required (and validated) only when `enabled: true`; wired explicitly from your secret source — never an env fallback. Blank while enabled → raises at boot. |
71
+ | `token:` | String | when enabled | — | `Authorization: Bearer` for export. Required (and validated) only when `enabled: true`; wired explicitly from your secret source — never an env fallback read by the gem. **Fleet convention: read it from the `FOAM_OTEL_TOKEN` env var.** Blank while enabled → raises at boot. |
72
72
  | `version:` | String | no | nil | `service.version`, verbatim (git SHA recommended). Missing → warns and continues. Never detected at runtime. |
73
73
  | `redact_keys:` | Array<String> | no | `[]` | Extra field names treated as SECRETS (tail-masked). EXTENDS the always-on floor. |
74
74
  | `redact_pii_keys:` | Array<String> | no | `[]` | Field names treated as PII (full `[REDACTED]`, no tail). Foam ships no PII preset — this is your enumeration. |
@@ -165,7 +165,7 @@ Disjoint pipelines: foam runs its own beside the agent, touching nothing. Add th
165
165
  agent's intake host so foam's outbound instrumentation doesn't shadow its egress.
166
166
 
167
167
  ```ruby
168
- Foam::Otel.init(name: "checkout-api", environment: env, enabled: true, token: FOAM_TOKEN,
168
+ Foam::Otel.init(name: "checkout-api", environment: env, enabled: true, token: FOAM_OTEL_TOKEN,
169
169
  ignored_outbound_hosts: ["trace.agent.datadoghq.com"])
170
170
  ```
171
171
 
@@ -175,7 +175,7 @@ Attach the tenant's processor via the seam, and add its exporter host to the
175
175
  ignore list (its exports would otherwise be shadow-spanned into a loop).
176
176
 
177
177
  ```ruby
178
- Foam::Otel.init(name: "checkout-api", environment: env, enabled: true, token: FOAM_TOKEN,
178
+ Foam::Otel.init(name: "checkout-api", environment: env, enabled: true, token: FOAM_OTEL_TOKEN,
179
179
  additional_span_processors: [EvalTool::SpanProcessor.new(project: "prod")],
180
180
  ignored_outbound_hosts: ["ingest.eval-tool.example"])
181
181
  ```
@@ -198,7 +198,7 @@ Signals are independent. A foreign SDK owning only traces still gets foam for
198
198
  metrics and logs on the full contract:
199
199
 
200
200
  ```ruby
201
- Foam::Otel.init(name: "checkout-api", environment: env, enabled: true, token: FOAM_TOKEN)
201
+ Foam::Otel.init(name: "checkout-api", environment: env, enabled: true, token: FOAM_OTEL_TOKEN)
202
202
  # → warns: traces foreign-owned (foam dark for traces); metrics + logs → foam, full contract.
203
203
  ```
204
204
 
@@ -211,7 +211,7 @@ Foam::Otel.init(name: "checkout-api", environment: "test", enabled: false)
211
211
  ### Scenario 7 — serverless / short-lived (flush at the end)
212
212
 
213
213
  ```ruby
214
- Foam::Otel.init(name: "orders-fn", environment: "production", enabled: true, token: FOAM_TOKEN)
214
+ Foam::Otel.init(name: "orders-fn", environment: "production", enabled: true, token: FOAM_OTEL_TOKEN)
215
215
 
216
216
  def handler(event:, context:)
217
217
  run(event)
@@ -229,7 +229,7 @@ worker gets its own pipeline and a unique `service.instance.id`:
229
229
  ```ruby
230
230
  # config/puma.rb
231
231
  on_worker_boot do
232
- Foam::Otel.init(name: "checkout-api", environment: ENV["APP_ENV"], enabled: true, token: ENV["FOAM_TOKEN"])
232
+ Foam::Otel.init(name: "checkout-api", environment: ENV["APP_ENV"], enabled: true, token: ENV["FOAM_OTEL_TOKEN"])
233
233
  # or, if you init in an initializer: Foam::Otel.after_fork!
234
234
  end
235
235
  ```
@@ -273,12 +273,17 @@ module Foam
273
273
 
274
274
  # Pre-install the HTTP-client instrumentations with untraced_hosts so
275
275
  # foam's exports and FDE-listed hosts never produce outbound spans.
276
+ # Each entry is the Instrumentation *class* (…::Instrumentation), not the
277
+ # parent module — only the class responds to `.instance.install`. Without
278
+ # the trailing ::Instrumentation the NameError/NoMethodError is swallowed
279
+ # and install_all then installs with default untraced_hosts: [] — the
280
+ # export-loop guard and ignored_outbound_hosts silently never apply.
276
281
  HTTP_CLIENT_INSTRUMENTATIONS = %w[
277
- OpenTelemetry::Instrumentation::Net::HTTP
278
- OpenTelemetry::Instrumentation::Faraday
279
- OpenTelemetry::Instrumentation::HTTP
280
- OpenTelemetry::Instrumentation::HTTPX
281
- OpenTelemetry::Instrumentation::Excon
282
+ OpenTelemetry::Instrumentation::Net::HTTP::Instrumentation
283
+ OpenTelemetry::Instrumentation::Faraday::Instrumentation
284
+ OpenTelemetry::Instrumentation::HTTP::Instrumentation
285
+ OpenTelemetry::Instrumentation::HTTPX::Instrumentation
286
+ OpenTelemetry::Instrumentation::Excon::Instrumentation
282
287
  ].freeze
283
288
 
284
289
  def configure_loop_guard(config)
@@ -7,6 +7,8 @@ module Foam
7
7
  # 1.0.0: first pass aligned to docs/BASE_PACKAGE_SPEC.md (fleet convention,
8
8
  # matching the JS core's alignment bump). Breaking: the stamped/rid/
9
9
  # request-context architecture is gone; the init surface changed.
10
- VERSION = "1.0.0"
10
+ # 1.0.1 (#80): HTTP-client instrumentation class resolved for the loop guard.
11
+ # 1.0.2: FOAM_OTEL_TOKEN doc convention (token comment source change); drop-in.
12
+ VERSION = "1.0.2"
11
13
  end
12
14
  end
data/lib/foam/otel.rb CHANGED
@@ -4,7 +4,7 @@
4
4
  # docs/BASE_PACKAGE_SPEC.md.
5
5
  #
6
6
  # Foam::Otel.init(name: "checkout-api", environment: ENV["APP_ENV"],
7
- # enabled: ENV["APP_ENV"] != "test", token: ENV["FOAM_TOKEN"])
7
+ # enabled: ENV["APP_ENV"] != "test", token: ENV["FOAM_OTEL_TOKEN"])
8
8
  #
9
9
  # A thin, safe wrapper over the official OpenTelemetry libraries: foam owns
10
10
  # the PIPELINE (providers, batch processors, OTLP export to the pinned fleet
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foam-otel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foam
@@ -152,7 +152,12 @@ dependencies:
152
152
  description: 'A thin, safe wrapper over the official OpenTelemetry libraries: foam
153
153
  owns the pipeline (providers, batch processors, OTLP export to the foam fleet endpoint,
154
154
  an always-on redaction floor), turns on automatic tier-1/2 instrumentation, and
155
- ships a small set of never-throw helpers. Built to docs/BASE_PACKAGE_SPEC.md.'
155
+ ships a small set of never-throw helpers. Configure with Foam::Otel.init(name:,
156
+ environment:, enabled:, token:); the ingest token is passed EXPLICITLY — the fleet
157
+ convention is to read it from the FOAM_OTEL_TOKEN environment variable and hand
158
+ it to init. The gem never reads the token (or any config) from the environment itself.
159
+ Built to docs/BASE_PACKAGE_SPEC.md; full usage in the README (shown on the source
160
+ page and on rubydoc.info, not on the RubyGems gem page).'
156
161
  executables: []
157
162
  extensions: []
158
163
  extra_rdoc_files: []