rails_distributed_tracing 1.0 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -7
- data/lib/rails_distributed_tracing/distributed_tracing.rb +1 -1
- data/lib/rails_distributed_tracing/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c03c3da36fae25984aad08f2dc583d18fe84f7f35baedc9cc7bc984a81bb1b8
|
4
|
+
data.tar.gz: dd040f49222c180f46c22237d9aadb7f4a09297cf82037572f6f9f5492d52cad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bbefef2c8826bb340e7abddc2f329979e4e0f07c20260b18e5a531732d9e5d880e2e874e9e4779a312deab5d27976eaf33792bac957137b807907d919394640
|
7
|
+
data.tar.gz: 6ecbe55d6295e67a33c6e084d306f587863a30f37bed8caee6aa6b82124561ad2b10727e51674f72405a63c515224f323f07d547eea42600fb5282b5570a598b
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# rails_distributed_tracing
|
2
2
|
Distributed tracing for rails microservices
|
3
3
|
|
4
|
+
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/ajitsing/rails_distributed_tracing/graphs/commit-activity)
|
4
5
|
[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=102)](https://opensource.org/licenses/MIT)
|
5
6
|
[![Gem Version](https://badge.fury.io/rb/rails_distributed_tracing.svg)](https://badge.fury.io/rb/rails_distributed_tracing)
|
7
|
+
[![HitCount](http://hits.dwyl.io/ajitsing/rails_distributed_tracing.svg)](http://hits.dwyl.io/ajitsing/rails_distributed_tracing)
|
6
8
|
![Gem Downloads](http://ruby-gem-downloads-badge.herokuapp.com/rails_distributed_tracing?type=total)
|
7
9
|
[![Build Status](https://travis-ci.org/ajitsing/rails_distributed_tracing.svg?branch=master)](https://travis-ci.org/ajitsing/rails_distributed_tracing)
|
8
10
|
[![Twitter Follow](https://img.shields.io/twitter/follow/Ajit5ingh.svg?style=social)](https://twitter.com/Ajit5ingh)
|
@@ -21,7 +23,7 @@ If the service is origin service, `DistributedTracing.request_id_tag` will creat
|
|
21
23
|
require 'rails_distributed_tracing'
|
22
24
|
|
23
25
|
class Application < Rails::Application
|
24
|
-
config.log_tags = [DistributedTracing.
|
26
|
+
config.log_tags = [DistributedTracing.log_tag]
|
25
27
|
end
|
26
28
|
```
|
27
29
|
|
@@ -41,20 +43,41 @@ source service should always pass the request id to the destination service.
|
|
41
43
|
When a request id is generated `rails_distributed_tracing` holds that request id till the request returns the response. You can access that request_id anywhere in your application code with the help of below APIs.
|
42
44
|
|
43
45
|
```ruby
|
44
|
-
DistributedTracing.
|
46
|
+
DistributedTracing.trace_id
|
47
|
+
#=> '8ed7e37b-94e8-4875-afb4-6b4cf1783817'
|
45
48
|
```
|
46
49
|
|
47
|
-
|
50
|
+
## Sidekiq
|
51
|
+
```ruby
|
52
|
+
Sidekiq.configure_server do |config|
|
53
|
+
config.server_middleware do |chain|
|
54
|
+
chain.add DistributedTracing::SidekiqMiddleware::Server
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
Sidekiq.configure_client do |config|
|
59
|
+
config.client_middleware do |chain|
|
60
|
+
chain.add DistributedTracing::SidekiqMiddleware::Client
|
61
|
+
end
|
62
|
+
end
|
63
|
+
```
|
48
64
|
|
65
|
+
## Faraday
|
49
66
|
```ruby
|
50
|
-
|
51
|
-
|
67
|
+
connection = Faraday.new("http://google.com/") do |conn|
|
68
|
+
conn.use DistributedTracing::FaradayMiddleware
|
69
|
+
end
|
52
70
|
```
|
53
71
|
|
54
|
-
|
72
|
+
Make sure that faraday and sidekiq gems are loaded before `rails_distributed_tracing`. Otherwise rails_distributed_tracing will not load the faraday and sidekiq related classes.
|
55
73
|
|
56
|
-
|
74
|
+
To ensure that `sidekiq` and `faraday` are loaded before `rails_distributed_tracing`, add sidekiq and faraday gem before rails_distributed_tracing in Gemfile. So that when rails load the Gemfile, sidekiq and faraday loaded before rails_distributed_tracing gem.
|
57
75
|
|
76
|
+
## Other
|
77
|
+
Add below headers to the outgoing request headers.
|
78
|
+
```ruby
|
79
|
+
{DistributedTracing::TRACE_ID => DistributedTracing.trace_id}
|
80
|
+
```
|
58
81
|
|
59
82
|
## Contributing
|
60
83
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_distributed_tracing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ajit Singh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|