No commit activity in last 3 years
No release in over 3 years
Instruments the ruby-kafka gem for opentracing
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 10.0
~> 3.0
>= 0.7.0

Runtime

~> 0.5.0
 Project Readme

Kafka Opentracing

Open Tracing instrumentation for the kafka gem. By default it starts a new span for every message written to kafka and propogates the span context when any consumer consumes the message. It follows the open tracing tagging semantic conventions

Installation

Add this line to your application's Gemfile:

gem 'kafka-opentracing'

And then execute:

$ bundle

Or install it yourself as:

$ gem install kafka-opentracing

Usage

First load the opentracing (Note: this won't automatically instrument the http gem)

require "kafka-opentracing"

If you have setup OpenTracing.global_tracer you can turn on spans for all requests with just:

    Kafka::Tracer.instrument

If you need more control over the tracer or which requests get their own span you can configure both settings like:

    Kafka::Tracer.instrument(
        tracer: tracer,
        ignore_message: ->(value, key, headers, topic, partition, partition_key) { topic == 'testing' }
    )

Development

After checking out the repo, run bundle install to install dependencies. Then, run rspec to run the tests.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/benedictfischer09/ruby-kafka-instrumentation. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.