The LightStep distributed tracing library for Ruby
Перейти к файлу
bcronin 5079780d1b Remove unused variable 2016-04-18 18:00:06 -07:00
benchmark Fix defect where too many flushes were occurring 2016-04-18 16:02:33 -07:00
bin Normalize to Ruby conventions 2016-04-07 17:16:29 -07:00
lib Remove unused variable 2016-04-18 18:00:06 -07:00
scripts Add Makefile with publish steps 2016-04-14 13:38:41 -07:00
spec Remove unused code, add unit tests 2016-04-18 17:58:43 -07:00
.gitignore Add Makefile with publish steps 2016-04-14 13:38:41 -07:00
.rspec Normalize to Ruby conventions 2016-04-07 17:16:29 -07:00
Gemfile Normalize to Ruby conventions 2016-04-07 17:16:29 -07:00
LICENSE.txt Normalize to Ruby conventions 2016-04-07 17:16:29 -07:00
Makefile Fix defect where too many flushes were occurring 2016-04-18 16:02:33 -07:00
README.md Update README example 2016-04-18 16:35:56 -07:00
Rakefile Normalize to Ruby conventions 2016-04-07 17:16:29 -07:00
circle.yml Update circle.yml to only run on master 2016-04-14 13:41:08 -07:00
example.rb Run rubocop on all source files 2016-04-18 16:13:31 -07:00
lightstep-tracer.gemspec Include gem bump in dev dependencies 2016-04-15 14:15:37 -07:00

README.md

lightstep-tracer-ruby

Gem Version Circle CI MIT license

Installation

Add this line to your application's Gemfile:

gem 'lightstep-tracer'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lightstep-tracer

Getting started

require 'lightstep-tracer'

# Initialize the singleton tracer
LightStep.init_global_tracer('lightstep/ruby/example', '{your_access_token}')

# Create a basic span and attach a log to the span
span = LightStep.start_span('my_span')
span.log_event('hello world', 'count' => 42)

# Create a child span (and add some artificial delays to illustrate the timing)
sleep(0.1)
child = LightStep.start_span('my_child', parent: span)
sleep(0.2)
child.finish
sleep(0.1)
span.finish

# Flush any enqueued data before program exit
LightStep.instance.flush

Development

After checking out the repo, run bin/setup to install dependencies. Then, run make test to run the tests.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

License

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