copy from zipkin gems