opencensus-jaeger 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +77 -0
- data/.gitignore +15 -0
- data/.gitmodules +3 -0
- data/.rspec +3 -0
- data/.rubocop.yml +36 -0
- data/.travis.yml +7 -0
- data/CHANGELOG.md +6 -0
- data/CODEOWNERS +13 -0
- data/CODE_OF_CONDUCT.md +43 -0
- data/Gemfile +3 -0
- data/LICENSE +201 -0
- data/README.md +72 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/examples/.byebug_history +97 -0
- data/examples/Gemfile +9 -0
- data/examples/Gemfile.lock +46 -0
- data/examples/config.ru +15 -0
- data/examples/example.rb +25 -0
- data/lib/opencensus-jaeger.rb +4 -0
- data/lib/opencensus/jaeger.rb +12 -0
- data/lib/opencensus/jaeger/version.rb +5 -0
- data/lib/opencensus/logging.rb +24 -0
- data/lib/opencensus/trace/exporters/jaeger_driver.rb +125 -0
- data/lib/opencensus/trace/exporters/jaeger_driver/intermediate_transport.rb +25 -0
- data/lib/opencensus/trace/exporters/jaeger_driver/udp_sender.rb +28 -0
- data/lib/opencensus/trace/exporters/jaeger_driver/udp_transport.rb +43 -0
- data/lib/opencensus/trace/exporters/jaeger_exporter.rb +108 -0
- data/opencensus-jaeger.gemspec +45 -0
- data/scripts/publish.rb +7 -0
- data/scripts/rename_collectors.rb +88 -0
- data/thrift/agent.thrift +27 -0
- data/thrift/gen-rb/jaeger/thrift/agent.rb +117 -0
- data/thrift/gen-rb/jaeger/thrift/agent_constants.rb +13 -0
- data/thrift/gen-rb/jaeger/thrift/agent_types.rb +14 -0
- data/thrift/gen-rb/jaeger/thrift/collector.rb +82 -0
- data/thrift/gen-rb/jaeger/thrift/jaeger_constants.rb +13 -0
- data/thrift/gen-rb/jaeger/thrift/jaeger_types.rb +213 -0
- data/thrift/gen-rb/zipkin/zipkin_collector.rb +80 -0
- data/thrift/gen-rb/zipkin/zipkincore_constants.rb +43 -0
- data/thrift/gen-rb/zipkin/zipkincore_types.rb +223 -0
- data/thrift/jaeger.thrift +86 -0
- data/thrift/zipkincore.thrift +345 -0
- metadata +161 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ab04faa511449c33f5c7c610f30e22ca6f2233be
|
4
|
+
data.tar.gz: 1a0c9161dc48a8176825553d3626b2b60b5cac9d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 00d6fbd953b5634dc73e4bd142392362242ac19b5fa5f3d970d67e3271b6fbfcc96744092363af5155c227602a115aa1a9c53c96a6d12c86a23c3a80134ee1d1
|
7
|
+
data.tar.gz: 54883e2569cd6b385779b36f492d892cc6f12906653e0d5d3e7d3ab441246165e205702755a30fe90a58b20d27b16e63b9b4b51d8ea2d1faf4462ddce61927c2
|
@@ -0,0 +1,77 @@
|
|
1
|
+
version: 2
|
2
|
+
|
3
|
+
test: &test
|
4
|
+
- checkout
|
5
|
+
- run: bundle install --path vendor/bundle --jobs=4 --retry=3
|
6
|
+
- run: bundle exec rspec
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
publish:
|
10
|
+
docker:
|
11
|
+
- image: ehdevops/ruby240:latest
|
12
|
+
steps:
|
13
|
+
- checkout
|
14
|
+
- run: bundle check || bundle install --path=vendor/bundle --jobs=4 --retry=3
|
15
|
+
- run:
|
16
|
+
name: Deploy to gemfury
|
17
|
+
command: |
|
18
|
+
bundle exec ruby scripts/publish.rb
|
19
|
+
|
20
|
+
test-2.3:
|
21
|
+
steps: *test
|
22
|
+
docker:
|
23
|
+
- image: circleci/ruby:2.3-stretch
|
24
|
+
environment:
|
25
|
+
LOG_LEVEL: DEBUG
|
26
|
+
|
27
|
+
test-2.4:
|
28
|
+
steps: *test
|
29
|
+
docker:
|
30
|
+
- image: circleci/ruby:2.4-stretch
|
31
|
+
environment:
|
32
|
+
LOG_LEVEL: DEBUG
|
33
|
+
|
34
|
+
test-2.5:
|
35
|
+
steps: *test
|
36
|
+
docker:
|
37
|
+
- image: circleci/ruby:2.5-stretch
|
38
|
+
environment:
|
39
|
+
LOG_LEVEL: DEBUG
|
40
|
+
|
41
|
+
test-2.6:
|
42
|
+
steps: *test
|
43
|
+
docker:
|
44
|
+
- image: circleci/ruby:2.6-stretch
|
45
|
+
environment:
|
46
|
+
LOG_LEVEL: DEBUG
|
47
|
+
|
48
|
+
workflows:
|
49
|
+
version: 2
|
50
|
+
test:
|
51
|
+
jobs:
|
52
|
+
- test-2.3:
|
53
|
+
context: org-global
|
54
|
+
- test-2.4:
|
55
|
+
context: org-global
|
56
|
+
- test-2.5:
|
57
|
+
context: org-global
|
58
|
+
- test-2.6:
|
59
|
+
context: org-global
|
60
|
+
- publish_new_version:
|
61
|
+
type: approval
|
62
|
+
filters:
|
63
|
+
branches:
|
64
|
+
only:
|
65
|
+
- employment-hero
|
66
|
+
- publish:
|
67
|
+
context: org-global
|
68
|
+
filters:
|
69
|
+
branches:
|
70
|
+
only:
|
71
|
+
- employment-hero
|
72
|
+
requires:
|
73
|
+
- test-2.3
|
74
|
+
- test-2.4
|
75
|
+
- test-2.5
|
76
|
+
- test-2.6
|
77
|
+
- publish_new_version
|
data/.gitignore
ADDED
data/.gitmodules
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- "opencensus-jaeger.gemspec"
|
4
|
+
- "test/**/*"
|
5
|
+
- "thrift/**/*"
|
6
|
+
- "examples/**/*"
|
7
|
+
|
8
|
+
Documentation:
|
9
|
+
Enabled: false
|
10
|
+
Metrics/BlockLength:
|
11
|
+
Enabled: false
|
12
|
+
Metrics/MethodLength:
|
13
|
+
Enabled: false
|
14
|
+
Metrics/ModuleLength:
|
15
|
+
Enabled: false
|
16
|
+
Metrics/AbcSize:
|
17
|
+
Enabled: false
|
18
|
+
Metrics/ClassLength:
|
19
|
+
Enabled: false
|
20
|
+
Metrics/ParameterLists:
|
21
|
+
Enabled: false
|
22
|
+
Metrics/PerceivedComplexity:
|
23
|
+
Enabled: false
|
24
|
+
Metrics/CyclomaticComplexity:
|
25
|
+
Enabled: false
|
26
|
+
Lint/UnusedMethodArgument:
|
27
|
+
Enabled: false
|
28
|
+
Layout/EmptyLineAfterGuardClause:
|
29
|
+
Enabled: false
|
30
|
+
Style/IfUnlessModifier:
|
31
|
+
Enabled: false
|
32
|
+
Style/ModuleFunction:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
Metrics/LineLength:
|
36
|
+
Max: 120
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
data/CODEOWNERS
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Lines starting with '#' are comments.
|
2
|
+
# Each line is a file pattern followed by one or more owners.
|
3
|
+
|
4
|
+
# These owners will be the default owners for everything in the repo.
|
5
|
+
* @luong-komorebi luong.vo@employment-hero.com
|
6
|
+
|
7
|
+
# Order is important. The last matching pattern has the most precedence.
|
8
|
+
# So if a pull request only touches javascript files, only these owners
|
9
|
+
# will be requested to review.
|
10
|
+
*.js @octocat @github/js
|
11
|
+
|
12
|
+
# You can also use email addresses if you prefer.
|
13
|
+
docs/* docs@example.com
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project,
|
4
|
+
and in the interest of fostering an open and welcoming community,
|
5
|
+
we pledge to respect all people who contribute through reporting issues,
|
6
|
+
posting feature requests, updating documentation,
|
7
|
+
submitting pull requests or patches, and other activities.
|
8
|
+
|
9
|
+
We are committed to making participation in this project
|
10
|
+
a harassment-free experience for everyone,
|
11
|
+
regardless of level of experience, gender, gender identity and expression,
|
12
|
+
sexual orientation, disability, personal appearance,
|
13
|
+
body size, race, ethnicity, age, religion, or nationality.
|
14
|
+
|
15
|
+
Examples of unacceptable behavior by participants include:
|
16
|
+
|
17
|
+
* The use of sexualized language or imagery
|
18
|
+
* Personal attacks
|
19
|
+
* Trolling or insulting/derogatory comments
|
20
|
+
* Public or private harassment
|
21
|
+
* Publishing other's private information,
|
22
|
+
such as physical or electronic
|
23
|
+
addresses, without explicit permission
|
24
|
+
* Other unethical or unprofessional conduct.
|
25
|
+
|
26
|
+
Project maintainers have the right and responsibility to remove, edit, or reject
|
27
|
+
comments, commits, code, wiki edits, issues, and other contributions
|
28
|
+
that are not aligned to this Code of Conduct.
|
29
|
+
By adopting this Code of Conduct,
|
30
|
+
project maintainers commit themselves to fairly and consistently
|
31
|
+
applying these principles to every aspect of managing this project.
|
32
|
+
Project maintainers who do not follow or enforce the Code of Conduct
|
33
|
+
may be permanently removed from the project team.
|
34
|
+
|
35
|
+
This code of conduct applies both within project spaces and in public spaces
|
36
|
+
when an individual is representing the project or its community.
|
37
|
+
|
38
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior
|
39
|
+
may be reported by opening an issue
|
40
|
+
or contacting one or more of the project maintainers.
|
41
|
+
|
42
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0,
|
43
|
+
available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
Apache License
|
2
|
+
Version 2.0, January 2004
|
3
|
+
http://www.apache.org/licenses/
|
4
|
+
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
6
|
+
|
7
|
+
1. Definitions.
|
8
|
+
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
11
|
+
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
13
|
+
the copyright owner that is granting the License.
|
14
|
+
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
16
|
+
other entities that control, are controlled by, or are under common
|
17
|
+
control with that entity. For the purposes of this definition,
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
19
|
+
direction or management of such entity, whether by contract or
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
22
|
+
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
24
|
+
exercising permissions granted by this License.
|
25
|
+
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
27
|
+
including but not limited to software source code, documentation
|
28
|
+
source, and configuration files.
|
29
|
+
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
31
|
+
transformation or translation of a Source form, including but
|
32
|
+
not limited to compiled object code, generated documentation,
|
33
|
+
and conversions to other media types.
|
34
|
+
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
36
|
+
Object form, made available under the License, as indicated by a
|
37
|
+
copyright notice that is included in or attached to the work
|
38
|
+
(an example is provided in the Appendix below).
|
39
|
+
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
46
|
+
the Work and Derivative Works thereof.
|
47
|
+
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
49
|
+
the original version of the Work and any modifications or additions
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
61
|
+
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
64
|
+
subsequently incorporated within the Work.
|
65
|
+
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
72
|
+
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
78
|
+
where such license applies only to those patent claims licensable
|
79
|
+
by such Contributor that are necessarily infringed by their
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
82
|
+
institute patent litigation against any entity (including a
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
85
|
+
or contributory patent infringement, then any patent licenses
|
86
|
+
granted to You under this License for that Work shall terminate
|
87
|
+
as of the date such litigation is filed.
|
88
|
+
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
91
|
+
modifications, and in Source or Object form, provided that You
|
92
|
+
meet the following conditions:
|
93
|
+
|
94
|
+
(a) You must give any other recipients of the Work or
|
95
|
+
Derivative Works a copy of this License; and
|
96
|
+
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
98
|
+
stating that You changed the files; and
|
99
|
+
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
102
|
+
attribution notices from the Source form of the Work,
|
103
|
+
excluding those notices that do not pertain to any part of
|
104
|
+
the Derivative Works; and
|
105
|
+
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
108
|
+
include a readable copy of the attribution notices contained
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
111
|
+
of the following places: within a NOTICE text file distributed
|
112
|
+
as part of the Derivative Works; within the Source form or
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
114
|
+
within a display generated by the Derivative Works, if and
|
115
|
+
wherever such third-party notices normally appear. The contents
|
116
|
+
of the NOTICE file are for informational purposes only and
|
117
|
+
do not modify the License. You may add Your own attribution
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
120
|
+
that such additional attribution notices cannot be construed
|
121
|
+
as modifying the License.
|
122
|
+
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
124
|
+
may provide additional or different license terms and conditions
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
128
|
+
the conditions stated in this License.
|
129
|
+
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
133
|
+
this License, without any additional terms or conditions.
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
135
|
+
the terms of any separate license agreement you may have executed
|
136
|
+
with Licensor regarding such Contributions.
|
137
|
+
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
140
|
+
except as required for reasonable and customary use in describing the
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
142
|
+
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
152
|
+
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
158
|
+
incidental, or consequential damages of any character arising as a
|
159
|
+
result of this License or out of the use or inability to use the
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
162
|
+
other commercial damages or losses), even if such Contributor
|
163
|
+
has been advised of the possibility of such damages.
|
164
|
+
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
168
|
+
or other liability obligations and/or rights consistent with this
|
169
|
+
License. However, in accepting such obligations, You may act only
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
174
|
+
of your accepting any such warranty or additional liability.
|
175
|
+
|
176
|
+
END OF TERMS AND CONDITIONS
|
177
|
+
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
179
|
+
|
180
|
+
To apply the Apache License to your work, attach the following
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
182
|
+
replaced with your own identifying information. (Don't include
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
184
|
+
comment syntax for the file format. We also recommend that a
|
185
|
+
file or class name and description of purpose be included on the
|
186
|
+
same "printed page" as the copyright notice for easier
|
187
|
+
identification within third-party archives.
|
188
|
+
|
189
|
+
Copyright 2019 Luong-Vo
|
190
|
+
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
192
|
+
you may not use this file except in compliance with the License.
|
193
|
+
You may obtain a copy of the License at
|
194
|
+
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
196
|
+
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
200
|
+
See the License for the specific language governing permissions and
|
201
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# OpenCensus::Jaeger
|
2
|
+
|
3
|
+
![](https://user-images.githubusercontent.com/15828926/55776200-24446f80-5ac6-11e9-9660-be9a987cdf4a.png)
|
4
|
+
|
5
|
+
This repository contains the source to `opencensus-jaeger` gem. This library is a plugin for Ruby OpenCensus that exports data to Jaeger. Read Author's Note at the end of this readme for more information.
|
6
|
+
|
7
|
+
# Installation
|
8
|
+
|
9
|
+
`$ gem install opencensus-jaeger`
|
10
|
+
|
11
|
+
or, place it in Bunlder's Gemfile
|
12
|
+
|
13
|
+
`gem 'opencensus-jaeger'` and run `bundle install`
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
Usage is pretty straight forward:
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
OpenCensus.configure do |c|
|
20
|
+
c.trace.exporter = OpenCensus::Trace::Exporters::JaegerExporter.new(
|
21
|
+
service_name: 'some_name',
|
22
|
+
host: 'your_jaeger_agent_host', # default to 'localhost'
|
23
|
+
port: 'your_jaeger_agent_udp_port', # default to 6831
|
24
|
+
tags: { 'something': 'useful' },
|
25
|
+
max_packet_length: 12345, # config if you want something smaller than DEFAULT_MAX_LENGTH,
|
26
|
+
protocol_class: ::Thrift::CompactProtocol # currently supporting only compact protocol
|
27
|
+
)
|
28
|
+
end
|
29
|
+
```
|
30
|
+
|
31
|
+
# Running Example
|
32
|
+
The example is just a running webserver with two endpoints:
|
33
|
+
|
34
|
+
1. One main endpoint `/` returning `Hello world` to test tracing with Opencensus on the Rack Middleware level
|
35
|
+
2. One endpoint `/lengthy` would make an outgoing http request and then sleep for some seconds to test tracing with Opencensus on Faraday Middleware level and test adding a custom span.
|
36
|
+
|
37
|
+
To setup, first you need to run Jaeger, whose introduction could easily be found here: https://www.jaegertracing.io/docs/1.8/getting-started/
|
38
|
+
I would recommend using one command to start everything, although the things that we need the most is the UDP Agent running at port 6381, as this exporter will send span data to the jaeger agent via UDP over thrift protocol.
|
39
|
+
|
40
|
+
```bash
|
41
|
+
docker run -d --name jaeger \
|
42
|
+
-e COLLECTOR_ZIPKIN_HTTP_PORT=9411 \
|
43
|
+
-p 5775:5775/udp \
|
44
|
+
-p 6831:6831/udp \
|
45
|
+
-p 6832:6832/udp \
|
46
|
+
-p 5778:5778 \
|
47
|
+
-p 16686:16686 \
|
48
|
+
-p 14268:14268 \
|
49
|
+
-p 9411:9411 \
|
50
|
+
jaegertracing/all-in-one:1.8
|
51
|
+
```
|
52
|
+
|
53
|
+
Then install all the necessary gems and run the server:
|
54
|
+
```bash
|
55
|
+
cd examples
|
56
|
+
bundle
|
57
|
+
bundle exec rackup -s thin -p 4567
|
58
|
+
```
|
59
|
+
|
60
|
+
If there is any error installing with bundle, you should tinker the gemfile a bit since I load this gem locally with a `path`.
|
61
|
+
After everything is up and running, head to `localhost:4567` and play around with the endpoints I listed above.
|
62
|
+
Also, you would need to go to `localhost:16686` to see the traces display by jaeger UI, which means that we succeeded in collecting them via Opencensus and exporting data to Jaeger.
|
63
|
+
|
64
|
+
## Contributing
|
65
|
+
Open a PR or issue to suggest/fix/implement features/bugs
|
66
|
+
|
67
|
+
### Author's note
|
68
|
+
|
69
|
+
OpenCensus is a platform and provider-agnostic framework for distributed tracing and stats collection. For more information, see https://opencensus.io.
|
70
|
+
This library is not official and is created by me - [luongvo209](https://www.github.com/luongvo209). I wrote this at the time when there were no exporter to jaeger for opencensus ruby.
|
71
|
+
~I have not published this gem to reserve the name for the official gem. The gem is currently used in Production at our organisation.~
|
72
|
+
~I am awaiting reviews from official OpenCensus's side (I have emailed @dazuma and the official Opencensus's mailing list) since I hope that it would one day make it to the official organisation of opencensus. Or at least I know that I don't conflict with someone on their side if they are already working on this.~
|