WatchForge Ruby SDK (watchforge-ruby-sdk)
Ruby SDK for WatchForge — errors, cron monitors, distributed tracing, and management APIs. Aligned with watchforge-sdk (Python) and @watchforge/browser (JavaScript).
Install
gem install watchforge-ruby-sdk
Or in your Gemfile:
gem "watchforge-ruby-sdk", "~> 0.1.0"
bundle install
Quick start
require "watchforge"
Watchforge.init(
dsn: "https://PUBLIC_KEY@dev.watchforges.com/PROJECT_ID",
environment: "production"
)
Watchforge.context.("boot", "service started")
Watchforge.("hello", level: "info")
Watchforge.capture_exception(StandardError.new("boom"))
Feature support
| Feature | API |
|---|---|
| Issues (ingestion) | capture_exception, capture_message |
| Context | context.add_breadcrumb, set_user, set_tags |
| Cron monitors | capture_check_in |
| Tracing | start_transaction, start_span, finish_transaction |
| Management API | Watchforge::API::Client |
Cron monitor
check_in_id = Watchforge.capture_check_in(
monitor_slug: "nightly-job",
status: "in_progress",
monitor_config: {
schedule: { type: "crontab", value: "0 * * * *" },
timezone: "UTC",
check_margin: 5,
max_runtime: 30
}
)
Watchforge.capture_check_in(
monitor_slug: "nightly-job",
status: "ok",
check_in_id: check_in_id,
monitor_config: monitor_config
)
Tracing
txn = Watchforge.start_transaction("GET /health", "Health Check")
span = txn.start_span("db.query", "SELECT 1")
span.finish
Watchforge.finish_transaction
Management API (Bearer token)
api = Watchforge::API::Client.new("https://dev.watchforges.com", ENV["WATCHFORGE_TOKEN"])
api.list_issues(project_id, range: "7d", status: "unresolved")
api.dashboard_summary(project_id: project_id, range: "24h")
api.()
Package naming (WatchForge SDK family)
| Language | Package | Install |
|---|---|---|
| Python | watchforge-sdk |
pip install watchforge-sdk |
| JavaScript | @watchforge/browser |
npm install @watchforge/browser |
| Go | watchforge-go-sdk |
go get github.com/watchforges/watchforge-go-sdk/watchforge |
| Ruby | watchforge-ruby-sdk |
gem install watchforge-ruby-sdk |
| PHP | watchforge-php-sdk |
composer require watchforges/watchforge-php-sdk |
| Flutter | watchforge_flutter_sdk |
flutter pub add watchforge_flutter_sdk |
| React Native | @watchforge/react-native |
npm install @watchforge/react-native |
Publishing (maintainers)
See PUBLISHING.md.
License
MIT