skywalking 0.0.0.alpha → 0.0.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.dockerignore +19 -0
- data/.github/PULL_REQUEST_TEMPLATE +42 -0
- data/.github/workflows/ci.yml +70 -0
- data/.github/workflows/e2e.yml +73 -0
- data/.gitignore +80 -0
- data/.gitmodules +18 -0
- data/.licenserc.yaml +36 -0
- data/.rspec +1 -2
- data/.rubocop.yml +6 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +20 -0
- data/NOTICE +1 -1
- data/docs/README.md +7 -0
- data/docs/en/agent/plugins.md +10 -0
- data/docs/{How-to-release.md → en/development-and-contribution/how-to-release.md} +6 -5
- data/docs/en/setup/quick-start.md +106 -0
- data/docs/menu.yml +31 -0
- data/lib/rails/generators/skywalking/start_generator.rb +47 -0
- data/{examples/rails-demo/config/initializers/skywalking_ruby.rb → lib/rails/generators/skywalking/templates/skywalking_initializer.rb} +0 -2
- data/lib/skywalking/agent.rb +5 -5
- data/lib/skywalking/configuration.rb +54 -33
- data/lib/skywalking/environment.rb +103 -11
- data/lib/skywalking/log/logger.rb +1 -1
- data/lib/skywalking/plugins/net_http.rb +73 -0
- data/lib/skywalking/plugins/redis5.rb +3 -2
- data/lib/skywalking/plugins/sinatra.rb +2 -2
- data/lib/skywalking/reporter/buffer_trigger.rb +1 -1
- data/lib/skywalking/reporter/client/grpc_client.rb +2 -2
- data/lib/skywalking/reporter/report.rb +1 -1
- data/lib/skywalking/tracing/carrier.rb +9 -8
- data/lib/skywalking/tracing/constants.rb +11 -18
- data/lib/skywalking/tracing/exit_span.rb +1 -1
- data/lib/skywalking/tracing/noop_span.rb +1 -1
- data/lib/skywalking/tracing/span.rb +1 -1
- data/lib/skywalking/tracing/span_context.rb +4 -4
- data/lib/skywalking/tracing/tag.rb +36 -1
- data/lib/skywalking/version.rb +1 -1
- data/skywalking.gemspec +61 -0
- data/spec/fixtures/agent.yaml +33 -0
- data/spec/scenarios/common/Dockerfile.agent +26 -0
- data/spec/scenarios/common/base-compose.yml +46 -0
- data/spec/scenarios/common/common_spec_helper.rb +40 -0
- data/spec/scenarios/common/compose_context.rb +39 -0
- data/spec/scenarios/common/validator.rb +41 -0
- data/spec/scenarios/net_http/docker-compose.yml +49 -0
- data/spec/scenarios/net_http/expected.yml +39 -0
- data/spec/scenarios/net_http/net_http.rb +33 -0
- data/spec/scenarios/net_http/net_http_spec.rb +43 -0
- data/spec/scenarios/redis/docker-compose.yml +67 -0
- data/spec/scenarios/redis/expected.yml +66 -0
- data/{examples/sinatra-demo/sinatra-demo.rb → spec/scenarios/redis/redis.rb} +8 -10
- data/spec/scenarios/redis/redis_spec.rb +29 -0
- data/spec/scenarios/sinatra/docker-compose.yml +54 -0
- data/spec/scenarios/sinatra/expected.yml +38 -0
- data/spec/scenarios/sinatra/sinatra.rb +26 -0
- data/spec/scenarios/sinatra/sinatra_spec.rb +29 -0
- data/spec/skywalking/config_spec.rb +41 -0
- data/spec/skywalking/utils/id_gen_spec.rb +26 -0
- data/spec/spec_helper.rb +115 -0
- metadata +134 -143
- data/examples/rails-demo/.dockerignore +0 -47
- data/examples/rails-demo/.gitattributes +0 -9
- data/examples/rails-demo/.gitignore +0 -34
- data/examples/rails-demo/.kamal/hooks/docker-setup.sample +0 -3
- data/examples/rails-demo/.kamal/hooks/post-deploy.sample +0 -14
- data/examples/rails-demo/.kamal/hooks/post-proxy-reboot.sample +0 -3
- data/examples/rails-demo/.kamal/hooks/pre-build.sample +0 -51
- data/examples/rails-demo/.kamal/hooks/pre-connect.sample +0 -47
- data/examples/rails-demo/.kamal/hooks/pre-deploy.sample +0 -109
- data/examples/rails-demo/.kamal/hooks/pre-proxy-reboot.sample +0 -3
- data/examples/rails-demo/.kamal/secrets +0 -17
- data/examples/rails-demo/.rubocop.yml +0 -8
- data/examples/rails-demo/.ruby-version +0 -1
- data/examples/rails-demo/Dockerfile +0 -72
- data/examples/rails-demo/Gemfile +0 -64
- data/examples/rails-demo/README.md +0 -24
- data/examples/rails-demo/Rakefile +0 -6
- data/examples/rails-demo/app/assets/images/.keep +0 -0
- data/examples/rails-demo/app/assets/stylesheets/application.css +0 -10
- data/examples/rails-demo/app/controllers/application_controller.rb +0 -4
- data/examples/rails-demo/app/controllers/concerns/.keep +0 -0
- data/examples/rails-demo/app/helpers/application_helper.rb +0 -2
- data/examples/rails-demo/app/javascript/application.js +0 -3
- data/examples/rails-demo/app/javascript/controllers/application.js +0 -9
- data/examples/rails-demo/app/javascript/controllers/hello_controller.js +0 -7
- data/examples/rails-demo/app/javascript/controllers/index.js +0 -4
- data/examples/rails-demo/app/jobs/application_job.rb +0 -7
- data/examples/rails-demo/app/mailers/application_mailer.rb +0 -4
- data/examples/rails-demo/app/models/application_record.rb +0 -3
- data/examples/rails-demo/app/models/concerns/.keep +0 -0
- data/examples/rails-demo/app/views/layouts/application.html.erb +0 -28
- data/examples/rails-demo/app/views/layouts/mailer.html.erb +0 -13
- data/examples/rails-demo/app/views/layouts/mailer.text.erb +0 -1
- data/examples/rails-demo/app/views/pwa/manifest.json.erb +0 -22
- data/examples/rails-demo/app/views/pwa/service-worker.js +0 -26
- data/examples/rails-demo/bin/brakeman +0 -7
- data/examples/rails-demo/bin/bundle +0 -109
- data/examples/rails-demo/bin/dev +0 -2
- data/examples/rails-demo/bin/docker-entrypoint +0 -14
- data/examples/rails-demo/bin/importmap +0 -4
- data/examples/rails-demo/bin/jobs +0 -6
- data/examples/rails-demo/bin/kamal +0 -27
- data/examples/rails-demo/bin/rails +0 -4
- data/examples/rails-demo/bin/rake +0 -4
- data/examples/rails-demo/bin/rubocop +0 -8
- data/examples/rails-demo/bin/setup +0 -34
- data/examples/rails-demo/bin/thrust +0 -5
- data/examples/rails-demo/config/application.rb +0 -27
- data/examples/rails-demo/config/boot.rb +0 -4
- data/examples/rails-demo/config/cable.yml +0 -17
- data/examples/rails-demo/config/cache.yml +0 -16
- data/examples/rails-demo/config/credentials.yml.enc +0 -1
- data/examples/rails-demo/config/database.yml +0 -41
- data/examples/rails-demo/config/deploy.yml +0 -116
- data/examples/rails-demo/config/environment.rb +0 -5
- data/examples/rails-demo/config/environments/development.rb +0 -72
- data/examples/rails-demo/config/environments/production.rb +0 -90
- data/examples/rails-demo/config/environments/test.rb +0 -53
- data/examples/rails-demo/config/importmap.rb +0 -7
- data/examples/rails-demo/config/initializers/assets.rb +0 -7
- data/examples/rails-demo/config/initializers/content_security_policy.rb +0 -25
- data/examples/rails-demo/config/initializers/filter_parameter_logging.rb +0 -8
- data/examples/rails-demo/config/initializers/inflections.rb +0 -16
- data/examples/rails-demo/config/locales/en.yml +0 -31
- data/examples/rails-demo/config/puma.rb +0 -41
- data/examples/rails-demo/config/queue.yml +0 -18
- data/examples/rails-demo/config/recurring.yml +0 -10
- data/examples/rails-demo/config/routes.rb +0 -14
- data/examples/rails-demo/config/storage.yml +0 -34
- data/examples/rails-demo/config.ru +0 -6
- data/examples/rails-demo/db/cable_schema.rb +0 -11
- data/examples/rails-demo/db/cache_schema.rb +0 -14
- data/examples/rails-demo/db/queue_schema.rb +0 -129
- data/examples/rails-demo/db/seeds.rb +0 -9
- data/examples/rails-demo/lib/tasks/.keep +0 -0
- data/examples/rails-demo/log/.keep +0 -0
- data/examples/rails-demo/public/400.html +0 -114
- data/examples/rails-demo/public/404.html +0 -114
- data/examples/rails-demo/public/406-unsupported-browser.html +0 -114
- data/examples/rails-demo/public/422.html +0 -114
- data/examples/rails-demo/public/500.html +0 -114
- data/examples/rails-demo/public/icon.png +0 -0
- data/examples/rails-demo/public/icon.svg +0 -3
- data/examples/rails-demo/public/robots.txt +0 -1
- data/examples/rails-demo/script/.keep +0 -0
- data/examples/rails-demo/storage/.keep +0 -0
- data/examples/rails-demo/test/application_system_test_case.rb +0 -5
- data/examples/rails-demo/test/controllers/.keep +0 -0
- data/examples/rails-demo/test/fixtures/files/.keep +0 -0
- data/examples/rails-demo/test/helpers/.keep +0 -0
- data/examples/rails-demo/test/integration/.keep +0 -0
- data/examples/rails-demo/test/mailers/.keep +0 -0
- data/examples/rails-demo/test/models/.keep +0 -0
- data/examples/rails-demo/test/system/.keep +0 -0
- data/examples/rails-demo/test/test_helper.rb +0 -15
- data/examples/rails-demo/tmp/.keep +0 -0
- data/examples/rails-demo/tmp/pids/.keep +0 -0
- data/examples/rails-demo/tmp/storage/.keep +0 -0
- data/examples/rails-demo/vendor/.keep +0 -0
- data/examples/rails-demo/vendor/javascript/.keep +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 440bef4a38e67a74f5da465bfe3e7f0482631f7371d89f8d2848c7519f37c1de
|
4
|
+
data.tar.gz: b536aadb8f8eb25357bf20c2bf16d40c868c2068fbdc5b0559794e3a4e9c9839
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59b5fefb96f307c1e70d8d975c8c962b69c0410051a2f2951a69f221b17ea896ffde723d224a5a6cbb11eed0b6c51bf74064c7a6e05db72d36e663309b1560fd
|
7
|
+
data.tar.gz: 021b8f374d2f6a22b833b8dddae9ea1cc497859885098d8f04274546409d461d2904d32c22af6cf8347e09ffc51b9d0580739be8fda604e8415feff59b49631a
|
data/.dockerignore
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
.idea
|
18
|
+
.git
|
19
|
+
examples
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<!--
|
2
|
+
⚠️ Please make sure to read this template first, pull requests that don't accord with this template
|
3
|
+
maybe closed without notice.
|
4
|
+
Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
|
5
|
+
Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
|
6
|
+
-->
|
7
|
+
|
8
|
+
<!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
|
9
|
+
### Fix <bug description or bug issue link>
|
10
|
+
- [ ] Add a unit test to verify that the fix works.
|
11
|
+
- [ ] Explain briefly why the bug exists and how to fix it.
|
12
|
+
==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
|
13
|
+
|
14
|
+
<!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
|
15
|
+
### Improve the performance of <class or module or ...>
|
16
|
+
- [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/oap-server/microbench/src/main/java/org/apache/skywalking/oap/server/microbench/library/datacarrier/LinkedArrayBenchmark.java)
|
17
|
+
- [ ] The benchmark result.
|
18
|
+
```text
|
19
|
+
<Paste the benchmark results here>
|
20
|
+
```
|
21
|
+
- [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
|
22
|
+
==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
|
23
|
+
|
24
|
+
<!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
|
25
|
+
### <Feature description>
|
26
|
+
- [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
|
27
|
+
- [ ] Update the documentation to include this new feature.
|
28
|
+
- [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
|
29
|
+
- [ ] If it's UI related, attach the screenshots below.
|
30
|
+
- [ ] I have rebuilt the `Configuration.md` documentation by running `make doc-gen`
|
31
|
+
==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
|
32
|
+
|
33
|
+
<!-- ==== 📱 Remove this line WHEN AND ONLY WHEN you're adding or modifying a plugin instrumentation, follow the checklist 👇 ====
|
34
|
+
### <Feature description>
|
35
|
+
- [ ] If adding a new plugin, add a component id in [the main repo](https://github.com/apache/skywalking/blob/master/oap-server/server-starter/src/main/resources/component-libraries.yml)
|
36
|
+
- [ ] If adding a new plugin, add a logo in [the UI repo](https://github.com/apache/skywalking-booster-ui/tree/main/src/assets/img/technologies)
|
37
|
+
- [ ] I have added the library to `pyproject.toml` (plugin group) by running `poetry add library --group plugins`
|
38
|
+
- [ ] I have rebuilt the `Plugins.md` documentation by running `make doc-gen`
|
39
|
+
==== 📱 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
|
40
|
+
|
41
|
+
- [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue url. Closes: <URL to main repo issue>
|
42
|
+
- [ ] Update the [`CHANGELOG.md`](https://github.com/apache/skywalking-ruby/blob/main/CHANGELOG.md).
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
name: CI
|
18
|
+
|
19
|
+
on:
|
20
|
+
pull_request:
|
21
|
+
push:
|
22
|
+
branches:
|
23
|
+
- main
|
24
|
+
tags:
|
25
|
+
- 'v*'
|
26
|
+
|
27
|
+
concurrency:
|
28
|
+
group: ci-${{ github.event.pull_request.number || github.ref }}
|
29
|
+
cancel-in-progress: true
|
30
|
+
|
31
|
+
jobs:
|
32
|
+
build-and-check:
|
33
|
+
runs-on: ubuntu-latest
|
34
|
+
name: Ruby ${{ matrix.ruby-version }} | Build and Check
|
35
|
+
timeout-minutes: 60
|
36
|
+
strategy:
|
37
|
+
fail-fast: false
|
38
|
+
matrix:
|
39
|
+
ruby-version: [ 3.0 ]
|
40
|
+
|
41
|
+
steps:
|
42
|
+
- name: Checkout source codes
|
43
|
+
uses: actions/checkout@v4
|
44
|
+
with:
|
45
|
+
submodules: true
|
46
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
47
|
+
uses: ruby/setup-ruby@v1
|
48
|
+
with:
|
49
|
+
ruby-version: ${{ matrix.ruby-version }}
|
50
|
+
- name: Check License
|
51
|
+
uses: apache/skywalking-eyes/header@3ea9df11bb3a5a85665377d1fd10c02edecf2c40
|
52
|
+
- name: Install system dependency
|
53
|
+
run: |
|
54
|
+
gem install bundler
|
55
|
+
bundler install
|
56
|
+
- name: RuboCop Linter
|
57
|
+
run: bundler exec rubocop
|
58
|
+
|
59
|
+
CheckStatus:
|
60
|
+
if: always()
|
61
|
+
needs:
|
62
|
+
- build-and-check
|
63
|
+
runs-on: ubuntu-latest
|
64
|
+
timeout-minutes: 10
|
65
|
+
steps:
|
66
|
+
- name: Merge Requirement
|
67
|
+
run: |
|
68
|
+
if [[ ${{ needs.build-and-check.result }} != 'success' ]]; then
|
69
|
+
exit -1
|
70
|
+
fi
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
name: e2e
|
18
|
+
|
19
|
+
on:
|
20
|
+
pull_request:
|
21
|
+
push:
|
22
|
+
branches:
|
23
|
+
- main
|
24
|
+
|
25
|
+
concurrency:
|
26
|
+
group: e2e-${{ github.event.pull_request.number || github.ref }}
|
27
|
+
cancel-in-progress: true
|
28
|
+
|
29
|
+
jobs:
|
30
|
+
prep-build-plugin:
|
31
|
+
name: Build matrix
|
32
|
+
runs-on: ubuntu-latest
|
33
|
+
timeout-minutes: 5
|
34
|
+
outputs:
|
35
|
+
plugins: ${{ steps.plugins.outputs.plugins }}
|
36
|
+
steps:
|
37
|
+
- uses: actions/checkout@v4
|
38
|
+
with:
|
39
|
+
submodules: true
|
40
|
+
- id: plugins
|
41
|
+
run: echo "plugins=$(ls spec/scenarios | grep -v common | jq --raw-input | jq --slurp --compact-output)" >> "$GITHUB_OUTPUT"
|
42
|
+
|
43
|
+
e2e-test:
|
44
|
+
name: Run E2E Tests | ${{ matrix.plugin }} | Ruby ${{ matrix.ruby-version }}
|
45
|
+
runs-on: ubuntu-latest
|
46
|
+
timeout-minutes: 90
|
47
|
+
needs: [ prep-build-plugin ]
|
48
|
+
strategy:
|
49
|
+
matrix:
|
50
|
+
plugin: ${{ fromJson(needs.prep-build-plugin.outputs.plugins) }}
|
51
|
+
ruby-version: [ "3.0" ]
|
52
|
+
env:
|
53
|
+
SW_RUBY_VERSION: ${{ matrix.ruby-version }}
|
54
|
+
steps:
|
55
|
+
- uses: actions/checkout@v4
|
56
|
+
with:
|
57
|
+
submodules: true
|
58
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
59
|
+
uses: ruby/setup-ruby@v1
|
60
|
+
with:
|
61
|
+
ruby-version: ${{ matrix.ruby-version }}
|
62
|
+
- name: Install docker-compose
|
63
|
+
shell: bash
|
64
|
+
run: |
|
65
|
+
if ! command docker-compose 2>&1 > /dev/null; then
|
66
|
+
echo "Installing docker-compose"
|
67
|
+
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
|
68
|
+
sudo chmod +x /usr/local/bin/docker-compose
|
69
|
+
fi
|
70
|
+
- name: Run E2E tests
|
71
|
+
run: |
|
72
|
+
gem install bundler && bundle
|
73
|
+
bundle exec rspec spec/scenarios/${{ matrix.plugin }}
|
data/.gitignore
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
12
|
+
# software distributed under the License is distributed on an
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
14
|
+
# KIND, either express or implied. See the License for the
|
15
|
+
# specific language governing permissions and limitations
|
16
|
+
# under the License.
|
17
|
+
|
18
|
+
.idea/
|
19
|
+
.fleet/
|
20
|
+
*.iml
|
21
|
+
*.gem
|
22
|
+
*.rbc
|
23
|
+
/.config
|
24
|
+
/coverage/
|
25
|
+
/InstalledFiles
|
26
|
+
/pkg/
|
27
|
+
/spec/reports/
|
28
|
+
/spec/examples.txt
|
29
|
+
/test/tmp/
|
30
|
+
/test/version_tmp/
|
31
|
+
/tmp/
|
32
|
+
|
33
|
+
# Used by dotenv library to load environment variables.
|
34
|
+
# .env
|
35
|
+
|
36
|
+
# Ignore Byebug command history file.
|
37
|
+
.byebug_history
|
38
|
+
|
39
|
+
## Specific to RubyMotion:
|
40
|
+
.dat*
|
41
|
+
.repl_history
|
42
|
+
build/
|
43
|
+
*.bridgesupport
|
44
|
+
build-iPhoneOS/
|
45
|
+
build-iPhoneSimulator/
|
46
|
+
|
47
|
+
## Specific to RubyMotion (use of CocoaPods):
|
48
|
+
#
|
49
|
+
# We recommend against adding the Pods directory to your .gitignore. However
|
50
|
+
# you should judge for yourself, the pros and cons are mentioned at:
|
51
|
+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
52
|
+
#
|
53
|
+
# vendor/Pods/
|
54
|
+
|
55
|
+
## Documentation cache and generated files:
|
56
|
+
/.yardoc/
|
57
|
+
/_yardoc/
|
58
|
+
/doc/
|
59
|
+
/rdoc/
|
60
|
+
|
61
|
+
## Environment normalization:
|
62
|
+
/.bundle/
|
63
|
+
/vendor/bundle
|
64
|
+
/lib/bundler/man/
|
65
|
+
|
66
|
+
# for a library or gem, you might want to ignore these files since the code is
|
67
|
+
# intended to run in multiple environments; otherwise, check them in:
|
68
|
+
# Gemfile.lock
|
69
|
+
# .ruby-version
|
70
|
+
# .ruby-gemset
|
71
|
+
|
72
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
73
|
+
.rvmrc
|
74
|
+
|
75
|
+
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
|
76
|
+
# .rubocop-https?--*
|
77
|
+
Gemfile.lock
|
78
|
+
gemfiles/*.lock
|
79
|
+
.DS_Store!
|
80
|
+
spec/workspace
|
data/.gitmodules
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright ownership.
|
4
|
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with
|
6
|
+
# 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
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
[submodule "protocol"]
|
17
|
+
path = protocol
|
18
|
+
url = https://github.com/apache/skywalking-data-collect-protocol.git
|
data/.licenserc.yaml
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
#
|
2
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
3
|
+
# or more contributor license agreements. See the NOTICE file
|
4
|
+
# distributed with this work for additional information
|
5
|
+
# regarding copyright ownership. The ASF licenses this file
|
6
|
+
# to you under the Apache License, Version 2.0 (the
|
7
|
+
# "License"); you may not use this file except in compliance
|
8
|
+
# with the License. You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing,
|
13
|
+
# software distributed under the License is distributed on an
|
14
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
15
|
+
# KIND, either express or implied. See the License for the
|
16
|
+
# specific language governing permissions and limitations
|
17
|
+
# under the License.
|
18
|
+
#
|
19
|
+
header:
|
20
|
+
license:
|
21
|
+
spdx-id: Apache-2.0
|
22
|
+
copyright-owner: Apache Software Foundation
|
23
|
+
|
24
|
+
paths-ignore:
|
25
|
+
- 'licenses'
|
26
|
+
- '**/*.md'
|
27
|
+
- 'LICENSE'
|
28
|
+
- 'NOTICE'
|
29
|
+
- '.github/PULL_REQUEST_TEMPLATE'
|
30
|
+
- '**/.gitignore'
|
31
|
+
- '.gitmodules'
|
32
|
+
- 'lib/skywalking/proto/**'
|
33
|
+
- 'examples/**'
|
34
|
+
- '.rspec'
|
35
|
+
|
36
|
+
comment: on-failure
|
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -6,10 +6,13 @@ Release Notes.
|
|
6
6
|
------------------
|
7
7
|
#### Features
|
8
8
|
- Initialize the ruby agent core.
|
9
|
+
- Implement e2e tests.
|
10
|
+
- Add docs.
|
9
11
|
|
10
12
|
#### Plugins
|
11
13
|
* Support [Sinatra](https://github.com/sinatra/sinatra)
|
12
14
|
* Support [redis-rb](https://github.com/redis/redis-rb)
|
15
|
+
* Support [net-http](https://github.com/ruby/net-http)
|
13
16
|
|
14
17
|
#### Documentation
|
15
18
|
* Initialize the documentation.
|
data/Gemfile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright ownership.
|
4
|
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with
|
6
|
+
# 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
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
source 'https://rubygems.org'
|
17
|
+
|
18
|
+
gemspec name: 'skywalking'
|
19
|
+
|
20
|
+
ruby ">= 3.0.0"
|
data/NOTICE
CHANGED
data/docs/README.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# SkyWalking Ruby Agent
|
2
|
+
|
3
|
+
**This is the official documentation of SkyWalking Ruby agent. Welcome to the SkyWalking community!**
|
4
|
+
|
5
|
+
SkyWalking Ruby is an open-source auto-instrument agent that provides support for distributed tracing across different frameworks within the Ruby language.
|
6
|
+
|
7
|
+
This documentation covers a number of ways to set up the Ruby agent for various use cases.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Tracing Plugins
|
2
|
+
|
3
|
+
The following plugins provide the distributed tracing capability, and the OAP backend would analyze the topology and
|
4
|
+
metrics based on the tracing data.
|
5
|
+
|
6
|
+
| Library | Version | Plugin Name |
|
7
|
+
|:----------------------------------------------|:---------|:------------|
|
8
|
+
| [redis](https://github.com/redis/redis-rb) | ~> 5.0 | `redis` |
|
9
|
+
| [net-http](https://github.com/ruby/net-http) | ~> 0.6.0 | `net_http` |
|
10
|
+
| [sinatra](https://github.com/sinatra/sinatra) | ~> 4.1 | `sinatra` |
|
@@ -5,7 +5,7 @@ This documentation guides the release manager to release the SkyWalking Ruby in
|
|
5
5
|
## Prerequisites
|
6
6
|
|
7
7
|
1. Close (if finished, or move to next milestone otherwise) all issues in the current milestone from [skywalking-ruby](https://github.com/apache/skywalking-ruby/milestones) and [skywalking](https://github.com/apache/skywalking/milestones), create a new milestone for the next release.
|
8
|
-
1. Update [CHANGELOG.md](
|
8
|
+
1. Update [CHANGELOG.md](../../../CHANGELOG.md) and `version` in [Version.rb](../../../lib/skywalking/version.rb).
|
9
9
|
|
10
10
|
|
11
11
|
## Add your GPG public key to Apache svn
|
@@ -143,6 +143,8 @@ Vote result should follow these:
|
|
143
143
|
1. Publish to rubygems.org, this is optional for Apache releases, but we usually want to do this to let users use it conveniently.
|
144
144
|
|
145
145
|
```shell
|
146
|
+
gem build skywalking.gemspec
|
147
|
+
gem push skywalking.gemspec
|
146
148
|
```
|
147
149
|
|
148
150
|
**NOTE**: please double check before publishing to rubygems.org, it's difficult to unpublish and republish the module at the moment.
|
@@ -169,11 +171,10 @@ Vote result should follow these:
|
|
169
171
|
Website: http://skywalking.apache.org/
|
170
172
|
|
171
173
|
SkyWalking Ruby Resources:
|
172
|
-
|
174
|
+
Issue: https://github.com/apache/skywalking/issues
|
175
|
+
|
173
176
|
- Mailing list: dev@skywalking.apache.org
|
174
177
|
- Documents: https://github.com/apache/skywalking-ruby/blob/v$VERSION/README.md
|
175
178
|
|
176
179
|
The Apache SkyWalking Team
|
177
|
-
```
|
178
|
-
|
179
|
-
|
180
|
+
```
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# Quick Start
|
2
|
+
|
3
|
+
## Requirements
|
4
|
+
|
5
|
+
**SkyWalking Ruby agent requires SkyWalking 8.0+ and Ruby 3.0+**
|
6
|
+
|
7
|
+
## Installing the gem
|
8
|
+
|
9
|
+
The Ruby agent's gem is available from [RubyGems](https://rubygems.org/) as `skywalking`, we recommend you install and
|
10
|
+
manage the skywalking gem dependency with [Bundler](http://bundler.io/), add the following line to your `Gemfile`, then
|
11
|
+
run `bundle install` to install the gem.
|
12
|
+
|
13
|
+
~~~ruby
|
14
|
+
# Gemfile
|
15
|
+
source "https://rubygems.org"
|
16
|
+
|
17
|
+
gem "skywalking"
|
18
|
+
~~~
|
19
|
+
|
20
|
+
Besides, you can also make installation as simple as `gem install skywalking`.
|
21
|
+
|
22
|
+
## Getting started with Rails
|
23
|
+
|
24
|
+
You need to manually add `Skywalking.start` under config/initializers directory.
|
25
|
+
|
26
|
+
Optionally the command `bundle exec rails generate skywalking:start`, will create a config file
|
27
|
+
`config/initializers/skywalking.rb`, and then you can configure the start parameters.
|
28
|
+
|
29
|
+
## Getting started with Sinatra
|
30
|
+
|
31
|
+
You can list `gem 'skywalking'` after sinatra in your Gemfile and use `Bundler.require` during initialization or calling
|
32
|
+
`require 'skywalking'` after sinatra gem is loaded, that is, skywalking gem needs to be after the other gems you
|
33
|
+
require (e.g. redis, elasticsearch), like the following code:
|
34
|
+
|
35
|
+
~~~ruby
|
36
|
+
require 'redis'
|
37
|
+
require 'sinatra'
|
38
|
+
require 'skywalking'
|
39
|
+
|
40
|
+
Skywalking.start
|
41
|
+
|
42
|
+
get '/sw' do
|
43
|
+
"Hello, SkyWalking!"
|
44
|
+
end
|
45
|
+
~~~
|
46
|
+
|
47
|
+
## Configuration
|
48
|
+
|
49
|
+
You can configure the SkyWalking Ruby agent in various ways, the Ruby agent follows this order of precedence for
|
50
|
+
configuration:
|
51
|
+
|
52
|
+
- Defaults (please
|
53
|
+
see [DEFAULTS](https://github.com/apache/skywalking-ruby/blob/main/lib/skywalking/configuration.rb#L21))
|
54
|
+
- Arguments to `Skywalking.start`
|
55
|
+
- Configuration file (e.g. `conifg/skywalking.yml`)
|
56
|
+
- Environment variables
|
57
|
+
|
58
|
+
The following is an example of configuration at start:
|
59
|
+
|
60
|
+
~~~ruby
|
61
|
+
Skywalking.start(
|
62
|
+
service_name: 'sw-srv',
|
63
|
+
instance_name: 'sw-inst',
|
64
|
+
collector_backend_services: 'oap:11800'
|
65
|
+
)
|
66
|
+
~~~
|
67
|
+
|
68
|
+
The following is an example of a configuration file:
|
69
|
+
~~~yaml
|
70
|
+
common: &defaults
|
71
|
+
service_name: Ruby-Agent-Common
|
72
|
+
log_level: debug
|
73
|
+
|
74
|
+
development:
|
75
|
+
<<: *defaults
|
76
|
+
service_name: Ruby-Agent-Development
|
77
|
+
|
78
|
+
test:
|
79
|
+
<<: *defaults
|
80
|
+
service_name: Ruby-Agent-Test
|
81
|
+
|
82
|
+
production:
|
83
|
+
<<: *defaults
|
84
|
+
service_name: Ruby-Agent-Production
|
85
|
+
~~~
|
86
|
+
|
87
|
+
The following lists all the configuration options:
|
88
|
+
|
89
|
+
| key | environment key | default value | description |
|
90
|
+
|---------------------------------|------------------------------------------|----------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
|
91
|
+
| service_name | SW_AGENT_SERVICE_NAME | Your_ApplicationName | The name of the service which showed in UI. |
|
92
|
+
| instance_name | SW_AGENT_INSTANCE_NAME | Your_InstanceName | To obtain the environment variable key for the instance name, if it cannot be obtained, an instance name will be automatically generated. |
|
93
|
+
| namespace | SW_AGENT_NAMESPACE | Not set | Namespace represents a subnet, such as kubernetes namespace, or 172.10.. |
|
94
|
+
| environment | SW_AGENT_ENVIRONMENT | Not set | The name of the environment this service is deployed in |
|
95
|
+
| collector_backend_services | SW_AGENT_COLLECTOR_BACKEND_SERVICES | 127.0.0.1:11800 | Collector SkyWalking trace receiver service addresses. |
|
96
|
+
| config_file | SW_AGENT_CONFIG_FILE | Not set | The absolute path to the configuration file, if empty, it will automatically search for config/skywalking.yml in the root directory. |
|
97
|
+
| log_file_name | SW_AGENT_LOG_FILE_NAME | skywalking | The name of the log file. |
|
98
|
+
| log_file_path | SW_AGENT_LOG_FILE_PATH | Not set | The path to the log file. |
|
99
|
+
| log_level | SW_AGENT_LOG_LEVEL | info | The log level. |
|
100
|
+
| disable_plugins | SW_AGENT_DISABLE_PLUGINS | Not set | The plugins to disable. |
|
101
|
+
| report_protocol | SW_AGENT_REPORT_PROTOCOL | grpc | The protocol to use for reporting. |
|
102
|
+
| re_ignore_operation | SW_AGENT_RE_IGNORE_OPERATION | Not set | Ignore specific URL paths. |
|
103
|
+
| instance_properties_json | SW_AGENT_INSTANCE_PROPERTIES_JSON | Not set | A custom JSON string to be reported as service instance properties, e.g. `{"key": "value"}`. |
|
104
|
+
| collector_heartbeat_period | SW_AGENT_COLLECTOR_HEARTBEAT_PERIOD | 30 | he agent will send heartbeat to OAP every `collector_heartbeat_period` seconds. |
|
105
|
+
| properties_report_period_factor | SW_AGENT_PROPERTIES_REPORT_PERIOD_FACTOR | 10 | The agent will report service instance properties every `collector_heartbeat_period * properties_report_period_factor` seconds. |
|
106
|
+
| max_queue_size | SW_AGENT_MAX_QUEUE_SIZE | 10000 | The maximum queue size for reporting data. |
|
data/docs/menu.yml
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one
|
2
|
+
# or more contributor license agreements. See the NOTICE file
|
3
|
+
# distributed with this work for additional information
|
4
|
+
# regarding copyright ownership. The ASF licenses this file
|
5
|
+
# to you under the Apache License, Version 2.0 (the
|
6
|
+
# "License"); you may not use this file except in compliance
|
7
|
+
# with the License. You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
catalog:
|
18
|
+
- name: SkyWalking Ruby Overview
|
19
|
+
path: /readme
|
20
|
+
- name: Quick Start
|
21
|
+
path: /en/setup/quick-start
|
22
|
+
- name: Agent
|
23
|
+
catalog:
|
24
|
+
- name: Supported Plugins
|
25
|
+
path: /en/agent/plugins
|
26
|
+
- name: Development and Contribution
|
27
|
+
catalog:
|
28
|
+
- name: How to Release
|
29
|
+
path: /en/development-and-contribution/how-to-release
|
30
|
+
- name: Changelog
|
31
|
+
path: https://github.com/apache/skywalking-ruby/blob/master/CHANGELOG.md
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# Licensed to the Apache Software Foundation (ASF) under one or more
|
2
|
+
# contributor license agreements. See the NOTICE file distributed with
|
3
|
+
# this work for additional information regarding copyright ownership.
|
4
|
+
# The ASF licenses this file to You under the Apache License, Version 2.0
|
5
|
+
# (the "License"); you may not use this file except in compliance with
|
6
|
+
# 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
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
module Skywalking
|
17
|
+
class StartGenerator < ::Rails::Generators::Base
|
18
|
+
source_root File.join(File.dirname(__FILE__), 'templates')
|
19
|
+
desc 'Creates a skywalking initializer'
|
20
|
+
|
21
|
+
@namespace = "skywalking:start"
|
22
|
+
|
23
|
+
def copy_initializer
|
24
|
+
print_header
|
25
|
+
print_footer
|
26
|
+
|
27
|
+
template "skywalking_initializer.rb", "config/initializers/skywalking.rb"
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def print_header
|
33
|
+
say ""
|
34
|
+
say shell.set_color "Welcome to the SkyWalking Ruby Agent instrumentation setup.", :green, :bold
|
35
|
+
say ""
|
36
|
+
end
|
37
|
+
|
38
|
+
def print_footer
|
39
|
+
say ""
|
40
|
+
say "You can configure skywalking start parameters by modifying config/initializers/skywalking.rb."
|
41
|
+
say ""
|
42
|
+
say "Thanks for using! Welcome to contribute to the SkyWalking community."
|
43
|
+
say ""
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|