diff --git a/finagle-thrift/src/main/ruby/lib/finagle-thrift/tracer.rb b/finagle-thrift/src/main/ruby/lib/finagle-thrift/tracer.rb
index <HASH>..<HASH> 100644
--- a/finagle-thrift/src/main/ruby/lib/finagle-thrift/tracer.rb
+++ b/finagle-thrift/src/main/ruby/lib/finagle-thrift/tracer.rb
@@ -181,8 +181,14 @@ module Trace
       DOUBLE = "DOUBLE"
       STRING = "STRING"
 
-      def self.to_thrift(v)
-        FinagleThrift::AnnotationType::VALUE_MAP.index(v)
+      if {}.respond_to?(:key)
+        def self.to_thrift(v)
+          FinagleThrift::AnnotationType::VALUE_MAP.key(v)
+        end
+      else
+        def self.to_thrift(v)
+          FinagleThrift::AnnotationType::VALUE_MAP.index(v)
+        end
       end
     end
 
@@ -245,4 +251,4 @@ module Trace
     end
   end
 
-end
\ No newline at end of file
+end
[split] finagle-thrift gem: Hash#index is deprecated in Ruby <I>

RB_ID=<I>