Client Instrumentation
Foam instruments your services by opening PRs that add the appropriate SDK to your codebase. You review and merge. Once deployed, we are all set. As new teams onboard, Foam expands instrumentation support. New libraries and frameworks are typically supported within 72 hours. We currently support Ruby, Node.js, and Browser.
Instrumentation process
- Repositories are connected to Foam via GitHub App.
- foam[bot] analyzes the stack and opens a PR with the appropriate SDK. Instrumentation PRs are typically ready within 24–48 hours of connecting a repository.
- A sandbox build runs to confirm telemetry is received before the PR is marked ready.
- Once merged, traces, logs, and metrics flow to the Foam collector.
Rubyrubygems.org
foam-ruby
Ruby gem. Initializer-based setup. Exports via OTLP.
Auto-instruments
- ●Rails controllers & routing
- ●Active Record queries
- ●Action Pack (HTTP)
- ●Action View (templates)
- ●Action Mailer
- ●Active Job (workers)
- ●Rack middleware
gem 'foam-ruby'
Node.jsnpmjs.com
@foam-ai/node-opentelemetry
Node.js SDK. Uses the instrumentation hook or standalone require.
Auto-instruments
- ●Next.js SSR & API routes
- ●Express / Fastify / Koa
- ●HTTP clients (fetch, axios)
- ●Database drivers (Prisma, pg)
- ●gRPC calls
npm install @foam-ai/node-opentelemetry
Browsernpmjs.com
@foam-ai/browser
Browser SDK. Script-tag or import. Propagates trace context to backend.
Auto-instruments
- ●Page loads & route transitions
- ●Web Vitals (LCP, FID, CLS, INP)
- ●XHR & Fetch calls
- ●Trace propagation to backend
- ●Resource loading
npm install @foam-ai/browser
All PRs below were authored by foam[bot]
config/initializers/foam.rbnew
| 1 | + | # frozen_string_literal: true | |
| 2 | + | ||
| 3 | + | Foam::Ruby.init( | |
| 4 | + | token: ENV['OTEL_FOAM_COLLECTOR_BEARER_TOKEN'], | |
| 5 | + | service_name: 'client-rails' | |
| 6 | + | ) |
Gemfile
| 1 | 1 | gem 'stackprof' | |
| 2 | 2 | gem 'sentry-rails', '~> 5.24' | |
| 3 | 3 | gem 'sentry-ruby' | |
| 4 | + | # Foam OpenTelemetry | |
| 5 | + | gem 'foam-ruby' | |
| 4 | 6 | gem 'sentry-sidekiq' |