AppSignal  Docs

Visit AppSignal.com
Jump to navigation

Webmachine

Webmachine works with AppSignal Ruby gem versions 1.3 and up.

Installation

A Webmachine application requires a few manual steps to get working.

  1. Create a config/appsignal.yml configuration file or configure it with environment variables. For more information see the Ruby configuration page.
  2. Make sure AppSignal is required, require "appsignal".
  3. Configure AppSignal using Appsignal.config.
  4. Start AppSignal using Appsignal.start.

An example of a Webmachine app.rb file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# app.rb
require "webmachine"
require "appsignal"

Appsignal.config = Appsignal::Config.new(
  Dir.pwd,      # Path to project root directory
  "development" # Environment
)
Appsignal.start_logger
Appsignal.start

class MyResource < Webmachine::Resource
  def to_html
    "<html><body>Hello, world!</body></html>"
  end
end

# Start a web server to serve requests via localhost
MyResource.run

After these steps, start your Webmachine app and wait for data to arrive in AppSignal.

Want to help us improve this documentation page? Create a pull request