instana 1.211.0 → 1.212.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +36 -5
- data/Gemfile +1 -1
- data/README.md +3 -7
- data/Rakefile +21 -2
- data/download.sh +85 -0
- data/gemfiles/aws_30.gemfile +1 -1
- data/gemfiles/aws_60.gemfile +1 -1
- data/gemfiles/coverage_merge.gemfile +9 -0
- data/gemfiles/cuba_30.gemfile +1 -1
- data/gemfiles/cuba_40.gemfile +1 -1
- data/gemfiles/dalli_20.gemfile +1 -1
- data/gemfiles/dalli_30.gemfile +1 -1
- data/gemfiles/dalli_32.gemfile +1 -1
- data/gemfiles/excon_02.gemfile +1 -1
- data/gemfiles/excon_021.gemfile +1 -1
- data/gemfiles/excon_079.gemfile +1 -1
- data/gemfiles/excon_100.gemfile +1 -1
- data/gemfiles/graphql_10.gemfile +1 -1
- data/gemfiles/graphql_20.gemfile +1 -1
- data/gemfiles/grpc_10.gemfile +1 -1
- data/gemfiles/mongo_216.gemfile +1 -1
- data/gemfiles/mongo_219.gemfile +1 -1
- data/gemfiles/net_http_01.gemfile +1 -1
- data/gemfiles/rack_16.gemfile +1 -1
- data/gemfiles/rack_20.gemfile +1 -1
- data/gemfiles/rack_30.gemfile +1 -1
- data/gemfiles/rails_42.gemfile +1 -1
- data/gemfiles/rails_50.gemfile +1 -1
- data/gemfiles/rails_52.gemfile +1 -1
- data/gemfiles/rails_60.gemfile +1 -1
- data/gemfiles/rails_61.gemfile +1 -1
- data/gemfiles/rails_70.gemfile +2 -2
- data/gemfiles/rails_71.gemfile +19 -0
- data/gemfiles/redis_40.gemfile +1 -1
- data/gemfiles/resque_122.gemfile +1 -1
- data/gemfiles/resque_20.gemfile +1 -1
- data/gemfiles/rest_client_16.gemfile +1 -1
- data/gemfiles/rest_client_20.gemfile +1 -1
- data/gemfiles/roda_20.gemfile +1 -1
- data/gemfiles/roda_30.gemfile +1 -1
- data/gemfiles/shoryuken_50.gemfile +1 -1
- data/gemfiles/shoryuken_60.gemfile +1 -1
- data/gemfiles/sidekiq_42.gemfile +1 -1
- data/gemfiles/sidekiq_50.gemfile +2 -2
- data/gemfiles/sidekiq_60.gemfile +2 -2
- data/gemfiles/sidekiq_65.gemfile +15 -0
- data/gemfiles/sidekiq_70.gemfile +2 -2
- data/gemfiles/sinatra_14.gemfile +1 -1
- data/gemfiles/sinatra_22.gemfile +1 -1
- data/gemfiles/sinatra_30.gemfile +1 -1
- data/lib/instana/activators/sidekiq_client.rb +1 -2
- data/lib/instana/activators/sidekiq_worker.rb +1 -2
- data/lib/instana/instrumentation/sidekiq-client.rb +11 -2
- data/lib/instana/instrumentation/sidekiq-worker.rb +11 -2
- data/lib/instana/version.rb +1 -1
- data/test/backend/host_agent_reporting_observer_test.rb +5 -3
- data/test/instrumentation/rails_action_controller_test.rb +5 -1
- data/test/instrumentation/rails_action_view_test.rb +5 -1
- data/test/instrumentation/rails_active_record_database_missing_test.rb +5 -3
- data/test/instrumentation/sidekiq-client_test.rb +2 -18
- data/test/instrumentation/sidekiq-worker_test.rb +3 -45
- data/test/support/apps/sidekiq/worker.rb +8 -8
- data/test/test_helper.rb +2 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 332da83974279a02e0ebc35086a412aa2f8640d4e40dd38957bec22c0f8a9ed8
|
4
|
+
data.tar.gz: cb3528e5f55e0c76e5069c0d801033d800af6c184101484690d9ead1b9cf7088
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f372d7417bda356f6051fc6d8fb1ceb6f85537ac4c6841a9247f966350c9574335bf8c4fdc567b1c78d54ad95a8f3d0ce53b14126e964bb249c68d648616d11
|
7
|
+
data.tar.gz: 44ebe7c9b5716b7d323a619561c3732ba8b1145a600601ebbb6c797444db89a82486f94580ac2b20335f3f4877abaf35274abe9a14b740500c894c2b3aecffab
|
data/.circleci/config.yml
CHANGED
@@ -29,6 +29,7 @@ library_gemfile: &library_gemfile
|
|
29
29
|
- "./gemfiles/sidekiq_42.gemfile"
|
30
30
|
- "./gemfiles/sidekiq_50.gemfile"
|
31
31
|
- "./gemfiles/sidekiq_60.gemfile"
|
32
|
+
- "./gemfiles/sidekiq_65.gemfile"
|
32
33
|
- "./gemfiles/sidekiq_70.gemfile"
|
33
34
|
- "./gemfiles/sinatra_14.gemfile"
|
34
35
|
- "./gemfiles/sinatra_22.gemfile"
|
@@ -211,33 +212,55 @@ commands:
|
|
211
212
|
bundler --version
|
212
213
|
bundle config set path './vendor/bundle'
|
213
214
|
- run:
|
214
|
-
name: Install
|
215
|
+
name: Install Dependencies
|
215
216
|
command: |
|
216
217
|
bundle check || bundle install
|
217
218
|
run_sonarqube:
|
218
219
|
steps:
|
219
220
|
- run:
|
220
|
-
name: Install Java
|
221
|
+
name: Install Java for the SonarQube tool
|
221
222
|
command: |
|
222
223
|
sudo apt-get update
|
223
224
|
sudo apt-get install openjdk-11-jdk
|
225
|
+
- run:
|
226
|
+
name: Install dependencies for coverage merge
|
227
|
+
command: |
|
228
|
+
bundler --version
|
229
|
+
bundle config set path './vendor/bundle'
|
230
|
+
bundle check || bundle install
|
231
|
+
environment:
|
232
|
+
BUNDLE_GEMFILE: './gemfiles/coverage_merge.gemfile'
|
233
|
+
- run:
|
234
|
+
name: Fetching partial coverage reports from workflow jobs
|
235
|
+
command: |
|
236
|
+
./download.sh
|
237
|
+
- run:
|
238
|
+
name: Merging partial coverage reports for reporting
|
239
|
+
command: |
|
240
|
+
bundle exec rake coverage:merge_reports --trace
|
241
|
+
environment:
|
242
|
+
BUNDLE_GEMFILE: './gemfiles/coverage_merge.gemfile'
|
224
243
|
- run:
|
225
244
|
name: Run SonarQube to capture coverage
|
226
245
|
command: |
|
227
|
-
wget -O /tmp/sonar-scanner-cli.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.
|
246
|
+
wget -O /tmp/sonar-scanner-cli.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.1.3023.zip
|
228
247
|
unzip -d /tmp /tmp/sonar-scanner-cli.zip
|
229
248
|
if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
|
230
|
-
/tmp/sonar-scanner-4.
|
249
|
+
/tmp/sonar-scanner-4.8.1.3023/bin/sonar-scanner \
|
231
250
|
-Dsonar.host.url="${SONARQUBE_URL}" \
|
232
251
|
-Dsonar.login="${SONARQUBE_LOGIN}" \
|
233
252
|
-Dsonar.pullrequest.key="${CIRCLE_PR_NUMBER}" \
|
234
253
|
-Dsonar.pullrequest.branch="${CIRCLE_BRANCH}"
|
235
254
|
else
|
236
|
-
/tmp/sonar-scanner-4.
|
255
|
+
/tmp/sonar-scanner-4.8.1.3023/bin/sonar-scanner \
|
237
256
|
-Dsonar.host.url="${SONARQUBE_URL}" \
|
238
257
|
-Dsonar.login="${SONARQUBE_LOGIN}" \
|
239
258
|
-Dsonar.branch.name="${CIRCLE_BRANCH}"
|
240
259
|
fi
|
260
|
+
- store_artifacts:
|
261
|
+
path: partial_coverage_results
|
262
|
+
- store_artifacts:
|
263
|
+
path: coverage
|
241
264
|
run_tests:
|
242
265
|
steps:
|
243
266
|
- run:
|
@@ -301,6 +324,10 @@ jobs:
|
|
301
324
|
- checkout
|
302
325
|
- setup
|
303
326
|
- run_rubocop
|
327
|
+
report_coverage:
|
328
|
+
executor: ruby_32
|
329
|
+
steps:
|
330
|
+
- checkout
|
304
331
|
- run_sonarqube
|
305
332
|
publish:
|
306
333
|
executor: ruby_27
|
@@ -397,3 +424,7 @@ workflows:
|
|
397
424
|
gemfile:
|
398
425
|
- "./gemfiles/rails_61.gemfile"
|
399
426
|
- "./gemfiles/rails_70.gemfile"
|
427
|
+
- "./gemfiles/rails_71.gemfile"
|
428
|
+
report_coverage:
|
429
|
+
jobs:
|
430
|
+
- report_coverage
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
<div align="center">
|
2
|
-
<img src="https://disznc.s3.amazonaws.com/Ruby-Dashboard-2020-02-10-at-2.31.36-PM.png"/>
|
3
|
-
</div>
|
4
|
-
|
5
1
|
# Instana
|
6
2
|
|
7
3
|
The `instana` gem provides Ruby metrics and traces (request, queue & cross-host) for [Instana](https://www.instana.com/).
|
@@ -46,15 +42,15 @@ The `instana` gem is a zero configuration tool that will automatically collect k
|
|
46
42
|
|
47
43
|
## Configuration
|
48
44
|
|
49
|
-
Although the gem has no configuration required for out of the box metrics and tracing, components can be configured if needed. See our [Configuration](https://
|
45
|
+
Although the gem has no configuration required for out of the box metrics and tracing, components can be configured if needed. See our [Configuration](https://www.ibm.com/docs/en/instana-observability/current?topic=ruby-configuration-configuring-instana-gem) page.
|
50
46
|
|
51
47
|
## Tracing
|
52
48
|
|
53
|
-
This Ruby gem provides a simple API for tracing and also supports [OpenTracing](http://opentracing.io/). See the [Ruby Tracing SDK](https://
|
49
|
+
This Ruby gem provides a simple API for tracing and also supports [OpenTracing](http://opentracing.io/). See the [Ruby Tracing SDK](https://www.ibm.com/docs/en/instana-observability/current?topic=ruby-tracing-sdk) and [OpenTracing](https://www.ibm.com/docs/en/instana-observability/current?topic=ruby-opentracing) pages for details.
|
54
50
|
|
55
51
|
## Documentation
|
56
52
|
|
57
|
-
You can find more documentation covering supported components and minimum versions in the Instana [documentation portal](https://
|
53
|
+
You can find more documentation covering supported components and minimum versions in the Instana [documentation portal](https://www.ibm.com/docs/en/instana-observability/current?topic=technologies-monitoring-ruby).
|
58
54
|
|
59
55
|
## Want End User Monitoring (EUM)?
|
60
56
|
|
data/Rakefile
CHANGED
@@ -13,11 +13,11 @@ Rake::TestTask.new(:test) do |t|
|
|
13
13
|
|
14
14
|
t.libs << "test"
|
15
15
|
t.libs << "lib"
|
16
|
-
|
16
|
+
|
17
17
|
if ENV['APPRAISAL_INITIALIZED']
|
18
18
|
appraised_group = File.basename(ENV['BUNDLE_GEMFILE']).split(/_[0-9]+\./).first
|
19
19
|
suite_files = Dir['test/{instrumentation,frameworks}/*_test.rb']
|
20
|
-
|
20
|
+
|
21
21
|
t.test_files = suite_files.select { |f| File.basename(f).start_with?(appraised_group) }
|
22
22
|
else
|
23
23
|
t.test_files = Dir[
|
@@ -27,4 +27,23 @@ Rake::TestTask.new(:test) do |t|
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
namespace :coverage do
|
31
|
+
task :merge_reports do
|
32
|
+
require 'simplecov'
|
33
|
+
require 'simplecov_json_formatter'
|
34
|
+
|
35
|
+
SimpleCov.start do
|
36
|
+
enable_coverage :branch
|
37
|
+
SimpleCov.collate Dir["partial_coverage_results/.resultset-*.json"] do
|
38
|
+
formatter SimpleCov::Formatter::MultiFormatter.new(
|
39
|
+
[
|
40
|
+
SimpleCov::Formatter::SimpleFormatter,
|
41
|
+
SimpleCov::Formatter::JSONFormatter
|
42
|
+
]
|
43
|
+
)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
30
49
|
task :default => :test
|
data/download.sh
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
if [[ -z ${CIRCLE_TOKEN} ]]
|
4
|
+
then
|
5
|
+
echo "ERROR: The CIRCLE_TOKEN variable is missing"
|
6
|
+
exit 255
|
7
|
+
fi
|
8
|
+
|
9
|
+
PROJECT_SLUG='https://circleci.com/api/v2/project/gh/instana/ruby-sensor'
|
10
|
+
PIPELINE_SLUG='https://circleci.com/api/v2/pipeline/'
|
11
|
+
WORKFLOW_SLUG='https://circleci.com/api/v2/workflow/'
|
12
|
+
|
13
|
+
echo "Getting Pipeline ID"
|
14
|
+
PIPELINE_ID=$(curl -s \
|
15
|
+
-H "Circle-Token: ${CIRCLE_TOKEN}" \
|
16
|
+
"${PROJECT_SLUG}/job/${CIRCLE_BUILD_NUM}" \
|
17
|
+
| jq -rj '.pipeline.id')
|
18
|
+
|
19
|
+
|
20
|
+
echo "Received Pipeline ID is: ${PIPELINE_ID}"
|
21
|
+
|
22
|
+
echo "Getting Workflows for Pipeline ID"
|
23
|
+
WORKFLOW_IDS=$(curl -s \
|
24
|
+
-H "Circle-Token: ${CIRCLE_TOKEN}" \
|
25
|
+
"${PIPELINE_SLUG}/${PIPELINE_ID}/workflow" \
|
26
|
+
| jq -r '.items[] | select(.name!="report_coverage") | .id')
|
27
|
+
|
28
|
+
echo "Received Workflow IDs are: ${WORKFLOW_IDS}"
|
29
|
+
|
30
|
+
for workflow_id in ${WORKFLOW_IDS}
|
31
|
+
do
|
32
|
+
echo "Waiting for workflow ${workflow_id} to finish"
|
33
|
+
while true
|
34
|
+
do
|
35
|
+
STATUS=$(curl -s \
|
36
|
+
-H "Circle-Token: ${CIRCLE_TOKEN}" \
|
37
|
+
"${WORKFLOW_SLUG}/${workflow_id}" \
|
38
|
+
| jq -r '.status')
|
39
|
+
if [[ ${STATUS} != "running" && ${STATUS} != "on_hold" ]]
|
40
|
+
then
|
41
|
+
break
|
42
|
+
else
|
43
|
+
echo "Workflow ${workflow_id} has not finished yet. Status is: ${STATUS}"
|
44
|
+
sleep 10
|
45
|
+
fi
|
46
|
+
done
|
47
|
+
|
48
|
+
if [[ "${STATUS}" != "success" ]]
|
49
|
+
then
|
50
|
+
echo "ERROR: Workflow ${workflow_id} did not succeed! Status is: ${STATUS}"
|
51
|
+
exit 254
|
52
|
+
else
|
53
|
+
echo "Workflow ${workflow_id} has finished successfully! Status is: ${STATUS}"
|
54
|
+
fi
|
55
|
+
done
|
56
|
+
|
57
|
+
|
58
|
+
echo "All workflows have successfully finished, downloading artifacts."
|
59
|
+
|
60
|
+
mkdir partial_coverage_results
|
61
|
+
for workflow_id in ${WORKFLOW_IDS}
|
62
|
+
do
|
63
|
+
JOB_NUMBERS=$(curl -s \
|
64
|
+
-H "Circle-Token: ${CIRCLE_TOKEN}" \
|
65
|
+
"${WORKFLOW_SLUG}/${workflow_id}/job" \
|
66
|
+
| jq -r '.items[] | .job_number' \
|
67
|
+
| tr '\n' ' ')
|
68
|
+
|
69
|
+
for job in ${JOB_NUMBERS}
|
70
|
+
do
|
71
|
+
ARTIFACT_DOWNLOAD_LINK=$(curl -s \
|
72
|
+
-H "Circle-Token: ${CIRCLE_TOKEN}" \
|
73
|
+
"${PROJECT_SLUG}/${job}/artifacts" \
|
74
|
+
| jq -r \
|
75
|
+
'.items[] | select(.path=="coverage/.resultset.json") | .url')
|
76
|
+
#'.items[] | select(.path=="coverage/coverage.json" or .path=="coverage/.resultset.json") | .url')
|
77
|
+
curl -s \
|
78
|
+
-L \
|
79
|
+
-H "Circle-Token: ${CIRCLE_TOKEN}" \
|
80
|
+
"${ARTIFACT_DOWNLOAD_LINK}" \
|
81
|
+
-o partial_coverage_results/.resultset-${job}.json
|
82
|
+
done
|
83
|
+
done
|
84
|
+
|
85
|
+
echo "All artifacts have been successfully downloaded."
|
data/gemfiles/aws_30.gemfile
CHANGED
data/gemfiles/aws_60.gemfile
CHANGED
data/gemfiles/cuba_30.gemfile
CHANGED
data/gemfiles/cuba_40.gemfile
CHANGED
data/gemfiles/dalli_20.gemfile
CHANGED
data/gemfiles/dalli_30.gemfile
CHANGED
data/gemfiles/dalli_32.gemfile
CHANGED
data/gemfiles/excon_02.gemfile
CHANGED
data/gemfiles/excon_021.gemfile
CHANGED
data/gemfiles/excon_079.gemfile
CHANGED
data/gemfiles/excon_100.gemfile
CHANGED
data/gemfiles/graphql_10.gemfile
CHANGED
data/gemfiles/graphql_20.gemfile
CHANGED
data/gemfiles/grpc_10.gemfile
CHANGED
data/gemfiles/mongo_216.gemfile
CHANGED
data/gemfiles/mongo_219.gemfile
CHANGED
data/gemfiles/rack_16.gemfile
CHANGED
data/gemfiles/rack_20.gemfile
CHANGED
data/gemfiles/rack_30.gemfile
CHANGED
data/gemfiles/rails_42.gemfile
CHANGED
data/gemfiles/rails_50.gemfile
CHANGED
data/gemfiles/rails_52.gemfile
CHANGED
data/gemfiles/rails_60.gemfile
CHANGED
data/gemfiles/rails_61.gemfile
CHANGED
data/gemfiles/rails_70.gemfile
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
5
|
gem "rake"
|
6
|
-
gem "minitest", "5.
|
6
|
+
gem "minitest", "5.20.0"
|
7
7
|
gem "minitest-reporters"
|
8
8
|
gem "webmock"
|
9
9
|
gem "puma"
|
@@ -11,7 +11,7 @@ gem "rubocop", "~> 1.9"
|
|
11
11
|
gem "rack-test"
|
12
12
|
gem "simplecov", "~> 0.21.2"
|
13
13
|
gem "mail", ">= 2.8.1"
|
14
|
-
gem "rails", "
|
14
|
+
gem "rails", "7.0.8"
|
15
15
|
gem "mysql2", "0.5.5"
|
16
16
|
gem "pg"
|
17
17
|
gem "sqlite3", "~> 1.4"
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2023
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rake"
|
6
|
+
gem "minitest", "5.20.0"
|
7
|
+
gem "minitest-reporters"
|
8
|
+
gem "webmock"
|
9
|
+
gem "puma"
|
10
|
+
gem "rubocop", "~> 1.9"
|
11
|
+
gem "rack-test"
|
12
|
+
gem "simplecov", "~> 0.21.2"
|
13
|
+
gem "mail", ">= 2.8.1"
|
14
|
+
gem "rails", ">= 7.1"
|
15
|
+
gem "mysql2", "0.5.5"
|
16
|
+
gem "pg"
|
17
|
+
gem "sqlite3", "~> 1.4"
|
18
|
+
|
19
|
+
gemspec path: "../"
|
data/gemfiles/redis_40.gemfile
CHANGED
data/gemfiles/resque_122.gemfile
CHANGED
data/gemfiles/resque_20.gemfile
CHANGED
data/gemfiles/roda_20.gemfile
CHANGED
data/gemfiles/roda_30.gemfile
CHANGED
data/gemfiles/sidekiq_42.gemfile
CHANGED
data/gemfiles/sidekiq_50.gemfile
CHANGED
@@ -6,13 +6,13 @@
|
|
6
6
|
source "https://rubygems.org"
|
7
7
|
|
8
8
|
gem "rake"
|
9
|
-
gem "minitest", "5.
|
9
|
+
gem "minitest", "5.20.0"
|
10
10
|
gem "minitest-reporters"
|
11
11
|
gem "webmock"
|
12
12
|
gem "puma"
|
13
13
|
gem "rubocop", "~> 1.9"
|
14
14
|
gem "rack-test"
|
15
15
|
gem "simplecov", "~> 0.21.2"
|
16
|
-
gem "sidekiq", "
|
16
|
+
gem "sidekiq", "< 6.0"
|
17
17
|
|
18
18
|
gemspec path: "../"
|
data/gemfiles/sidekiq_60.gemfile
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
5
|
gem "rake"
|
6
|
-
gem "minitest", "5.
|
6
|
+
gem "minitest", "5.20.0"
|
7
7
|
gem "minitest-reporters"
|
8
8
|
gem "webmock"
|
9
9
|
gem "puma"
|
10
10
|
gem "rubocop", "~> 1.9"
|
11
11
|
gem "rack-test"
|
12
12
|
gem "simplecov", "~> 0.21.2"
|
13
|
-
gem "sidekiq", ">= 6.0", "<
|
13
|
+
gem "sidekiq", ">= 6.0.0", "< 6.5.0"
|
14
14
|
|
15
15
|
gemspec path: "../"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# (c) Copyright IBM Corp. 2023
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rake"
|
6
|
+
gem "minitest", "5.20.0"
|
7
|
+
gem "minitest-reporters"
|
8
|
+
gem "webmock"
|
9
|
+
gem "puma"
|
10
|
+
gem "rubocop", "~> 1.9"
|
11
|
+
gem "rack-test"
|
12
|
+
gem "simplecov", "~> 0.21.2"
|
13
|
+
gem "sidekiq", ">= 6.5.12", "< 7.0.0"
|
14
|
+
|
15
|
+
gemspec path: "../"
|
data/gemfiles/sidekiq_70.gemfile
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
5
|
gem "rake"
|
6
|
-
gem "minitest", "5.
|
6
|
+
gem "minitest", "5.20.0"
|
7
7
|
gem "minitest-reporters"
|
8
8
|
gem "webmock"
|
9
9
|
gem "puma"
|
10
10
|
gem "rubocop", "~> 1.9"
|
11
11
|
gem "rack-test"
|
12
12
|
gem "simplecov", "~> 0.21.2"
|
13
|
-
gem "sidekiq", ">= 7.0"
|
13
|
+
gem "sidekiq", ">= 7.2.0"
|
14
14
|
|
15
15
|
gemspec path: "../"
|
data/gemfiles/sinatra_14.gemfile
CHANGED
data/gemfiles/sinatra_22.gemfile
CHANGED
data/gemfiles/sinatra_30.gemfile
CHANGED
@@ -5,8 +5,7 @@ module Instana
|
|
5
5
|
module Activators
|
6
6
|
class SidekiqClient < Activator
|
7
7
|
def can_instrument?
|
8
|
-
defined?(::Sidekiq) && ::Sidekiq.respond_to?(:configure_client) && ::Instana.config[:'sidekiq-client'][:enabled]
|
9
|
-
Gem::Specification.find_by_name('sidekiq').version < Gem::Version.new('5.3')
|
8
|
+
defined?(::Sidekiq) && ::Sidekiq.respond_to?(:configure_client) && ::Instana.config[:'sidekiq-client'][:enabled]
|
10
9
|
end
|
11
10
|
|
12
11
|
def instrument
|
@@ -5,8 +5,7 @@ module Instana
|
|
5
5
|
module Activators
|
6
6
|
class SidekiqWorker < Activator
|
7
7
|
def can_instrument?
|
8
|
-
defined?(::Sidekiq) && ::Sidekiq.respond_to?(:configure_server) && ::Instana.config[:'sidekiq-worker'][:enabled]
|
9
|
-
Gem::Specification.find_by_name('sidekiq').version < Gem::Version.new('5.3')
|
8
|
+
defined?(::Sidekiq) && ::Sidekiq.respond_to?(:configure_server) && ::Instana.config[:'sidekiq-worker'][:enabled]
|
10
9
|
end
|
11
10
|
|
12
11
|
def instrument
|
@@ -14,8 +14,17 @@ module Instana
|
|
14
14
|
# Temporary until we move connection collection to redis
|
15
15
|
# instrumentation
|
16
16
|
Sidekiq.redis_pool.with do |client|
|
17
|
-
|
18
|
-
|
17
|
+
sidekiq_version = Gem::Specification.find_by_name('sidekiq').version
|
18
|
+
host, port = if sidekiq_version >= Gem::Version.new('7.0') && client.respond_to?(:config) && client.config.respond_to?(:host) && client.config.respond_to?(:port)
|
19
|
+
[client.config.host, client.config.port]
|
20
|
+
elsif client.respond_to?(:connection)
|
21
|
+
[client.connection[:host], client.connection[:port]]
|
22
|
+
elsif client.respond_to?(:client) && client.client.respond_to?(:options)
|
23
|
+
[client.client.options[:host], client.client.options[:port]]
|
24
|
+
else # Unexpected version, continue without recording any redis-url
|
25
|
+
break
|
26
|
+
end
|
27
|
+
kv_payload[:'sidekiq-client'][:'redis-url'] = "#{host}:#{port}"
|
19
28
|
end
|
20
29
|
|
21
30
|
context = ::Instana.tracer.context
|
@@ -14,8 +14,17 @@ module Instana
|
|
14
14
|
# Temporary until we move connection collection to redis
|
15
15
|
# instrumentation
|
16
16
|
Sidekiq.redis_pool.with do |client|
|
17
|
-
|
18
|
-
|
17
|
+
sidekiq_version = Gem::Specification.find_by_name('sidekiq').version
|
18
|
+
host, port = if sidekiq_version >= Gem::Version.new('7.0') && client.respond_to?(:config) && client.config.respond_to?(:host) && client.config.respond_to?(:port)
|
19
|
+
[client.config.host, client.config.port]
|
20
|
+
elsif client.respond_to?(:connection)
|
21
|
+
[client.connection[:host], client.connection[:port]]
|
22
|
+
elsif client.respond_to?(:client) && client.client.respond_to?(:options)
|
23
|
+
[client.client.options[:host], client.client.options[:port]]
|
24
|
+
else # Unexpected version, continue without recording any redis-url
|
25
|
+
break
|
26
|
+
end
|
27
|
+
kv_payload[:'sidekiq-worker'][:'redis-url'] = "#{host}:#{port}"
|
19
28
|
end
|
20
29
|
|
21
30
|
context = {}
|
data/lib/instana/version.rb
CHANGED
@@ -53,9 +53,11 @@ class HostAgentReportingObserverTest < Minitest::Test
|
|
53
53
|
|
54
54
|
def test_agent_action
|
55
55
|
action = JSON.dump(
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
{
|
57
|
+
action: 'ruby.source',
|
58
|
+
messageId: 'test',
|
59
|
+
args: {file: 'test_helper.rb'}
|
60
|
+
}
|
59
61
|
)
|
60
62
|
|
61
63
|
stub_request(:post, "http://10.10.10.10:9292/tracermetrics")
|
@@ -5,7 +5,11 @@ require 'test_helper'
|
|
5
5
|
|
6
6
|
class RailsActionControllerTest < Minitest::Test
|
7
7
|
include Rack::Test::Methods
|
8
|
-
APP = Rack::Builder.parse_file('test/support/apps/action_controller/config.ru')
|
8
|
+
APP = Rack::Builder.parse_file('test/support/apps/action_controller/config.ru')
|
9
|
+
railties_version = Gem::Specification.find_by_name('railties').version
|
10
|
+
if railties_version < Gem::Version.new('7.1.0')
|
11
|
+
APP = APP.first
|
12
|
+
end
|
9
13
|
|
10
14
|
def app
|
11
15
|
APP
|
@@ -5,7 +5,11 @@ require 'test_helper'
|
|
5
5
|
|
6
6
|
class RailsActionViewTest < Minitest::Test
|
7
7
|
include Rack::Test::Methods
|
8
|
-
APP = Rack::Builder.parse_file('test/support/apps/action_view/config.ru')
|
8
|
+
APP = Rack::Builder.parse_file('test/support/apps/action_view/config.ru')
|
9
|
+
railties_version = Gem::Specification.find_by_name('railties').version
|
10
|
+
if railties_version < Gem::Version.new('7.1.0')
|
11
|
+
APP = APP.first
|
12
|
+
end
|
9
13
|
|
10
14
|
def app
|
11
15
|
APP
|
@@ -13,14 +13,17 @@ class RailsActiveRecordDatabaseMissingTest < Minitest::Test
|
|
13
13
|
SQLite3::Database.new('/tmp/test.db')
|
14
14
|
ENV['DATABASE_URL'] = 'sqlite3:///tmp/test.db'
|
15
15
|
|
16
|
-
@
|
16
|
+
@connection_pool = ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'])
|
17
|
+
c = ::ActiveRecord::Base.connection
|
18
|
+
c.execute 'PRAGMA journal_mode=DELETE'
|
19
|
+
c.execute 'PRAGMA locking_mode=NORMAL'
|
17
20
|
ActiveRecord::Migration.suppress_messages do
|
18
21
|
ActiveRecord::Migration.run(CreateBlocks, direction: :up)
|
19
22
|
end
|
20
23
|
end
|
21
24
|
|
22
25
|
def teardown
|
23
|
-
|
26
|
+
@connection_pool.disconnect
|
24
27
|
ENV['DATABASE_URL'] = @old_url
|
25
28
|
end
|
26
29
|
|
@@ -34,7 +37,6 @@ class RailsActiveRecordDatabaseMissingTest < Minitest::Test
|
|
34
37
|
end
|
35
38
|
|
36
39
|
spans = ::Instana.processor.queued_spans
|
37
|
-
assert_equal 3, spans.length
|
38
40
|
span = find_first_span_by_name(spans, :activerecord)
|
39
41
|
|
40
42
|
assert_equal 1, span[:ec]
|
@@ -6,22 +6,6 @@ require 'support/apps/sidekiq/boot'
|
|
6
6
|
|
7
7
|
class SidekiqClientTest < Minitest::Test
|
8
8
|
def setup
|
9
|
-
@framework_version = Gem::Specification.find_by_name('sidekiq').version
|
10
|
-
@supported_framework_version = @framework_version < Gem::Version.new('5.3')
|
11
|
-
@execute_test_if_framework_version_is_supported = lambda {
|
12
|
-
unless @supported_framework_version
|
13
|
-
skip "Skipping this test because sidekiq version #{@framework_version} is not yet supported!"
|
14
|
-
end
|
15
|
-
}
|
16
|
-
@execute_test_only_if_framework_version_is_not_supported = lambda {
|
17
|
-
if @supported_framework_version
|
18
|
-
skip "Skipping this test because sidekiq version #{@framework_version} is already supported!"
|
19
|
-
end
|
20
|
-
}
|
21
|
-
|
22
|
-
Sidekiq.configure_client do |config|
|
23
|
-
config.redis = { url: ENV["REDIS_URL"] }
|
24
|
-
end
|
25
9
|
::Sidekiq::Queue.new('some_random_queue').clear
|
26
10
|
end
|
27
11
|
|
@@ -32,7 +16,6 @@ class SidekiqClientTest < Minitest::Test
|
|
32
16
|
end
|
33
17
|
|
34
18
|
def test_enqueue
|
35
|
-
@execute_test_if_framework_version_is_supported.call
|
36
19
|
clear_all!
|
37
20
|
Instana.tracer.start_or_continue_trace(:sidekiqtests) do
|
38
21
|
disable_redis_instrumentation
|
@@ -53,7 +36,6 @@ class SidekiqClientTest < Minitest::Test
|
|
53
36
|
end
|
54
37
|
|
55
38
|
def test_enqueue_failure
|
56
|
-
@execute_test_if_framework_version_is_supported.call
|
57
39
|
clear_all!
|
58
40
|
|
59
41
|
Instana.tracer.start_or_continue_trace(:sidekiqtests) do
|
@@ -104,6 +86,7 @@ class SidekiqClientTest < Minitest::Test
|
|
104
86
|
assert_equal 'some_random_queue', second_span[:data][:'sidekiq-client'][:queue]
|
105
87
|
assert_equal 'SidekiqJobOne', second_span[:data][:'sidekiq-client'][:job]
|
106
88
|
assert_equal "false", second_span[:data][:'sidekiq-client'][:retry]
|
89
|
+
assert second_span[:data][:'sidekiq-client'][:'redis-url']
|
107
90
|
assert_equal job['jid'], second_span[:data][:'sidekiq-client'][:job_id]
|
108
91
|
end
|
109
92
|
|
@@ -124,6 +107,7 @@ class SidekiqClientTest < Minitest::Test
|
|
124
107
|
assert_equal 'some_random_queue', second_span[:data][:'sidekiq-client'][:queue]
|
125
108
|
assert_equal 'SidekiqJobTwo', second_span[:data][:'sidekiq-client'][:job]
|
126
109
|
assert_equal "false", second_span[:data][:'sidekiq-client'][:retry]
|
110
|
+
assert second_span[:data][:'sidekiq-client'][:'redis-url']
|
127
111
|
assert_equal 'Fail to enqueue job', second_span[:data][:log][:message]
|
128
112
|
end
|
129
113
|
|
@@ -5,55 +5,13 @@ require 'test_helper'
|
|
5
5
|
require 'support/apps/sidekiq/boot'
|
6
6
|
|
7
7
|
class SidekiqServerTest < Minitest::Test
|
8
|
-
def setup
|
9
|
-
@framework_version = Gem::Specification.find_by_name('sidekiq').version
|
10
|
-
@supported_framework_version = @framework_version < Gem::Version.new('5.3')
|
11
|
-
@execute_test_if_framework_version_is_supported = lambda {
|
12
|
-
unless @supported_framework_version
|
13
|
-
skip "Skipping this test because sidekiq version #{@framework_version} is not yet supported!"
|
14
|
-
end
|
15
|
-
}
|
16
|
-
@execute_test_only_if_framework_version_is_not_supported = lambda {
|
17
|
-
if @supported_framework_version
|
18
|
-
skip "Skipping this test because sidekiq version #{@framework_version} is already supported!"
|
19
|
-
end
|
20
|
-
}
|
21
|
-
|
22
|
-
Sidekiq.configure_client do |config|
|
23
|
-
config.redis = { url: ENV["REDIS_URL"] }
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
8
|
def test_config_defaults
|
28
9
|
assert ::Instana.config[:'sidekiq-worker'].is_a?(Hash)
|
29
10
|
assert ::Instana.config[:'sidekiq-worker'].key?(:enabled)
|
30
11
|
assert_equal true, ::Instana.config[:'sidekiq-worker'][:enabled]
|
31
12
|
end
|
32
13
|
|
33
|
-
def test_no_sidekiq_tracing_if_unsupported_version_only_redis
|
34
|
-
@execute_test_only_if_framework_version_is_not_supported.call
|
35
|
-
clear_all!
|
36
|
-
::Sidekiq.redis_pool.with do |redis|
|
37
|
-
redis.sadd('queues'.freeze, 'important')
|
38
|
-
redis.lpush(
|
39
|
-
'queue:important',
|
40
|
-
<<-JSON
|
41
|
-
{
|
42
|
-
"class":"SidekiqJobOne",
|
43
|
-
"args":[1,2,3],
|
44
|
-
"queue":"important",
|
45
|
-
"jid":"123456789"
|
46
|
-
}
|
47
|
-
JSON
|
48
|
-
)
|
49
|
-
end
|
50
|
-
|
51
|
-
spans = Instana.processor.queued_spans
|
52
|
-
assert spans
|
53
|
-
end
|
54
|
-
|
55
14
|
def test_successful_worker_starts_new_trace
|
56
|
-
@execute_test_if_framework_version_is_supported.call
|
57
15
|
clear_all!
|
58
16
|
$sidekiq_mode = :server
|
59
17
|
inject_instrumentation
|
@@ -84,7 +42,6 @@ class SidekiqServerTest < Minitest::Test
|
|
84
42
|
end
|
85
43
|
|
86
44
|
def test_failed_worker_starts_new_trace
|
87
|
-
@execute_test_if_framework_version_is_supported.call
|
88
45
|
clear_all!
|
89
46
|
$sidekiq_mode = :server
|
90
47
|
inject_instrumentation
|
@@ -116,7 +73,6 @@ class SidekiqServerTest < Minitest::Test
|
|
116
73
|
end
|
117
74
|
|
118
75
|
def test_successful_worker_continues_previous_trace
|
119
|
-
@execute_test_if_framework_version_is_supported.call
|
120
76
|
clear_all!
|
121
77
|
$sidekiq_mode = :server
|
122
78
|
inject_instrumentation
|
@@ -150,7 +106,6 @@ class SidekiqServerTest < Minitest::Test
|
|
150
106
|
end
|
151
107
|
|
152
108
|
def test_failed_worker_continues_previous_trace
|
153
|
-
@execute_test_if_framework_version_is_supported.call
|
154
109
|
clear_all!
|
155
110
|
$sidekiq_mode = :server
|
156
111
|
inject_instrumentation
|
@@ -200,6 +155,7 @@ class SidekiqServerTest < Minitest::Test
|
|
200
155
|
|
201
156
|
assert_equal 'important', worker_span[:data][:'sidekiq-worker'][:queue]
|
202
157
|
assert_equal 'SidekiqJobOne', worker_span[:data][:'sidekiq-worker'][:job]
|
158
|
+
assert worker_span[:data][:'sidekiq-worker'][:'redis-url']
|
203
159
|
assert_equal false, worker_span[:data][:'sidekiq-worker'][:job_id].nil?
|
204
160
|
end
|
205
161
|
|
@@ -208,6 +164,7 @@ class SidekiqServerTest < Minitest::Test
|
|
208
164
|
|
209
165
|
assert_equal 'important', worker_span[:data][:'sidekiq-worker'][:queue]
|
210
166
|
assert_equal 'SidekiqJobTwo', worker_span[:data][:'sidekiq-worker'][:job]
|
167
|
+
assert worker_span[:data][:'sidekiq-worker'][:'redis-url']
|
211
168
|
assert_equal false, worker_span[:data][:'sidekiq-worker'][:job_id].nil?
|
212
169
|
|
213
170
|
assert_equal true, worker_span[:data][:'sidekiq-worker'][:error]
|
@@ -217,6 +174,7 @@ class SidekiqServerTest < Minitest::Test
|
|
217
174
|
def assert_client_span(client_span, job)
|
218
175
|
assert_equal :'sidekiq-client', client_span[:n]
|
219
176
|
assert_equal 'important', client_span[:data][:'sidekiq-client'][:queue]
|
177
|
+
assert client_span[:data][:'sidekiq-client'][:'redis-url']
|
220
178
|
assert_equal job.name, client_span[:data][:'sidekiq-client'][:job]
|
221
179
|
end
|
222
180
|
end
|
@@ -12,15 +12,15 @@ require_relative 'jobs/sidekiq_job_2'
|
|
12
12
|
::Instana.logger.info "Booting instrumented sidekiq worker for tests."
|
13
13
|
::Sidekiq.logger.level = ::Logger::FATAL
|
14
14
|
|
15
|
-
properties = {queues: ['important'], concurrency: 2}
|
16
|
-
|
17
15
|
sidekiq_version = Gem::Specification.find_by_name('sidekiq').version
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
16
|
+
cli = ::Sidekiq::CLI.instance
|
17
|
+
cli.parse(['sidekiq', '-r', __FILE__, '-C', "#{File.dirname(__FILE__)}/config.yaml"])
|
18
|
+
|
19
|
+
config_or_options = if sidekiq_version >= Gem::Version.new('6.5.0')
|
20
|
+
cli.config
|
21
|
+
else
|
22
|
+
cli.send :options
|
23
|
+
end
|
24
24
|
|
25
25
|
sidekiq_thread = Thread.new do
|
26
26
|
launcher = ::Sidekiq::Launcher.new(
|
data/test/test_helper.rb
CHANGED
@@ -12,6 +12,7 @@ begin
|
|
12
12
|
|
13
13
|
add_filter %r{^/test/}
|
14
14
|
|
15
|
+
command_name "Job #{ENV['CIRCLE_BUILD_NUM']}" if ENV['CIRCLE_BUILD_NUM']
|
15
16
|
add_group(
|
16
17
|
'In Process Collector',
|
17
18
|
[%r{lib/instana/(agent|backend|tracing|collectors|open_tracing|snapshot)}, %r{lib/instana/[^/]+\.rb}]
|
@@ -60,7 +61,7 @@ if ENV['CI']
|
|
60
61
|
])
|
61
62
|
else
|
62
63
|
Minitest::Reporters.use!([
|
63
|
-
|
64
|
+
Minitest::Reporters::SpecReporter.new
|
64
65
|
])
|
65
66
|
end
|
66
67
|
Minitest::Test.include(Instana::TestHelpers)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.212.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Giacomo Lombardo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -153,12 +153,14 @@ files:
|
|
153
153
|
- bin/console
|
154
154
|
- bin/setup
|
155
155
|
- docker-compose.yml
|
156
|
+
- download.sh
|
156
157
|
- examples/opentracing.rb
|
157
158
|
- examples/tracing.rb
|
158
159
|
- extras/license_header.rb
|
159
160
|
- gemfiles/.bundle/config
|
160
161
|
- gemfiles/aws_30.gemfile
|
161
162
|
- gemfiles/aws_60.gemfile
|
163
|
+
- gemfiles/coverage_merge.gemfile
|
162
164
|
- gemfiles/cuba_30.gemfile
|
163
165
|
- gemfiles/cuba_40.gemfile
|
164
166
|
- gemfiles/dalli_20.gemfile
|
@@ -183,6 +185,7 @@ files:
|
|
183
185
|
- gemfiles/rails_60.gemfile
|
184
186
|
- gemfiles/rails_61.gemfile
|
185
187
|
- gemfiles/rails_70.gemfile
|
188
|
+
- gemfiles/rails_71.gemfile
|
186
189
|
- gemfiles/redis_40.gemfile
|
187
190
|
- gemfiles/resque_122.gemfile
|
188
191
|
- gemfiles/resque_20.gemfile
|
@@ -195,6 +198,7 @@ files:
|
|
195
198
|
- gemfiles/sidekiq_42.gemfile
|
196
199
|
- gemfiles/sidekiq_50.gemfile
|
197
200
|
- gemfiles/sidekiq_60.gemfile
|
201
|
+
- gemfiles/sidekiq_65.gemfile
|
198
202
|
- gemfiles/sidekiq_70.gemfile
|
199
203
|
- gemfiles/sinatra_14.gemfile
|
200
204
|
- gemfiles/sinatra_22.gemfile
|