Module: FinagleThrift

Extended by:
FinagleThrift
Included in:
FinagleThrift
Defined in:
lib/finagle-thrift.rb,
lib/finagle-thrift/client.rb,
lib/finagle-thrift/version.rb,
lib/finagle-thrift/thrift_client.rb,
lib/finagle-thrift/thrift/tracing_types.rb,
lib/finagle-thrift/thrift/tracing_constants.rb

Defined Under Namespace

Modules: AnnotationType, Client, ThriftClient Classes: Annotation, BinaryAnnotation, ClientId, ConnectionOptions, Delegation, Endpoint, RequestContext, RequestHeader, ResponseHeader, Span, UpgradeReply

Constant Summary collapse

VERSION =
"1.4.2"
CLIENT_SEND =
%q"cs"
CLIENT_RECV =
%q"cr"
SERVER_SEND =
%q"ss"
SERVER_RECV =
%q"sr"
SERVER_ADDR =
%q"sa"
CLIENT_ADDR =
%q"ca"

Instance Method Summary collapse

Instance Method Details

#enable_tracing!(service, client_id = nil, service_name = nil) ⇒ Object

Raises:

  • (ArgumentError)


15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/finagle-thrift.rb', line 15

def enable_tracing!(service, client_id = nil, service_name = nil)
  raise ArgumentError, "client_id must be nil or of type FinagleThrift::ClientId" if client_id && !client_id.is_a?(FinagleThrift::ClientId)
  class << service
    include ::FinagleThrift::ThriftClient
  end

  client_class = service.client_class
  client_class.class_eval do
    include ::FinagleThrift::Client
  end
  client_class.send(:define_method, :client_id) { client_id }
  client_class.send(:define_method, :trace_service_name) { service_name }
end