Skip to main content
Shoryuken is a thread-based message processor for AWS SQS. AppSignal instruments Shoryuken automatically when the Shoryuken gem is detected on start. No manual installation is required if Shoryuken is part of a Rails app. If you’re using a standalone Shoryuken app, see our integration guide.

Performance monitoring

Event timeline

Shoryuken jobs appear in the event timeline of your application’s performance actions as perform_job.shoryuken events.

Incident grouping

AppSignal detects job names from the Shoryuken worker class name, suffixed with the perform method name, resulting in something like MyWorker#perform. AppSignal groups jobs by this name for performance monitoring and notifications.

Enqueue instrumentation

Enqueuing a Shoryuken job records an enqueue.shoryuken event, titled after the job being enqueued. AppSignal records enqueue events on the active transaction’s event timeline, for example when you enqueue a job from within a web request or from within another job. It only records them when a transaction is active, so enqueuing a job outside of a transaction records nothing. To stop recording enqueue events across all background job integrations, set the enable_job_enqueue_instrumentation config option to false. This does not affect the instrumentation of the jobs themselves.

Batch support

If an app uses a worker with the :batch => true option, that worker processes multiple messages in the same tick. This requires Ruby gem 2.11.3 or higher, which adds support for the batch option.

Example application

We have an example application for a standalone Shoryuken application available in our examples repository on GitHub.

Span attributes

Collector mode only: this applies when AppSignal for Ruby runs in collector mode. It has no effect otherwise.
The enqueue and the job’s own span both carry:
  • messaging.system — the queueing library.
  • messaging.destination.name — the queue the job was put on.
  • messaging.operation.type — whether the span is the enqueue or the job running.
A span for a job that raised also carries error.type, the class of the error.

Distributed tracing

Collector mode only: this applies when AppSignal for Ruby runs in collector mode. It has no effect otherwise.
A job runs in the same trace as the code that enqueued it, appearing under the request or job that scheduled it. You can trace a slow job back to what caused it to run. The trace is carried in the message’s SQS message attributes. SQS allows at most ten per message, so a message using all ten is sent without a trace. Messages received in batches do not continue a trace. A batch is handled as one unit, so there is no single trace for it to belong to. Read more about distributed tracing.