Created
January 17, 2018 16:54
-
-
Save itsderek23/e5df4e44363c42a91bf5a58155081161 to your computer and use it in GitHub Desktop.
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
# To run: ruby hello_world.rb -p 4570 | |
require 'sinatra' | |
require 'opentracing' | |
require 'jaeger/client' | |
require 'rack/tracer' | |
OpenTracing.global_tracer = Jaeger::Client.build(service_name: 'hello-world') | |
use Rack::Tracer | |
get '/' do | |
"#{hello} world" | |
end | |
def hello | |
client = Net::HTTP.new("localhost",4567) | |
req = Net::HTTP::Get.new("/") | |
OpenTracing.inject(env['rack.span'].context, OpenTracing::FORMAT_RACK, req) | |
client.request(req).body | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment