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

  1. Repositories are connected to Foam via GitHub App.
  2. 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.
  3. A sandbox build runs to confirm telemetry is received before the PR is marked ready.
  4. Once merged, traces, logs, and metrics flow to the Foam collector.
Ruby

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
rubygems.org
gem 'foam-ruby'
Node.js

@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
npmjs.com
npm install @foam-ai/node-opentelemetry
Browser

@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
npmjs.com
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
11 gem 'stackprof'
22 gem 'sentry-rails', '~> 5.24'
33 gem 'sentry-ruby'
4+# Foam OpenTelemetry
5+gem 'foam-ruby'
46 gem 'sentry-sidekiq'