Sha256: 0ad739b95dfbf57da4b1ea96158d8ce7f925b396fe1aaa27e11db38d65abdcc7

Contents?: true

Size: 1.09 KB

Versions: 11

Compression:

Stored size: 1.09 KB

Contents

#!/usr/bin/env ruby

require 'bundler'
Bundler.setup

require 'jaeger/client'

host = ENV['JAEGER_HOST'] || '127.0.0.1'
port = ENV['JAEGER_HOST'] || 6831

tracer1 = Jaeger::Client.build(host: host, port: port.to_i, service_name: 'test-service', flush_interval: 1)
tracer2 = Jaeger::Client.build(host: host, port: port.to_i, service_name: 'downstream-service', flush_interval: 1)

rpc_span = tracer1.start_span(
  'receive request',
  tags: { 'span.kind' => 'server' }
)
sleep 0.1
rpc_span.log_kv(event: 'woop di doop', count: 5)
sleep 1

async_request_span = tracer1.start_span(
  'request async action',
  references: [
    OpenTracing::Reference.child_of(rpc_span.context)
  ],
  tags: { 'span.kind' => 'producer' }
)
sleep 0.1

async_request_span.finish
rpc_span.finish

sleep 0.5

async_span = tracer2.start_span(
  'async span started after rpc span',
  references: [
    OpenTracing::Reference.follows_from(async_request_span.context)
  ],
  tags: {
    'span.kind' => 'consumer',
    'peer.service' => 'downstream-service'
  }
)
sleep 0.3 # emulate network delay
async_span.finish

sleep 2

puts 'Finished'

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
dox-jaeger-client-2.0.0 script/create_follows_from_trace
jaeger-client-with-ruby-32-support-2.0.0 script/create_follows_from_trace
jaeger-client-1.3.0 script/create_follows_from_trace
jaeger-client-1.2.0 script/create_follows_from_trace
jaeger-client-1.1.0 script/create_follows_from_trace
jaeger-client-1.0.0 script/create_follows_from_trace
jaeger-client-0.10.0 script/create_follows_from_trace
jaeger-client-0.9.0 script/create_follows_from_trace
jaeger-client-0.8.0 script/create_follows_from_trace
jaeger-client-0.7.1 script/create_follows_from_trace
jaeger-client-0.7.0 script/create_follows_from_trace