diff --git a/skills/sentry-ruby-sdk/SKILL.md b/skills/sentry-ruby-sdk/SKILL.md index 655c4d2f..341c01af 100644 --- a/skills/sentry-ruby-sdk/SKILL.md +++ b/skills/sentry-ruby-sdk/SKILL.md @@ -21,7 +21,7 @@ Opinionated wizard that scans the project and guides through complete Sentry set - User is migrating from AppSignal, Honeybadger, Bugsnag, Rollbar, or Airbrake to Sentry - User wants to monitor exceptions, HTTP requests, or background jobs in Rails/Sinatra -> **Note:** SDK APIs below reflect sentry-ruby v6.6.2. +> **Note:** SDK APIs below reflect sentry-ruby v6.7.0+. > Always verify against [docs.sentry.io/platforms/ruby/](https://docs.sentry.io/platforms/ruby/) before implementing. --- @@ -222,6 +222,7 @@ For each feature: `Read ${SKILL_ROOT}/references/.md`, follow steps exa | `max_breadcrumbs` | Integer | `100` | Max breadcrumbs per event | | `debug` | Boolean | `false` | Verbose SDK output to stdout | | `capture_queue_time` | Boolean | `true` | Record request queue time from `X-Request-Start` header (v6.4.0+, Rails fixed in v6.4.1) | +| `rails.active_job_propagate_traces` | Boolean | `true` | Propagate trace context through ActiveJob payloads for distributed tracing (sentry-rails only) | | `otlp.enabled` | Boolean | `false` | Route OTel spans to Sentry via OTLP; **do not combine with** `traces_sample_rate` | | `otlp.collector_url` | String | `nil` | OTLP HTTP endpoint of an OTel Collector (e.g., `http://localhost:4318/v1/traces`); when set, spans are sent to the collector instead of directly to Sentry | | `org_id` | String | `nil` | Explicit org ID; overrides DSN-extracted value; useful for self-hosted/Relay setups (v6.5.0+) | diff --git a/skills/sentry-ruby-sdk/references/error-monitoring.md b/skills/sentry-ruby-sdk/references/error-monitoring.md index 0ef37758..d09da863 100644 --- a/skills/sentry-ruby-sdk/references/error-monitoring.md +++ b/skills/sentry-ruby-sdk/references/error-monitoring.md @@ -65,7 +65,7 @@ Sentry.set_user( Sentry.set_user({}) ``` -### Tags, context, and extras +### Tags, context, extras, and attributes ```ruby # Tags — indexed, filterable in Sentry search @@ -74,6 +74,12 @@ Sentry.set_tags(region: "us-east-1", plan: "enterprise") # Context — structured data attached to events (not indexed) Sentry.set_context("order", { id: order.id, total: order.total, currency: "USD" }) +# Attributes — key-value pairs that apply to telemetry (logs, metrics, traces) +Sentry.set_attribute("user.tier", "premium") +Sentry.set_attribute("response.time", 150, unit: "millisecond") +Sentry.set_attributes(region: "us-west", datacenter: "pdx-1") +Sentry.remove_attribute("user.tier") # remove a specific attribute + # Extras — deprecated; prefer set_context for structured data Sentry.set_extras(raw_payload: payload.inspect) ``` @@ -208,11 +214,17 @@ Sentry.set_user(id:, email:, username:, ip_address:) Sentry.set_tags(key: "value") Sentry.set_context("key", { field: "value" }) Sentry.set_extras(key: "value") # deprecated — prefer set_context +Sentry.set_attribute("key", "value", unit: nil) +Sentry.set_attributes(key1: "value1", key2: "value2") +Sentry.remove_attribute("key") # Scope instance methods (inside with_scope / configure_scope blocks) scope.set_tags(key: "value") scope.set_user(id: "42", email: "user@example.com") scope.set_context("key", { field: "value" }) +scope.set_attribute("key", "value", unit: nil) +scope.set_attributes(key1: "value1", key2: "value2") +scope.remove_attribute("key") scope.set_level(:error) # :debug | :info | :warning | :error | :fatal scope.set_fingerprint(["my-group"]) scope.clear diff --git a/skills/sentry-ruby-sdk/references/tracing.md b/skills/sentry-ruby-sdk/references/tracing.md index 1cce34b8..e4f8abc0 100644 --- a/skills/sentry-ruby-sdk/references/tracing.md +++ b/skills/sentry-ruby-sdk/references/tracing.md @@ -24,6 +24,7 @@ | `trace_propagation_targets` | Array | `[/.*/]` | URLs to inject `sentry-trace` + `baggage` headers into | | `propagate_traces` | Boolean | `true` | Propagate trace headers on outbound Net::HTTP requests | | `capture_queue_time` | Boolean | `true` | Record request queue time from `X-Request-Start` header (v6.4.0+, Rails fixed in v6.4.1) | +| `rails.active_job_propagate_traces` | Boolean | `true` | Propagate trace context through ActiveJob payloads for distributed tracing across Sidekiq, Resque, DelayedJob adapters (sentry-rails only) | | `org_id` | String | `nil` | Explicit organization ID; overrides the value auto-extracted from the DSN. Set this for self-hosted or Relay setups where DSN-based parsing may not work (v6.5.0+) | | `strict_trace_continuation` | Boolean | `false` | When `true`, only continue an incoming trace if the `sentry-org_id` baggage matches the SDK's effective org ID; if either is missing the trace is **not** continued. Prevents inadvertent trace stitching from unknown third-party services (v6.5.0+) | @@ -56,7 +57,11 @@ No extra code needed. The following are auto-instrumented: - `ActionController` — one transaction per request - `ActiveRecord` — SQL queries as child spans - `ActionMailer` — mail delivery as child spans -- `ActiveJob` — job execution as child spans +- `ActiveJob` — job execution as transactions with **distributed tracing** support: + - Emits a `queue.publish` producer span on `perform_later` + - Propagates trace context through job payloads (works with Sidekiq, Resque, DelayedJob adapters) + - Creates a `queue.active_job` consumer transaction on the worker + - Disable trace propagation with `config.rails.active_job_propagate_traces = false` - `Net::HTTP` outbound calls — child spans with trace header propagation ### Rack / Sinatra (via `Sentry::Rack::CaptureExceptions`)