The LightStep distributed tracing library for Ruby
Перейти к файлу
bhs c380bf718b Merge pull request #36 from lightstep/ngauthier/rack-http-inject-extract
Rack HTTP Inject + Extract
2016-11-16 20:30:54 -08:00
benchmark remove at_exit flush and add explicit flush to examples 2016-11-04 17:56:44 -04:00
bin rename gem and bump to version 0.9.0 2016-10-31 13:38:31 -04:00
examples change to rack-specific format 2016-11-14 13:09:18 -05:00
lib Merge pull request #36 from lightstep/ngauthier/rack-http-inject-extract 2016-11-16 20:30:54 -08:00
scripts rename gem and bump to version 0.9.0 2016-10-31 13:38:31 -04:00
spec allowe mixed case and underscores in rack inject 2016-11-14 13:11:47 -05:00
.gitignore Update gitignore and the Makefile 2016-10-31 21:38:39 -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 inject and extract for http requests and rack requests 2016-11-10 10:28:41 -05:00
README.md channel-signal based fork-safe implementation of reporter 2016-11-03 16:55:53 -04:00
Rakefile rubocop -a 2016-10-28 16:27:50 -04:00
benchmark.rb move benchmark into client and update it 2016-11-15 14:04:37 -05:00
circle.yml Update circle.yml to only run on master 2016-04-14 13:41:08 -07:00
example.rb no spancontext delegation 2016-11-10 12:18:40 -05:00
lightstep.gemspec simple reporting loop 2016-11-04 17:28:02 -04:00

README.md

lightstep-tracer-ruby

Gem Version Circle CI MIT license Code Climate

The LightStep distributed tracing library for Ruby.

Installation

Add this line to your application's Gemfile:

gem 'lightstep'

And then execute:

$ bundle

Or install it yourself as:

$ gem install lightstep

Getting started

require 'lightstep'

# Initialize the singleton tracer
LightStep.configure(component_name: 'lightstep/ruby/example', access_token: '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', child_of: span)
sleep(0.2)
child.finish
sleep(0.1)
span.finish

Thread Safety

The LightStep Tracer is threadsafe. For increased performance, you can add the concurrent-ruby-ext gem to your Gemfile. This will enable C extensions for concurrent operations.

The LightStep Tracer is also Fork-safe. When forking, the child process will not inherit the unflushed spans of the parent, so they will only be flushed once.

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.