> ## Documentation Index
> Fetch the complete documentation index at: https://developer.upsun.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Continuous profiling for Ruby

> Configure and use the Ruby continuous profiler.

Upsun [Continuous Profiler](/docs/observability/application-metrics/cont-prof) is powered by [Blackfire](/docs/observability/application-metrics/blackfire).
It is available directly from the [Console](/docs/administration/web), under **Apps and Services → your app → Profiling**.

The Ruby continuous profiling is currently made across 3 dimensions:

* **CPU Time**:  Time spent running on the CPU
* **Wall-time**: elapsed time per function call
* **Allocations**: Time spent running on the CPU

The default sampling frequency is 100 Hz. This means the Ruby continuous profiler is
collecting information 100 times per second.

## Prerequisites

Upsun Continuous Profiler requires [`Ruby >= 2.5`](/docs/languages/ruby).

## Installation

1. Add the `datadog` gem to your `Gemfile` or `gems.rb` file:

```bash theme={null}
gem 'datadog', '~> 2.0'
```

2. Install the gems running the `bundle install` command.

3. Add the `ddprofrb exec` command to your Ruby application start command:

```bash theme={null}
bundle exec ddprofrb exec ruby myrubyapp.rb
```

Rails example:

```bash theme={null}
bundle exec ddprofrb exec bin/rails s
```

Alternatively, start the profiler by adding the following code in your application's entry point if you can't start it using `ddprofrb exec`:

```bash theme={null}
require 'datadog/profiling/preload'
```
