https://github.com/salemove/jaeger-client-ruby
OpenTracing Tracer implementation for Jaeger in Ruby
https://github.com/salemove/jaeger-client-ruby
Keywords
distributed-tracing jaeger opentracing ruby trace
Keywords from Contributors
activejob activerecord mvc
Last synced: about 22 hours ago
JSON representation
Repository metadata
OpenTracing Tracer implementation for Jaeger in Ruby
- Host: GitHub
- URL: https://github.com/salemove/jaeger-client-ruby
- Owner: salemove
- License: mit
- Archived: true
- Created: 2017-04-22T14:19:01.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-12T10:52:44.000Z (about 2 years ago)
- Last Synced: 2026-02-14T20:39:00.984Z (17 days ago)
- Topics: distributed-tracing, jaeger, opentracing, ruby, trace
- Language: Ruby
- Homepage:
- Size: 282 KB
- Stars: 62
- Watchers: 36
- Forks: 37
- Open Issues: 3
- Releases: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
README.md
Jaeger::Client
This project is not actively maintained. Please consider using OpenTelemetry
OpenTracing Tracer implementation for Jaeger in Ruby
Installation
Add this line to your application's Gemfile:
gem 'jaeger-client'
Usage
require 'jaeger/client'
OpenTracing.global_tracer = Jaeger::Client.build(host: 'localhost', port: 6831, service_name: 'echo')
OpenTracing.start_active_span('span name') do
# do something
OpenTracing.start_active_span('inner span name') do
# do something else
end
end
# don't kill the program too soon, allow time for the background reporter to send the traces
sleep 2
See opentracing-ruby for more examples.
Reporters
RemoteReporter (default)
RemoteReporter buffers spans in memory and sends them out of process using Sender.
There are two senders: UdpSender (default) and HttpSender.
To use HttpSender:
OpenTracing.global_tracer = Jaeger::Client.build(
service_name: 'service_name',
reporter: Jaeger::Reporters::RemoteReporter.new(
sender: Jaeger::HttpSender.new(
url: 'http://localhost:14268/api/traces',
headers: { 'key' => 'value' }, # headers key is optional
encoder: Jaeger::Encoders::ThriftEncoder.new(service_name: 'service_name')
),
flush_interval: 10
)
)
NullReporter
NullReporter ignores all spans.
OpenTracing.global_tracer = Jaeger::Client.build(
service_name: 'service_name',
reporter: Jaeger::Reporters::NullReporter.new
)
LoggingReporter
LoggingReporter prints some details about the span using logger. This is meant only for debugging. Do not parse and use this information for anything critical. The implemenation can change at any time.
OpenTracing.global_tracer = Jaeger::Client.build(
service_name: 'service_name',
reporter: Jaeger::Reporters::LoggingReporter.new
)
LoggingReporter can also use a custom logger. For this provide logger using logger keyword argument.
Samplers
Const sampler
Const sampler always makes the same decision for new traces depending on the initialization value. Set sampler to: Jaeger::Samplers::Const.new(true) to mark all new traces as sampled.
Probabilistic sampler
Probabilistic sampler samples traces with probability equal to rate (must be between 0.0 and 1.0). This can be enabled by setting Jaeger::Samplers::Probabilistic.new(rate: 0.1)
RateLimiting sampler
RateLimiting sampler samples at most max_traces_per_second. The distribution of sampled traces follows burstiness of the service, i.e. a service with uniformly distributed requests will have those requests sampled uniformly as well, but if requests are bursty, especially sub-second, then a number of sequential requests can be sampled each second.
Set sampler to Jaeger::Samplers::RateLimiting.new(max_traces_per_second: 100)
GuaranteedThroughputProbabilistic sampler
GuaranteedThroughputProbabilistic is a sampler that guarantees a throughput by using a Probabilistic sampler and RateLimiting sampler The RateLimiting sampler is used to establish a lower_bound so that every operation is sampled at least once in the time interval defined by the lower_bound.
Set sampler to Jaeger::Samplers::GuaranteedThroughputProbabilistic.new(lower_bound: 10, rate: 0.001)
PerOperation sampler
PerOperation sampler leverages both Probabilistic sampler and RateLimiting sampler via the GuaranteedThroughputProbabilistic sampler. This sampler keeps track of all operations and delegates calls the the respective GuaranteedThroughputProbabilistic sampler.
Set sampler to
Jaeger::Samplers::PerOperation.new(
strategies: {
per_operation_strategies: [
{ operation: 'GET /articles', probabilistic_sampling: { sampling_rate: 0.5 } },
{ operation: 'POST /articles', probabilistic_sampling: { sampling_rate: 1.0 } }
],
default_sampling_probability: 0.001,
default_lower_bound_traces_per_second: 1.0 / (10.0 * 60.0)
},
max_operations: 1000
)
RemoteControlled sampler
RemoteControlled sampler is a sampler that is controller by jaeger agent. It starts out with Probabilistic sampler. It polls the jaeger-agent and changes sampling strategy accordingly. Set sampler to Jaeger::Client::Samplers::RemoteControlled.new(service_name: 'service_name').
RemoteControlled sampler options:
| Param | Required | Description |
|---|---|---|
| service_name | x | name of the current service / application, same as given to Tracer |
| sampler | initial sampler to use prior to retrieving strategies from Agent | |
| refresh_interval | interval in seconds before sampling strategy refreshes (0 to not refresh, defaults to 60) | |
| host | host for jaeger-agent (defaults to 'localhost') | |
| port | port for jaeger-agent for SamplingManager endpoint (defaults to 5778) | |
| logger | logger for communication between jaeger-agent (default to $stdout logger) |
TraceContext compatible header propagation
It is possible to use W3C Trace Context headers to propagate the tracing information.
To set it up you need to change FORMAT_RACK injector and extractor.
OpenTracing.global_tracer = Jaeger::Client.build(
service_name: 'service_name',
injectors: {
OpenTracing::FORMAT_RACK => [Jaeger::Injectors::TraceContextRackCodec]
},
extractors: {
OpenTracing::FORMAT_RACK => [Jaeger::Extractors::TraceContextRackCodec]
}
)
Zipkin HTTP B3 compatible header propagation
Jaeger Tracer supports Zipkin B3 Propagation HTTP headers, which are used by a lot of Zipkin tracers. This means that you can use Jaeger in conjunction with OpenZipkin tracers.
To set it up you need to change FORMAT_RACK injector and extractor.
OpenTracing.global_tracer = Jaeger::Client.build(
service_name: 'service_name',
injectors: {
OpenTracing::FORMAT_RACK => [Jaeger::Injectors::B3RackCodec]
},
extractors: {
OpenTracing::FORMAT_RACK => [Jaeger::Extractors::B3RackCodec]
}
)
It's also possible to set up multiple injectors and extractors. Each injector will be called in sequence. Note that if multiple injectors are using the same keys then the values will be overwritten.
If multiple extractors is used then the span context from the first match will be returned.
Process Tags
Jaeger Tracer allows you to define process level tags. By default the tracer provides jaeger.version, ip and hostname. You may want to overwrite ip or hostname if the tracer cannot auto-detect them.
OpenTracing.global_tracer = Jaeger::Client.build(
service_name: 'service_name',
tags: {
'hostname' => 'custom-hostname',
'custom_tag' => 'custom-tag-value'
}
)
Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
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.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/salemove/jaeger-client-ruby
License
The gem is available as open source under the terms of the MIT License.
Owner metadata
- Name: Glia
- Login: salemove
- Email:
- Kind: organization
- Description: The ultimate Digital Customer Service platform.
- Website: https://www.glia.com/
- Location: 30 W 21st Street, 4th Floor, New York, NY, 10010
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/5281619?v=4
- Repositories: 150
- Last ynced at: 2024-12-19T21:35:44.514Z
- Profile URL: https://github.com/salemove
GitHub Events
Total
Last Year
Committers metadata
Last synced: 1 day ago
Total Commits: 121
Total Committers: 19
Avg Commits per committer: 6.368
Development Distribution Score (DDS): 0.364
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Indrek Juhkam | i****k@u****u | 77 |
| Ashwin Chandrasekar | a****r@s****m | 6 |
| Dmitrij Fedorenko | j****b@f****u | 6 |
| Chad Metcalf | c****d@c****m | 5 |
| Takuya Noguchi | t****h@g****m | 4 |
| Mehmet Emin INAC | m****c@g****m | 4 |
| Luong Vo | v****g@g****m | 3 |
| Ashwin Chandrasekar | 4****s | 2 |
| Kun Liu | l****1@s****m | 2 |
| kamina-zzz | k****1@g****m | 2 |
| Christian Nicolai | cn@m****e | 2 |
| David Ortiz | z****z@g****m | 1 |
| Felipe Philipp | f****s@g****m | 1 |
| João Paiva | j****a@g****m | 1 |
| Sean Floyd | S****F | 1 |
| Siim Liiser | s****r@g****m | 1 |
| Timur Platonov | t****n | 1 |
| Nephi Allred | n****d@m****m | 1 |
| kruczjak | k****k@g****m | 1 |
Committer domains:
- mx.com: 1
- glia.com: 1
- mycrobase.de: 1
- sina.com: 1
- clearbit.com: 1
- fedorenko-d.ru: 1
- signalfx.com: 1
- urgas.eu: 1
Issue and Pull Request metadata
Last synced: 3 months ago
Total issues: 17
Total pull requests: 35
Average time to close issues: 3 months
Average time to close pull requests: 6 days
Total issue authors: 15
Total pull request authors: 20
Average comments per issue: 1.94
Average comments per pull request: 1.57
Merged pull request: 22
Bot issues: 0
Bot pull requests: 0
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- dleidert (2)
- c5c86a (2)
- Dudesons (1)
- Mahito (1)
- asafsemo (1)
- vlatkapavisic (1)
- SeanLF (1)
- felipeelias (1)
- tnir (1)
- dpdpbj (1)
- kamina-zzz (1)
- josh-lauer (1)
- danielgatis (1)
- darwin67 (1)
- CpuID (1)
Top Pull Request Authors
- meinac (5)
- tnir (4)
- eldadvcita (3)
- achandras (3)
- kruczjak (2)
- cmur2 (2)
- c0va23 (2)
- chadmetcalf-cb (2)
- zindorsky (1)
- cptaffe (1)
- indrekj (1)
- kamina-zzz (1)
- sliiser (1)
- jeremiahishere (1)
- luong-komorebi (1)
Top Issue Labels
Top Pull Request Labels
Package metadata
- Total packages: 12
-
Total downloads:
- rubygems: 98,204,761 total
- Total docker downloads: 868,405,892
- Total dependent packages: 7 (may contain duplicates)
- Total dependent repositories: 798 (may contain duplicates)
- Total versions: 46
- Total maintainers: 2
gem.coop: jaeger-client
OpenTracing Tracer implementation for Jaeger in Ruby
- Homepage: https://github.com/salemove/jaeger-client-ruby
- Documentation: http://www.rubydoc.info/gems/jaeger-client/
- Licenses: MIT
- Latest release: 1.3.0 (published about 4 years ago)
- Last Synced: 2026-03-01T16:32:06.237Z (2 days ago)
- Versions: 18
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 49,101,692 Total
- Docker Downloads: 434,202,946
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.208%
- Docker downloads count: 0.325%
- Downloads: 0.506%
- Maintainers (1)
rubygems.org: jaeger-client
OpenTracing Tracer implementation for Jaeger in Ruby
- Homepage: https://github.com/salemove/jaeger-client-ruby
- Documentation: http://www.rubydoc.info/gems/jaeger-client/
- Licenses: MIT
- Latest release: 1.3.0 (published about 4 years ago)
- Last Synced: 2026-02-28T21:01:11.349Z (3 days ago)
- Versions: 18
- Dependent Packages: 7
- Dependent Repositories: 798
- Downloads: 49,100,683 Total
- Docker Downloads: 434,202,946
-
Rankings:
- Docker downloads count: 0.391%
- Downloads: 0.53%
- Dependent repos count: 1.189%
- Dependent packages count: 2.237%
- Average: 2.58%
- Forks count: 4.285%
- Stargazers count: 6.85%
- Maintainers (1)
gem.coop: jaeger-client-with-ruby-32-support
OpenTracing Tracer implementation for Jaeger in Ruby
- Homepage: https://github.com/salemove/jaeger-client-ruby
- Documentation: http://www.rubydoc.info/gems/jaeger-client-with-ruby-32-support/
- Licenses: MIT
- Latest release: 2.0.0 (published almost 3 years ago)
- Last Synced: 2026-02-28T21:01:12.036Z (3 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 1,193 Total
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 32.289%
- Downloads: 96.867%
- Maintainers (1)
rubygems.org: jaeger-client-with-ruby-32-support
OpenTracing Tracer implementation for Jaeger in Ruby
- Homepage: https://github.com/salemove/jaeger-client-ruby
- Documentation: http://www.rubydoc.info/gems/jaeger-client-with-ruby-32-support/
- Licenses: MIT
- Latest release: 2.0.0 (published almost 3 years ago)
- Last Synced: 2026-02-28T21:01:11.828Z (3 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 1,193 Total
-
Rankings:
- Forks count: 4.228%
- Stargazers count: 6.693%
- Dependent packages count: 15.7%
- Average: 34.631%
- Dependent repos count: 46.946%
- Downloads: 99.589%
- Maintainers (1)
ubuntu-22.04: ruby-jaeger-client
- Homepage: https://github.com/salemove/jaeger-client-ruby
- Licenses:
- Latest release: 1.2.0-2 (published 18 days ago)
- Last Synced: 2026-02-13T13:18:58.735Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.10: ruby-jaeger-client
- Homepage: https://github.com/salemove/jaeger-client-ruby
- Licenses:
- Latest release: 1.3.0-1 (published 18 days ago)
- Last Synced: 2026-02-13T18:23:28.721Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-20.04: ruby-jaeger-client
- Homepage: https://github.com/salemove/jaeger-client-ruby
- Licenses:
- Latest release: 0.10.0-2 (published 19 days ago)
- Last Synced: 2026-02-13T07:16:01.556Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-jaeger-client
- Homepage: https://github.com/salemove/jaeger-client-ruby
- Documentation: https://packages.debian.org/bullseye/ruby-jaeger-client
- Licenses:
- Latest release: 0.10.0-2 (published 21 days ago)
- Last Synced: 2026-02-13T08:21:31.606Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.04: ruby-jaeger-client
- Homepage: https://github.com/salemove/jaeger-client-ruby
- Licenses:
- Latest release: 1.3.0-1 (published 21 days ago)
- Last Synced: 2026-02-11T06:41:43.907Z (21 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-jaeger-client
- Homepage: https://github.com/salemove/jaeger-client-ruby
- Documentation: https://packages.debian.org/bookworm/ruby-jaeger-client
- Licenses:
- Latest release: 1.3.0-1 (published 19 days ago)
- Last Synced: 2026-02-12T23:33:08.999Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- jaeger-client >= 0
- rack >= 0
- sinatra >= 0
- webrick ~> 1.7
- jaeger-client 1.2.0
- mustermann 1.1.1
- opentracing 0.5.0
- rack 2.2.3
- rack-protection 2.1.0
- ruby2_keywords 0.0.5
- sinatra 2.1.0
- thrift 0.15.0
- tilt 2.0.10
- webrick 1.7.0
- bundler >= 0 development
- rake ~> 13.0 development
- rspec ~> 3.10 development
- rubocop ~> 1.25 development
- rubocop-rake ~> 0.6 development
- rubocop-rspec ~> 2.8 development
- timecop ~> 0.9 development
- webmock ~> 3.14 development
- opentracing ~> 0.3
- thrift >= 0
- actions/checkout v2 composite
- ruby/setup-ruby v1 composite
- docker * docker
- ruby 2.7-alpine build
- crossdock/crossdock latest
- jaegertracing/test-driver latest
- jaegertracing/xdock-go latest
- jaegertracing/xdock-java latest
- jaegertracing/xdock-py latest
- docker.elastic.co/elasticsearch/elasticsearch-oss 6.8.3
- jaegertracing/jaeger-agent latest
- jaegertracing/jaeger-collector latest
- jaegertracing/jaeger-query latest
Score: 27.80813374927229