Last active
December 30, 2015 23:28
-
-
Save danriti/7900426 to your computer and use it in GitHub Desktop.
Sinatra Example for TraceView Heroku Add-on
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
get '/' do | |
"Hello, world" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './app' | |
require 'oboe-heroku' | |
# When traces should be initiated for incoming requests. Valid options are | |
# "always", "through" (when the request is initiated with a tracing header | |
# from upstream) and "never". You must set this directive to "always" in | |
# order to initiate tracing. | |
Oboe::Config[:tracing_mode] = 'through' | |
# You can remove the following line in production to allow for | |
# auto sampling or managing the sample rate through the TraceView portal. | |
# Oboe::Config[:sample_rate] = 1000000 | |
# You may want to replace the Oboe.logger with whichever logger you are using | |
# Oboe.logger = Sinatra.logger | |
run Sinatra::Application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source "https://rubygems.org" | |
ruby "2.0.0" | |
gem 'sinatra' | |
group :production, :staging do | |
gem 'oboe-heroku', '~> 0.9.10.0' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM | |
remote: https://rubygems.org/ | |
remote: https://[email protected]/pglombardo/ | |
specs: | |
json (1.8.1) | |
oboe (2.6.2.0) | |
json | |
oboe-heroku (0.9.10.0) | |
oboe (>= 2.6.2.0) | |
rack (1.5.2) | |
rack-protection (1.5.1) | |
rack | |
sinatra (1.4.4) | |
rack (~> 1.4) | |
rack-protection (~> 1.4) | |
tilt (~> 1.3, >= 1.3.4) | |
tilt (1.4.1) | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
oboe-heroku (= 0.9.10.0) | |
sinatra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: bundle exec rackup config.ru -p $PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: Oboe::Config[:tracing_mode] = 'through' seemed to prevent initial tracing