zipkin-tracer 0.47.0 → 0.48.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CONTRIBUTING.md +11 -0
- data/.github/ISSUE_TEMPLATE/bug.md +15 -0
- data/.github/ISSUE_TEMPLATE/config.yml +5 -0
- data/.github/ISSUE_TEMPLATE/feature.md +19 -0
- data/.github/workflows/deploy.yml +34 -0
- data/.github/workflows/test.yml +52 -0
- data/.gitignore +4 -0
- data/Appraisals +4 -0
- data/CHANGELOG.md +12 -0
- data/README.md +3 -1
- data/RELEASE.md +43 -5
- data/build-bin/README.md +218 -0
- data/build-bin/configure_deploy +9 -0
- data/build-bin/configure_test +9 -0
- data/build-bin/deploy +11 -0
- data/build-bin/gem/bundle_install +20 -0
- data/build-bin/gem/configure_gem_credentials +26 -0
- data/build-bin/gem/gem_push +39 -0
- data/build-bin/test +8 -0
- data/gemfiles/faraday_2.x.gemfile +18 -0
- data/lib/zipkin-tracer/rack/zipkin-tracer.rb +1 -1
- data/lib/zipkin-tracer/version.rb +1 -1
- data/lib/zipkin-tracer/zipkin_sender_base.rb +2 -4
- data/zipkin-tracer.gemspec +2 -1
- metadata +34 -6
- data/.travis.yml +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37efbe4cb404d2d34f93fcc3b5aaa86e962579aeff0f83c9a2326e10f6057eb3
|
4
|
+
data.tar.gz: 2ee5fd81a8e614797a08fa74ced37269d7e8d492ae90690812cf78510538bdf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de1d349955b7e5999488015abc21480a0327c4e956e3d6aa5bcbb92c2769a36af2f51a9e731aa33406c739f688f520bd32f1efe4438bf9ba39160e9d5301c544
|
7
|
+
data.tar.gz: 875f8c728dd41123c2fbaaa2d039863d88ace63a00bedbf91b156ae41740e761a5347e853fa86614db992892c504cda0e2d29b1fd88cf1fd881fef07d637502c
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Contributing to Zipkin
|
2
|
+
|
3
|
+
If you would like to contribute code, fork this GitHub repository and
|
4
|
+
send a pull request (on a branch other than `master` or `gh-pages`).
|
5
|
+
|
6
|
+
## License
|
7
|
+
|
8
|
+
By contributing your code, you agree to license your contribution under
|
9
|
+
the terms of the [APLv2](../LICENSE).
|
10
|
+
|
11
|
+
All files are copyright "The OpenZipkin Authors" and released with the Apache 2.0 license.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
name: Bug
|
3
|
+
about: If you’ve found a bug, spend the time to write a failing test. Bugs with tests get fixed and stay fixed. If you have a solution in mind, skip raising an issue and open a pull request instead.
|
4
|
+
labels: bug
|
5
|
+
---
|
6
|
+
## Describe the Bug
|
7
|
+
A clear and concise description of what the bug is. If you have a solution in mind, skip raising an issue and open a pull request instead.
|
8
|
+
|
9
|
+
Regardless, the best is to spend some time to write a failing test. Bugs with tests get fixed and stay fixed.
|
10
|
+
|
11
|
+
## Steps to Reproduce
|
12
|
+
Steps to reproduce the behavior:
|
13
|
+
|
14
|
+
## Expected Behaviour
|
15
|
+
Suggest what you think correct behaviour should be. Note, it may be solved differently depending on the problem.
|
@@ -0,0 +1,5 @@
|
|
1
|
+
blank_issues_enabled: false
|
2
|
+
contact_links:
|
3
|
+
- name: Question
|
4
|
+
url: https://gitter.im/openzipkin/zipkin
|
5
|
+
about: Please ask questions about how to do something or to understand why something isn't working on our Gitter chat - we'll be happy to respond there in detail. This issue tracker is not for questions.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
name: Feature Request
|
3
|
+
about: Please first, look at existing issues to see if the feature has been requested before.
|
4
|
+
labels: enhancement
|
5
|
+
---
|
6
|
+
Please first, look at [existing issues](https://github.com/openzipkin/zipkin-ruby/issues) to see if the feature has been requested before. If you don't find anything tell us what problem you’re trying to solve. Often a solution already exists! Don’t send pull requests to implement new features without first getting our support. Sometimes we leave features out on purpose to keep the project small.
|
7
|
+
|
8
|
+
## Feature
|
9
|
+
Description of the feature
|
10
|
+
|
11
|
+
## Rationale
|
12
|
+
Why would this feature help others besides me?
|
13
|
+
|
14
|
+
## Example Scenario
|
15
|
+
What kind of use cases would benefit from this feature?
|
16
|
+
|
17
|
+
## Prior Art
|
18
|
+
* Links to prior art
|
19
|
+
* More links
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# yamllint --format github .github/workflows/deploy.yml
|
2
|
+
---
|
3
|
+
name: deploy
|
4
|
+
|
5
|
+
# We deploy on a release versions, regardless of if the commit is documentation-only or not.
|
6
|
+
#
|
7
|
+
# See https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
|
8
|
+
on:
|
9
|
+
push:
|
10
|
+
tags: '[0-9]+.[0-9]+.[0-9]+**' # Ex. 1.2.3
|
11
|
+
|
12
|
+
jobs:
|
13
|
+
deploy:
|
14
|
+
runs-on: ubuntu-20.04 # newest available distribution, aka focal
|
15
|
+
steps:
|
16
|
+
- name: Checkout Repository
|
17
|
+
uses: actions/checkout@v2
|
18
|
+
with:
|
19
|
+
fetch-depth: 1 # full history is not needed
|
20
|
+
- name: Set up Ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: 2.7
|
24
|
+
bundler-cache: true
|
25
|
+
- name: Deploy
|
26
|
+
env:
|
27
|
+
# RUBYGEMS_API_KEY=<hex token value>
|
28
|
+
# - needs to own the gem
|
29
|
+
# - generated at https://rubygems.org/settings/edit
|
30
|
+
RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
31
|
+
BUNDLE_GEMFILE: gemfiles/faraday_1.x.gemfile
|
32
|
+
run: | # GITHUB_REF will be refs/tags/MAJOR.MINOR.PATCH
|
33
|
+
build-bin/configure_deploy &&
|
34
|
+
build-bin/deploy $(echo ${GITHUB_REF} | cut -d/ -f 3)
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# yamllint --format github .github/workflows/test.yml
|
2
|
+
---
|
3
|
+
name: test
|
4
|
+
|
5
|
+
# We don't test documentation-only commits.
|
6
|
+
on:
|
7
|
+
# We run tests on non-tagged pushes to master
|
8
|
+
push:
|
9
|
+
tags: ''
|
10
|
+
branches: master
|
11
|
+
paths-ignore: '**/*.md'
|
12
|
+
# We also run tests on pull requests targeted at the master branch.
|
13
|
+
pull_request:
|
14
|
+
branches: master
|
15
|
+
paths-ignore: '**/*.md'
|
16
|
+
|
17
|
+
jobs:
|
18
|
+
test:
|
19
|
+
runs-on: ubuntu-20.04 # newest available distribution, aka focal
|
20
|
+
strategy:
|
21
|
+
fail-fast: false
|
22
|
+
matrix: # https://github.com/ruby/setup-ruby/blob/master/README.md#supported-versions
|
23
|
+
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, jruby-9.1, jruby-9.2]
|
24
|
+
gemfile:
|
25
|
+
- gemfiles/faraday_0.x.gemfile
|
26
|
+
- gemfiles/faraday_1.x.gemfile
|
27
|
+
- gemfiles/faraday_2.x.gemfile
|
28
|
+
exclude:
|
29
|
+
- ruby: 2.3
|
30
|
+
gemfile: gemfiles/faraday_2.x.gemfile
|
31
|
+
- ruby: 2.4
|
32
|
+
gemfile: gemfiles/faraday_2.x.gemfile
|
33
|
+
- ruby: 2.5
|
34
|
+
gemfile: gemfiles/faraday_2.x.gemfile
|
35
|
+
- ruby: jruby-9.1
|
36
|
+
gemfile: gemfiles/faraday_2.x.gemfile
|
37
|
+
- ruby: jruby-9.2
|
38
|
+
gemfile: gemfiles/faraday_2.x.gemfile
|
39
|
+
steps:
|
40
|
+
- name: Checkout Repository
|
41
|
+
uses: actions/checkout@v2
|
42
|
+
with:
|
43
|
+
fetch-depth: 1 # full history is not needed
|
44
|
+
- name: Set up Ruby
|
45
|
+
uses: ruby/setup-ruby@v1
|
46
|
+
with:
|
47
|
+
ruby-version: ${{ matrix.ruby }}
|
48
|
+
bundler-cache: true
|
49
|
+
- name: Test
|
50
|
+
run: build-bin/configure_test && build-bin/test
|
51
|
+
env:
|
52
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
data/.gitignore
CHANGED
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
# 0.48.0
|
2
|
+
* Allow Faraday 2.x.
|
3
|
+
|
4
|
+
# 0.47.3
|
5
|
+
* Moved CI to [GitHub Actions](https://github.com/openzipkin/zipkin-ruby/workflows).
|
6
|
+
|
7
|
+
# 0.47.2
|
8
|
+
* Fix to not flush local component span when a server span or a consumer span is in the stack.
|
9
|
+
|
10
|
+
# 0.47.1
|
11
|
+
* Fix to set `SERVER` span kind at the beginning to avoid being flushed before closing.
|
12
|
+
|
1
13
|
# 0.47.0
|
2
14
|
* Add a `check_routes` option to make the routable request check optional.
|
3
15
|
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# ZipkinTracer: Zipkin client for Ruby
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Gitter chat](http://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg)](https://gitter.im/openzipkin/zipkin)
|
4
|
+
[![Build Status](https://github.com/openzipkin/zipkin-ruby/workflows/test/badge.svg)](https://github.com/openzipkin/zipkin-ruby/actions?query=workflow%3Atest)
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/zipkin-tracer.svg)](https://badge.fury.io/rb/zipkin-tracer)
|
4
6
|
|
5
7
|
Rack and Faraday integration middlewares for Zipkin tracing.
|
6
8
|
|
data/RELEASE.md
CHANGED
@@ -1,6 +1,44 @@
|
|
1
|
-
|
1
|
+
# OpenZipkin Release Process
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
This repo uses semantic versions. Please keep this in mind when choosing version numbers.
|
4
|
+
|
5
|
+
1. **Alert others you are releasing**
|
6
|
+
|
7
|
+
There should be no commits made to master while the release is in progress (about 10 minutes). Before you start
|
8
|
+
a release, alert others on [gitter](https://gitter.im/openzipkin/zipkin) so that they don't accidentally merge
|
9
|
+
anything. If they do, and the build fails because of that, you'll have to recreate the release tag described below.
|
10
|
+
|
11
|
+
1. **Push a git tag**
|
12
|
+
|
13
|
+
The tag should formatted `MAJOR.MINOR.PATCH`, ex `git tag 1.18.1 && git push origin 1.18.1`.
|
14
|
+
|
15
|
+
1. **Wait for CI**
|
16
|
+
|
17
|
+
The `MAJOR.MINOR.PATCH` tag triggers [`build-bin/deploy`](build-bin/deploy), which does the following:
|
18
|
+
* https://rubygems.org/gems/zipkin-tracer [`build-bin/gem/gem_push`](build-bin/gem/gem_push)
|
19
|
+
|
20
|
+
## Credentials
|
21
|
+
|
22
|
+
The release process uses various credentials. If you notice something failing due to unauthorized,
|
23
|
+
look at the notes in [.github/workflows/deploy.yml] and check the [org secrets](https://github.com/organizations/openzipkin/settings/secrets/actions).
|
24
|
+
|
25
|
+
## Manually releasing
|
26
|
+
|
27
|
+
If for some reason, you lost access to CI or otherwise cannot get automation to work, bear in mind
|
28
|
+
this is a normal ruby project, and can be released accordingly.
|
29
|
+
|
30
|
+
```bash
|
31
|
+
# First, set variable according to your personal credentials. These would normally be assigned as
|
32
|
+
# org secrets: https://github.com/organizations/openzipkin/settings/secrets/actions
|
33
|
+
export RUBYGEMS_API_KEY=your_api_key
|
34
|
+
release_version=xx-version-to-release-xx
|
35
|
+
|
36
|
+
# now from latest master, create the MAJOR.MINOR.PATCH tag
|
37
|
+
git tag ${release_version}
|
38
|
+
|
39
|
+
# Run the deploy using the version you added as a tag
|
40
|
+
./build-bin/deploy ${release_version}
|
41
|
+
|
42
|
+
# Finally, push the tag
|
43
|
+
git push origin ${release_version}
|
44
|
+
```
|
data/build-bin/README.md
ADDED
@@ -0,0 +1,218 @@
|
|
1
|
+
# Test and Deploy scripts
|
2
|
+
|
3
|
+
This is a Ruby project, which uses standard conventions for test and deploy.
|
4
|
+
|
5
|
+
Test is normal, except there's a matrix in [CI setup](../.github/workflows/test.yml).
|
6
|
+
|
7
|
+
To create a release, push a MAJOR.MINOR.PATCH tag (ex `0.47.2`). Below are details about the deployment process.
|
8
|
+
|
9
|
+
Notably, the [gem version](../lib/zipkin-tracer/version.rb) is lazy set, defaulting to `0.0.0`. When
|
10
|
+
a release MAJOR.MINOR.PATCH tag (ex `0.47.2`) is pushed, this file is overwritten as a side effect of running
|
11
|
+
[deploy]. The release version is not written into git history except as a part of [../CHANGELOG.md].
|
12
|
+
|
13
|
+
[//]: # (Below here should be standard for all projects)
|
14
|
+
|
15
|
+
## Build Overview
|
16
|
+
`build-bin` holds portable scripts used in CI to test and deploy the project.
|
17
|
+
|
18
|
+
The scripts here are portable. They do not include any CI provider-specific logic or ENV variables.
|
19
|
+
This helps `.travis.yml` and `test.yml` (GitHub Actions) contain nearly the same contents, even if
|
20
|
+
certain OpenZipkin projects need slight adjustments here. Portability has proven necessary, as
|
21
|
+
OpenZipkin has had to transition CI providers many times due to feature and quota constraints.
|
22
|
+
|
23
|
+
These scripts serve a second purpose, which is to facilitate manual releases, which has also
|
24
|
+
happened many times due usually to service outages of CI providers. While tempting to use
|
25
|
+
CI-provider specific tools, doing so can easily create a dependency where no one knows how to
|
26
|
+
release anymore. Do not use provider-specific mechanisms to implement release flow. Instead,
|
27
|
+
automate triggering of the scripts here.
|
28
|
+
|
29
|
+
The only scripts that should be modified per project are in the base directory. Those in sub
|
30
|
+
directories, such as [docker], should not vary project to project except accident of version drift.
|
31
|
+
Intentional changes in sub directories should be relevant and tested on multiple projects to ensure
|
32
|
+
they can be blindly copy/pasted.
|
33
|
+
|
34
|
+
Conversely, the files in the base directory are project specific entry-points for test and deploy
|
35
|
+
actions and are entirely appropriate to vary per project. Here's an overview:
|
36
|
+
|
37
|
+
## Test
|
38
|
+
|
39
|
+
Test builds and runs any tests of the project, including integration tests. CI providers should be
|
40
|
+
configured to run tests on pull requests or pushes to the master branch, notably when the tag is
|
41
|
+
blank. Tests should not run on documentation-only commits. Tests must not depend on authenticated
|
42
|
+
resources, as running tests can leak credentials. Git checkouts should include the full history so
|
43
|
+
that license headers or other git analysis can take place.
|
44
|
+
|
45
|
+
* [configure_test] - Sets up build environment for tests.
|
46
|
+
* [test] - Builds and runs tests for this project.
|
47
|
+
|
48
|
+
### Example GitHub Actions setup
|
49
|
+
|
50
|
+
A simplest GitHub Actions `test.yml` runs tests after configuring them, but only on relevant event
|
51
|
+
conditions. The name `test.yml` and job `test` allows easy references to status badges and parity of
|
52
|
+
the scripts it uses.
|
53
|
+
|
54
|
+
The `on:` section obviates job creation and resource usage for irrelevant events. Notably, GitHub
|
55
|
+
Actions includes the ability to skip documentation-only jobs.
|
56
|
+
|
57
|
+
Combine [configure_test] and [test] into the same `run:` when `configure_test` primes file system
|
58
|
+
cache.
|
59
|
+
|
60
|
+
Here's a partial `test.yml` including only the aspects mentioned above.
|
61
|
+
```yaml
|
62
|
+
on:
|
63
|
+
push:
|
64
|
+
tags: ''
|
65
|
+
branches: master
|
66
|
+
paths-ignore: '**/*.md'
|
67
|
+
pull_request:
|
68
|
+
branches: master
|
69
|
+
paths-ignore: '**/*.md'
|
70
|
+
|
71
|
+
jobs:
|
72
|
+
test:
|
73
|
+
steps:
|
74
|
+
- name: Checkout Repository
|
75
|
+
uses: actions/checkout@v2
|
76
|
+
with:
|
77
|
+
fetch-depth: 0 # full git history
|
78
|
+
- name: Test
|
79
|
+
run: build-bin/configure_test && build-bin/test
|
80
|
+
```
|
81
|
+
|
82
|
+
### Example Travis setup
|
83
|
+
`.travis.yml` is a monolithic configuration file broken into stages, of which the default is "test".
|
84
|
+
A simplest Travis `test` job configures tests in `install` and runs them as `script`, but only on
|
85
|
+
relevant event conditions.
|
86
|
+
|
87
|
+
The `if:` section obviates job creation and resource usage for irrelevant events. Travis does not
|
88
|
+
support file conditions. A `before_install` step to skip documentation-only commits will likely
|
89
|
+
complete in less than a minute (10 credit cost).
|
90
|
+
|
91
|
+
Here's a partial `.travis.yml` including only the aspects mentioned above.
|
92
|
+
```yaml
|
93
|
+
git:
|
94
|
+
depth: false # TRAVIS_COMMIT_RANGE requires full commit history.
|
95
|
+
|
96
|
+
jobs:
|
97
|
+
include:
|
98
|
+
- stage: test
|
99
|
+
if: branch = master AND tag IS blank AND type IN (push, pull_request)
|
100
|
+
name: Run unit and integration tests
|
101
|
+
before_install: | # Prevent test build of a documentation-only change.
|
102
|
+
if [ -n "${TRAVIS_COMMIT_RANGE}" ] && ! git diff --name-only "${TRAVIS_COMMIT_RANGE}" -- | grep -qv '\.md$'; then
|
103
|
+
echo "Stopping job as changes only affect documentation (ex. README.md)"
|
104
|
+
travis_terminate 0
|
105
|
+
fi
|
106
|
+
install: ./build-bin/configure_test
|
107
|
+
script: ./build-bin/test
|
108
|
+
```
|
109
|
+
|
110
|
+
When Travis only runs tests (something else does deploy), there's no need to use stages:
|
111
|
+
```yaml
|
112
|
+
git:
|
113
|
+
depth: false # TRAVIS_COMMIT_RANGE requires full commit history.
|
114
|
+
|
115
|
+
if: branch = master AND tag IS blank AND type IN (push, pull_request)
|
116
|
+
before_install: | # Prevent test build of a documentation-only change.
|
117
|
+
if [ -n "${TRAVIS_COMMIT_RANGE}" ] && ! git diff --name-only "${TRAVIS_COMMIT_RANGE}" -- | grep -qv '\.md$'; then
|
118
|
+
echo "Stopping job as changes only affect documentation (ex. README.md)"
|
119
|
+
travis_terminate 0
|
120
|
+
fi
|
121
|
+
install: ./build-bin/configure_test
|
122
|
+
script: ./build-bin/test
|
123
|
+
```
|
124
|
+
|
125
|
+
## Deploy
|
126
|
+
|
127
|
+
Deploy builds and pushes artifacts to a remote repository for master and release commits on it. CI
|
128
|
+
providers deploy pushes to master on when the tag is blank, but not on documentation-only commits.
|
129
|
+
Releases should deploy on version tags (ex `/^[0-9]+\.[0-9]+\.[0-9]+/`), without consideration of if
|
130
|
+
the commit is documentation only or not.
|
131
|
+
|
132
|
+
* [configure_deploy] - Sets up environment and logs in, assuming [configure_test] was not called.
|
133
|
+
* [deploy] - deploys the project, with arg0 being "master" or a release commit like "1.2.3"
|
134
|
+
|
135
|
+
### Example GitHub Actions setup
|
136
|
+
|
137
|
+
A simplest GitHub Actions `deploy.yml` deploys after logging in, but only on relevant event
|
138
|
+
conditions. The name `deploy.yml` and job `deploy` allows easy references to status badges and
|
139
|
+
parity of the scripts it uses.
|
140
|
+
|
141
|
+
The `on:` section obviates job creation and resource usage for irrelevant events. GitHub Actions
|
142
|
+
cannot implement "master, except documentation only-commits" in the same file. Hence, deployments of
|
143
|
+
master will happen even on README change.
|
144
|
+
|
145
|
+
Combine [configure_deploy] and [deploy] into the same `run:` when `configure_deploy` primes file
|
146
|
+
system cache.
|
147
|
+
|
148
|
+
Here's a partial `deploy.yml` including only the aspects mentioned above. Notice env variables are
|
149
|
+
explicitly defined and `on.tags` is a [glob pattern](https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet).
|
150
|
+
```yaml
|
151
|
+
on:
|
152
|
+
push:
|
153
|
+
tags: '[0-9]+.[0-9]+.[0-9]+**' # Ex. 8.272.10 or 15.0.1_p9
|
154
|
+
branches: master
|
155
|
+
|
156
|
+
jobs:
|
157
|
+
deploy:
|
158
|
+
steps:
|
159
|
+
- name: Checkout Repository
|
160
|
+
uses: actions/checkout@v2
|
161
|
+
with:
|
162
|
+
fetch-depth: 1 # only needed to get the sha label
|
163
|
+
- name: Deploy
|
164
|
+
env:
|
165
|
+
GH_USER: ${{ secrets.GH_USER }}
|
166
|
+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
167
|
+
run: | # GITHUB_REF will be refs/heads/master or refs/tags/MAJOR.MINOR.PATCH
|
168
|
+
build-bin/configure_deploy &&
|
169
|
+
build-bin/deploy $(echo ${GITHUB_REF} | cut -d/ -f 3)
|
170
|
+
```
|
171
|
+
|
172
|
+
### Example Travis setup
|
173
|
+
`.travis.yml` is a monolithic configuration file broken into stages. This means `test` and `deploy`
|
174
|
+
are in the same file. A simplest Travis `deploy` stage has two jobs: one for master pushes and
|
175
|
+
another for version tags. These jobs are controlled by event conditions.
|
176
|
+
|
177
|
+
The `if:` section obviates job creation and resource usage for irrelevant events. Travis does not
|
178
|
+
support file conditions. A `before_install` step to skip documentation-only commits will likely
|
179
|
+
complete in less than a minute (10 credit cost).
|
180
|
+
|
181
|
+
As billing is by the minute, it is most cost effective to combine test and deploy on master push.
|
182
|
+
|
183
|
+
Here's a partial `.travis.yml` including only the aspects mentioned above. Notice YAML anchors work
|
184
|
+
in Travis and `tag =~` [condition](https://github.com/travis-ci/travis-conditions) is a regular
|
185
|
+
expression.
|
186
|
+
```yaml
|
187
|
+
git:
|
188
|
+
depth: false # full git history for license check, and doc-only skipping
|
189
|
+
|
190
|
+
_terminate_if_only_docs: &terminate_if_only_docs |
|
191
|
+
if [ -n "${TRAVIS_COMMIT_RANGE}" ] && ! git diff --name-only "${TRAVIS_COMMIT_RANGE}" -- | grep -qv '\.md$'; then
|
192
|
+
echo "Stopping job as changes only affect documentation (ex. README.md)"
|
193
|
+
travis_terminate 0
|
194
|
+
fi
|
195
|
+
|
196
|
+
jobs:
|
197
|
+
include:
|
198
|
+
- stage: test
|
199
|
+
if: branch = master AND tag IS blank AND type IN (push, pull_request)
|
200
|
+
before_install: *terminate_if_only_docs
|
201
|
+
install: |
|
202
|
+
if [ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
|
203
|
+
export SHOULD_DEPLOY=true
|
204
|
+
./build-bin/configure_deploy
|
205
|
+
else
|
206
|
+
export SHOULD_DEPLOY=false
|
207
|
+
./build-bin/configure_test
|
208
|
+
fi
|
209
|
+
script:
|
210
|
+
- ./build-bin/test || travis_terminate 1
|
211
|
+
- if [ "${SHOULD_DEPLOY}" != "true" ]; then travis_terminate 0; fi
|
212
|
+
- travis_wait ./build-bin/deploy master
|
213
|
+
- stage: deploy
|
214
|
+
# Ex. 8.272.10 or 15.0.1_p9
|
215
|
+
if: tag =~ /^[0-9]+\.[0-9]+\.[0-9]+/ AND type = push AND env(GH_TOKEN) IS present
|
216
|
+
install: ./build-bin/configure_deploy
|
217
|
+
script: ./build-bin/deploy ${TRAVIS_TAG}
|
218
|
+
```
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
set -ue
|
4
|
+
|
5
|
+
# This script sets up anything needed for `./deploy`. Do not assume `configure_test` was called.
|
6
|
+
#
|
7
|
+
# See [README.md] for an explanation of this and how CI should use it.
|
8
|
+
build-bin/gem/configure_gem_credentials
|
9
|
+
build-bin/gem/bundle_install
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
set -ue
|
4
|
+
|
5
|
+
# This script sets up anything needed for `./test`. This should not login to anything, as that
|
6
|
+
# should be done in `configure_deploy`.
|
7
|
+
#
|
8
|
+
# See [README.md] for an explanation of this and how CI should use it.
|
9
|
+
build-bin/gem/bundle_install
|
data/build-bin/deploy
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
set -ue
|
4
|
+
|
5
|
+
# This script deploys a release version.
|
6
|
+
#
|
7
|
+
# See [README.md] for an explanation of this and how CI should use it.
|
8
|
+
version=${1?version is required. ex 0.2.3}
|
9
|
+
|
10
|
+
export BUNDLE_GEMFILE=gemfiles/faraday_1.x.gemfile
|
11
|
+
build-bin/gem/gem_push zipkin-tracer ZipkinTracer ${version}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright 2014-2020 The OpenZipkin Authors
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
6
|
+
# in compliance with the License. You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
11
|
+
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
12
|
+
# or implied. See the License for the specific language governing permissions and limitations under
|
13
|
+
# the License.
|
14
|
+
#
|
15
|
+
|
16
|
+
set -ue
|
17
|
+
|
18
|
+
# This script ensures bundler is setup and install is run
|
19
|
+
gem install bundler
|
20
|
+
bundle install
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright 2014-2020 The OpenZipkin Authors
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
6
|
+
# in compliance with the License. You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
11
|
+
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
12
|
+
# or implied. See the License for the specific language governing permissions and limitations under
|
13
|
+
# the License.
|
14
|
+
#
|
15
|
+
|
16
|
+
set -ue
|
17
|
+
|
18
|
+
# This script configures rubygems_api_key needed to for gem-push
|
19
|
+
|
20
|
+
credentials_file="${HOME}/.gem/credentials"
|
21
|
+
mkdir -p "$(dirname "${credentials_file}")"
|
22
|
+
cat > "${credentials_file}" <<-EOF
|
23
|
+
---
|
24
|
+
:rubygems_api_key: ${RUBYGEMS_API_KEY}
|
25
|
+
EOF
|
26
|
+
chmod 0600 "${credentials_file}"
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# Copyright 2014-2020 The OpenZipkin Authors
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
6
|
+
# in compliance with the License. You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
11
|
+
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
12
|
+
# or implied. See the License for the specific language governing permissions and limitations under
|
13
|
+
# the License.
|
14
|
+
#
|
15
|
+
|
16
|
+
set -ue
|
17
|
+
|
18
|
+
# This script pushes a gem version, updating version.rb if out-of-date.
|
19
|
+
#
|
20
|
+
# This assumes `configure_gem_credentials` and `bundle_install` were invoked.
|
21
|
+
gem=${1?gem is required. ex zipkin-tracer}
|
22
|
+
module=${2?module is required. ex ZipkinTracer}
|
23
|
+
version=${3?version is required. ex 0.2.3}
|
24
|
+
|
25
|
+
current_version=$(ruby -r ./lib/${gem}/version.rb -e "puts ${module}::VERSION")
|
26
|
+
|
27
|
+
if [ "${current_version}" != "${version}" ]; then
|
28
|
+
echo "Updating ${module}::VERSION from ${current_version} to ${version}"
|
29
|
+
cat > lib/${gem}/version.rb <<-EOF
|
30
|
+
# frozen_string_literal: true
|
31
|
+
|
32
|
+
module ${module}
|
33
|
+
VERSION = '${version}'
|
34
|
+
end
|
35
|
+
EOF
|
36
|
+
fi
|
37
|
+
|
38
|
+
bundle exec rake build
|
39
|
+
gem push pkg/${gem}-${version}.gem
|
data/build-bin/test
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "faraday", "~> 2.0"
|
6
|
+
|
7
|
+
platforms :ruby do
|
8
|
+
gem "benchmark-ips"
|
9
|
+
gem "rbtrace"
|
10
|
+
gem "byebug"
|
11
|
+
gem "simplecov", require: false
|
12
|
+
end
|
13
|
+
|
14
|
+
platforms :jruby do
|
15
|
+
gem "hermann", "~> 0.27.0"
|
16
|
+
end
|
17
|
+
|
18
|
+
gemspec path: "../"
|
@@ -25,6 +25,7 @@ module ZipkinTracer
|
|
25
25
|
@app.call(env)
|
26
26
|
else
|
27
27
|
@tracer.with_new_span(trace_id, span_name(env)) do |span|
|
28
|
+
span.kind = Trace::Span::Kind::SERVER
|
28
29
|
trace!(span, zipkin_env) { @app.call(env) }
|
29
30
|
end
|
30
31
|
end
|
@@ -55,7 +56,6 @@ module ZipkinTracer
|
|
55
56
|
end
|
56
57
|
|
57
58
|
def trace_server_information(span, zipkin_env, status)
|
58
|
-
span.kind = Trace::Span::Kind::SERVER
|
59
59
|
span.record_status(status)
|
60
60
|
SERVER_RECV_TAGS.each { |annotation_key, env_key| span.record_tag(annotation_key, zipkin_env.env[env_key]) }
|
61
61
|
end
|
@@ -38,11 +38,9 @@ module Trace
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def skip_flush?(span)
|
41
|
-
return
|
41
|
+
return false if span.kind == Trace::Span::Kind::SERVER || span.kind == Trace::Span::Kind::CONSUMER
|
42
42
|
|
43
|
-
|
44
|
-
return true if spans.any? { |s| s.kind == Trace::Span::Kind::SERVER || s.kind == Trace::Span::Kind::CONSUMER }
|
45
|
-
end
|
43
|
+
spans.any? { |s| s.kind == Trace::Span::Kind::SERVER || s.kind == Trace::Span::Kind::CONSUMER }
|
46
44
|
end
|
47
45
|
|
48
46
|
def flush!
|
data/zipkin-tracer.gemspec
CHANGED
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
end
|
25
25
|
s.require_paths = ['lib']
|
26
26
|
|
27
|
-
s.add_dependency 'faraday', '>= 0.13', '<
|
27
|
+
s.add_dependency 'faraday', '>= 0.13', '< 3.0'
|
28
28
|
s.add_dependency 'rack', '>= 1.0'
|
29
29
|
s.add_dependency 'sucker_punch', '~> 2.0'
|
30
30
|
|
@@ -37,5 +37,6 @@ Gem::Specification.new do |s|
|
|
37
37
|
s.add_development_dependency 'rake', '~> 13.0'
|
38
38
|
s.add_development_dependency 'timecop', '~> 0.8'
|
39
39
|
s.add_development_dependency 'webmock', '~> 3.0'
|
40
|
+
s.add_development_dependency 'webrick'
|
40
41
|
s.add_development_dependency 'simplecov', '~> 0.16'
|
41
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zipkin-tracer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.48.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franklin Hu
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2022-02-17 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: faraday
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
version: '0.13'
|
26
26
|
- - "<"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '
|
28
|
+
version: '3.0'
|
29
29
|
type: :runtime
|
30
30
|
prerelease: false
|
31
31
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
version: '0.13'
|
36
36
|
- - "<"
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version: '
|
38
|
+
version: '3.0'
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: rack
|
41
41
|
requirement: !ruby/object:Gem::Requirement
|
@@ -190,6 +190,20 @@ dependencies:
|
|
190
190
|
- - "~>"
|
191
191
|
- !ruby/object:Gem::Version
|
192
192
|
version: '3.0'
|
193
|
+
- !ruby/object:Gem::Dependency
|
194
|
+
name: webrick
|
195
|
+
requirement: !ruby/object:Gem::Requirement
|
196
|
+
requirements:
|
197
|
+
- - ">="
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
version: '0'
|
200
|
+
type: :development
|
201
|
+
prerelease: false
|
202
|
+
version_requirements: !ruby/object:Gem::Requirement
|
203
|
+
requirements:
|
204
|
+
- - ">="
|
205
|
+
- !ruby/object:Gem::Version
|
206
|
+
version: '0'
|
193
207
|
- !ruby/object:Gem::Dependency
|
194
208
|
name: simplecov
|
195
209
|
requirement: !ruby/object:Gem::Requirement
|
@@ -217,9 +231,14 @@ executables: []
|
|
217
231
|
extensions: []
|
218
232
|
extra_rdoc_files: []
|
219
233
|
files:
|
234
|
+
- ".github/CONTRIBUTING.md"
|
235
|
+
- ".github/ISSUE_TEMPLATE/bug.md"
|
236
|
+
- ".github/ISSUE_TEMPLATE/config.yml"
|
237
|
+
- ".github/ISSUE_TEMPLATE/feature.md"
|
238
|
+
- ".github/workflows/deploy.yml"
|
239
|
+
- ".github/workflows/test.yml"
|
220
240
|
- ".gitignore"
|
221
241
|
- ".rspec"
|
222
|
-
- ".travis.yml"
|
223
242
|
- Appraisals
|
224
243
|
- CHANGELOG.md
|
225
244
|
- Gemfile
|
@@ -230,8 +249,17 @@ files:
|
|
230
249
|
- Rakefile
|
231
250
|
- bin/console
|
232
251
|
- bin/setup
|
252
|
+
- build-bin/README.md
|
253
|
+
- build-bin/configure_deploy
|
254
|
+
- build-bin/configure_test
|
255
|
+
- build-bin/deploy
|
256
|
+
- build-bin/gem/bundle_install
|
257
|
+
- build-bin/gem/configure_gem_credentials
|
258
|
+
- build-bin/gem/gem_push
|
259
|
+
- build-bin/test
|
233
260
|
- gemfiles/faraday_0.x.gemfile
|
234
261
|
- gemfiles/faraday_1.x.gemfile
|
262
|
+
- gemfiles/faraday_2.x.gemfile
|
235
263
|
- lib/zipkin-tracer.rb
|
236
264
|
- lib/zipkin-tracer/application.rb
|
237
265
|
- lib/zipkin-tracer/config.rb
|
@@ -281,7 +309,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
309
|
- !ruby/object:Gem::Version
|
282
310
|
version: '0'
|
283
311
|
requirements: []
|
284
|
-
rubygems_version: 3.
|
312
|
+
rubygems_version: 3.1.6
|
285
313
|
signing_key:
|
286
314
|
specification_version: 4
|
287
315
|
summary: Ruby tracing via Zipkin
|
data/.travis.yml
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
dist: bionic
|
3
|
-
jdk: openjdk11
|
4
|
-
|
5
|
-
rvm:
|
6
|
-
- 2.3
|
7
|
-
- 2.4
|
8
|
-
- 2.5
|
9
|
-
- 2.6
|
10
|
-
- 2.7
|
11
|
-
- jruby-9.1
|
12
|
-
- jruby-9.2
|
13
|
-
|
14
|
-
gemfile:
|
15
|
-
- gemfiles/faraday_0.x.gemfile
|
16
|
-
- gemfiles/faraday_1.x.gemfile
|
17
|
-
|
18
|
-
script: bundle exec rspec
|
19
|
-
|
20
|
-
deploy:
|
21
|
-
provider: rubygems
|
22
|
-
api_key:
|
23
|
-
secure: HJquPWOoh9YKHTJrGTBriao4wVDu/tn+JwZphPrS38PNu5FkzyRuhjq2XyBrm8BkuJWdqkVx9rpJTlFkcjIfhpZOJUn5gtTUgp12/voUMWBCWw9AUfbYdYkGhy6Lmq6miJcUFkhdeiMmnliz0Wav1ZYEWkodC25ACKQiGtk9rwr+4wKkluljOnmbyPFRiF61ZjSaz4qy9ZpwWOSPGuEjCQuvhW1hx0VNBjsio59sKUK0v2lFHxSfMjW+QrB5GAV0isv4CtG5V9MKMlRBX8+4RbklO0LHdCmykTDTioyYrfBI0x7RiO/l453/EH4dQEzivZ9AQNtIIshPu1Zht63LHWff4JyytSGxe5WmXaQjxfrZi2LMIXbeg5g2pPDmiMqFVSCgxFKJQW1eyU9pF3w5C4v9P0uLeizGnLReOwwjBDqiWIQ2bR4YWn+fsg/wbhjXHmefEjcJYL59niK8pw1JOcg7fy/P32wbbqILUcIg3of1ih1lyPV4YBY62KJny6e0c83zX2KukVMP9M6crW2NEspMqcQWFzbp3SR9oM0ziMDGUs0s1/PKVtuFTZ2S+ykbawX5P9YqSSx8iXp+Ez5MAMbrjiPXlzpzMvudDaN3kqRT2EomJ4iQjJOxXgUyTspLpZFojh4+RVjgi+sGEA8SeNiqrytThsCwQV1ro8ymL+8=
|
24
|
-
gem: zipkin-tracer
|
25
|
-
on:
|
26
|
-
tags: true
|
27
|
-
repo: openzipkin/zipkin-ruby
|
28
|
-
condition: $TRAVIS_RUBY_VERSION == 2.7 && $BUNDLE_GEMFILE == $TRAVIS_BUILD_DIR/gemfiles/faraday_1.x.gemfile
|
29
|
-
|
30
|
-
notifications:
|
31
|
-
webhooks:
|
32
|
-
urls:
|
33
|
-
- https://webhooks.gitter.im/e/ead3c37d57527214e9f2
|
34
|
-
- https://webhooks.gitter.im/e/e57478303f87ecd7bffc
|
35
|
-
on_success: change
|
36
|
-
on_failure: always
|