Skip to content

Instantly share code, notes, and snippets.

@itsderek23
Created January 17, 2018 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save itsderek23/e5df4e44363c42a91bf5a58155081161 to your computer and use it in GitHub Desktop.
Save itsderek23/e5df4e44363c42a91bf5a58155081161 to your computer and use it in GitHub Desktop.
# 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