instana 1.215.1 → 1.217.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +102 -4
  3. data/.tekton/.currency/docs/report.md +15 -14
  4. data/.tekton/.currency/resources/requirements.txt +0 -1
  5. data/.tekton/.currency/resources/table.json +6 -0
  6. data/.tekton/.currency/scripts/generate_report.py +38 -130
  7. data/.tekton/README.md +278 -0
  8. data/.tekton/github-pr-eventlistener.yaml +1 -1
  9. data/.tekton/pipeline.yaml +154 -6
  10. data/.tekton/pipelinerun.yaml +2 -2
  11. data/.tekton/ruby-tracer-prepuller.yaml +4 -0
  12. data/.tekton/run_unittests.sh +27 -6
  13. data/.tekton/scheduled-eventlistener.yaml +2 -4
  14. data/.tekton/task.yaml +156 -0
  15. data/Rakefile +1 -1
  16. data/gemfiles/excon_0100.gemfile +14 -0
  17. data/gemfiles/excon_021.gemfile +1 -1
  18. data/gemfiles/excon_079.gemfile +1 -1
  19. data/gemfiles/excon_100.gemfile +2 -2
  20. data/gemfiles/rails_61.gemfile +1 -0
  21. data/gemfiles/rails_70.gemfile +1 -0
  22. data/gemfiles/rails_71.gemfile +2 -1
  23. data/gemfiles/rails_80.gemfile +17 -0
  24. data/gemfiles/{excon_02.gemfile → sequel_56.gemfile} +4 -5
  25. data/gemfiles/sequel_57.gemfile +16 -0
  26. data/gemfiles/sequel_58.gemfile +16 -0
  27. data/lib/instana/activators/sequel.rb +20 -0
  28. data/lib/instana/backend/host_agent.rb +12 -3
  29. data/lib/instana/config.rb +1 -0
  30. data/lib/instana/instrumentation/active_record.rb +1 -1
  31. data/lib/instana/instrumentation/instrumented_request.rb +2 -2
  32. data/lib/instana/instrumentation/sequel.rb +42 -0
  33. data/lib/instana/tracing/span.rb +2 -2
  34. data/lib/instana/version.rb +1 -1
  35. data/lib/instana.rb +4 -2
  36. data/test/activator_test.rb +1 -1
  37. data/test/instrumentation/rails_active_record_test.rb +1 -1
  38. data/test/instrumentation/sequel_test.rb +105 -0
  39. metadata +13 -9
  40. data/.tekton/.currency/currency-pipeline.yaml +0 -36
  41. data/.tekton/.currency/currency-pipelinerun.yaml +0 -20
  42. data/.tekton/.currency/currency-rbac.yaml +0 -29
  43. data/.tekton/.currency/currency-scheduled-eventlistener.yaml +0 -56
  44. data/.tekton/.currency/currency-tasks.yaml +0 -94
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7087be480ee9027905afc8e29781253aa34e13fda02dec5607840d61cb4699c0
4
- data.tar.gz: c73ad67e15ec9a21051f888ac443f35a39f2e9e9e7c1efeb3bd0824a41bdaad3
3
+ metadata.gz: 3dab15815d0d5714580ad0c16fee1e922b809746f3423b6245a0a97762e2edff
4
+ data.tar.gz: 83fdd5e75c3137d8c53c25d3027bbf5a5b0398af3d685908679df4e47fb4ee26
5
5
  SHA512:
6
- metadata.gz: 2d09eb59acb9156a0cd5bbd85390406b7da1a72e9bc8692b2084feee186b6c723de72f34218520909226b0b7aa48eeb96708673fd514f8e7ebdc9ad24c84542a
7
- data.tar.gz: 1b79ce75d861bcb005ccf46d18d61673faa194be298e5cbfb95ce6fb0a9f503a60c4709fed85b5ab295468c19674005d3ec7e3afda57a03704ab89788013999d
6
+ metadata.gz: 62e192f63c9a7a13d90683e1a242d12dfc9d9f924a09ec189692f11498b986f011204b732cb9c66082cc3203751d2e0848dca4c68546f5a95d450df6a5aa3e8d
7
+ data.tar.gz: bb68582ebc71784a353ac361af56fb9849f22034ed0fdd097c5fbf96bc3a552134f41e3dca011adf810aacd7c67b0a4aec1545e71ea4f33db26641dfa0e9b441
data/.circleci/config.yml CHANGED
@@ -10,6 +10,7 @@ library_gemfile: &library_gemfile
10
10
  - "./gemfiles/dalli_30.gemfile"
11
11
  - "./gemfiles/dalli_32.gemfile"
12
12
  - "./gemfiles/excon_079.gemfile"
13
+ - "./gemfiles/excon_0100.gemfile"
13
14
  - "./gemfiles/excon_100.gemfile"
14
15
  - "./gemfiles/graphql_10.gemfile"
15
16
  - "./gemfiles/graphql_20.gemfile"
@@ -183,6 +184,43 @@ executors:
183
184
  environment:
184
185
  POSTGRES_PASSWORD: 'test'
185
186
  POSTGRES_DB: 'ci_test'
187
+ ruby_34:
188
+ docker:
189
+ - image: ruby:3.4.0-preview2-bookworm
190
+ environment:
191
+ MEMCACHED_HOST: '127.0.0.1:11211'
192
+ REDIS_URL: 'redis://127.0.0.1:6379'
193
+ DATABASE_URL: 'sqlite3::memory:'
194
+ - image: memcached
195
+ - image: redis
196
+ - image: amazon/dynamodb-local
197
+ - image: minio/minio:latest
198
+ command: ["server", "/data"]
199
+ - image: s12v/sns
200
+ - image: softwaremill/elasticmq-native
201
+ - image: mongo:5-focal
202
+ ruby_34_mysql2:
203
+ docker:
204
+ - image: ruby:3.4.0-preview2-bookworm
205
+ environment:
206
+ DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
207
+ - image: mariadb
208
+ environment:
209
+ MYSQL_DATABASE: 'ci_test'
210
+ MYSQL_USER: 'root'
211
+ MYSQL_PASSWORD: ''
212
+ MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
213
+ MYSQL_ROOT_PASSWORD: ''
214
+ MYSQL_ROOT_HOST: '%'
215
+ ruby_34_postgres:
216
+ docker:
217
+ - image: ruby:3.4.0-preview2-bookworm
218
+ environment:
219
+ DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
220
+ - image: postgres
221
+ environment:
222
+ POSTGRES_PASSWORD: 'test'
223
+ POSTGRES_DB: 'ci_test'
186
224
  ruby_33_lint:
187
225
  docker:
188
226
  - image: cimg/ruby:3.3-node
@@ -319,12 +357,12 @@ jobs:
319
357
  bundle check || bundle install
320
358
  - run_rubocop
321
359
  report_coverage:
322
- executor: ruby_32
360
+ executor: ruby_33
323
361
  steps:
324
362
  - checkout
325
- - run_sonarqube
363
+ # - run_sonarqube
326
364
  publish:
327
- executor: ruby_30
365
+ executor: ruby_33
328
366
  steps:
329
367
  - checkout
330
368
  - setup
@@ -350,7 +388,8 @@ workflows:
350
388
  - ruby_31
351
389
  - ruby_32
352
390
  - ruby_33
353
- libraries_ruby_3:
391
+ - ruby_34
392
+ libraries_ruby_30_32:
354
393
  jobs:
355
394
  - test_apprisal:
356
395
  matrix:
@@ -359,8 +398,26 @@ workflows:
359
398
  - ruby_30
360
399
  - ruby_31
361
400
  - ruby_32
401
+ <<: *library_gemfile
402
+ libraries_ruby_33_34:
403
+ jobs:
404
+ - test_apprisal:
405
+ matrix:
406
+ parameters:
407
+ stack:
362
408
  - ruby_33
409
+ - ruby_34
363
410
  <<: *library_gemfile
411
+ # Currently compiling the native extensions for `grpc`
412
+ # exceeds an internal RAM and/or CPU limit of CircleCI executor,
413
+ # and the job gets terminated with:
414
+ # `Received "killed" signal`
415
+ # Hence we exclude it here for the time being.
416
+ # TODO: Remove this exclusion as soon as pre-built binaries are available
417
+ # on https://rubygems.org/gems/grpc/versions
418
+ exclude:
419
+ - stack: ruby_34
420
+ gemfile: "./gemfiles/grpc_10.gemfile"
364
421
  rails_ruby_3:
365
422
  jobs:
366
423
  - test_apprisal:
@@ -376,12 +433,53 @@ workflows:
376
433
  - ruby_32
377
434
  - ruby_32_postgres
378
435
  - ruby_32_mysql2
436
+ - ruby_33
379
437
  - ruby_33_postgres
380
438
  - ruby_33_mysql2
439
+ - ruby_34
440
+ - ruby_34_postgres
441
+ - ruby_34_mysql2
381
442
  gemfile:
382
443
  - "./gemfiles/rails_61.gemfile"
383
444
  - "./gemfiles/rails_70.gemfile"
384
445
  - "./gemfiles/rails_71.gemfile"
446
+ rails8_ruby_33_34:
447
+ jobs:
448
+ - test_apprisal:
449
+ matrix:
450
+ parameters:
451
+ stack:
452
+ - ruby_32
453
+ - ruby_32_postgres
454
+ - ruby_32_mysql2
455
+ - ruby_33
456
+ - ruby_33_postgres
457
+ - ruby_33_mysql2
458
+ - ruby_34
459
+ - ruby_34_postgres
460
+ - ruby_34_mysql2
461
+ gemfile:
462
+ - "./gemfiles/rails_80.gemfile"
463
+ sequel:
464
+ jobs:
465
+ - test_apprisal:
466
+ matrix:
467
+ parameters:
468
+ stack:
469
+ - ruby_30
470
+ - ruby_30_mysql2
471
+ - ruby_31
472
+ - ruby_31_mysql2
473
+ - ruby_32
474
+ - ruby_32_mysql2
475
+ - ruby_33
476
+ - ruby_33_mysql2
477
+ - ruby_34
478
+ - ruby_34_mysql2
479
+ gemfile:
480
+ - "./gemfiles/sequel_56.gemfile"
481
+ - "./gemfiles/sequel_57.gemfile"
482
+ - "./gemfiles/sequel_58.gemfile"
385
483
  report_coverage:
386
484
  jobs:
387
485
  - report_coverage
@@ -3,17 +3,18 @@
3
3
  | Package name | Support Policy | Beta version | Last Supported Version | Latest version | Up-to-date | Cloud Native |
4
4
  |:---------------|:-----------------|:---------------|:-------------------------|:-----------------|:-------------|:---------------|
5
5
  | Cuba | On demand | No | 4.0.3 | 4.0.3 | Yes | No |
6
- | Rack | 0-day | No | 3.1.3 | 3.1.3 | Yes | No |
7
- | Rails | 30-days | No | 7.1.3.4 | 7.1.3.4 | Yes | No |
8
- | Rails::API | 30-days | No | 0.4.1 | 0.4.1 | Yes | No |
9
- | Rails LTS | On demand | No | 5.2 | 5.2 | Yes | No |
10
- | Roda | 30-days | No | 3.81.0 | 3.81.0 | Yes | No |
11
- | Sinatra | 30-days | No | 4.0.0 | 4.0.0 | Yes | No |
12
- | Excon | 30-days | No | 0.110.0 | 0.110.0 | Yes | Yes |
13
- | gRPC | 30-days | No | 1.64.0 | 1.64.0 | Yes | No |
14
- | Net::HTTP | 0-day | No | 0.4.1 | 0.4.1 | Yes | No |
15
- | Rest-Client | 30-days | No | 2.1.0 | 2.1.0 | Yes | No |
16
- | Dalli | 30-days | No | 3.2.8 | 3.2.8 | Yes | No |
17
- | Resque | 30-days | No | 2.6.0 | 2.6.0 | Yes | Yes |
18
- | Sidekiq | 30-days | No | 7.2.4 | 7.2.4 | Yes | Yes |
19
- | GraphQL | 30-days | No | 2.3.5 | 2.3.5 | Yes | Yes |
6
+ | Rack | 45-days | No | 3.1.7 | 3.1.7 | Yes | No |
7
+ | Rails | 45-days | No | 7.2.1 | 7.2.1 | Yes | No |
8
+ | Rails::API | 45-days | No | 0.4.1 | 0.4.1 | Yes | No |
9
+ | Rails LTS | On demand | No | 6.1 | 6.1 | Yes | No |
10
+ | Roda | 45-days | No | 3.84.0 | 3.84.0 | Yes | No |
11
+ | Sinatra | 45-days | No | 4.0.0 | 4.0.0 | Yes | No |
12
+ | Excon | 45-days | No | 0.112.0 | 0.112.0 | Yes | Yes |
13
+ | gRPC | 45-days | No | 1.66.0 | 1.66.0 | Yes | No |
14
+ | Net::HTTP | 0-day | Yes | 0.4.1 | 0.4.1 | Yes | No |
15
+ | Rest-Client | 45-days | No | 2.1.0 | 2.1.0 | Yes | No |
16
+ | Dalli | 45-days | No | 3.2.8 | 3.2.8 | Yes | No |
17
+ | Resque | 45-days | No | 2.6.0 | 2.6.0 | Yes | Yes |
18
+ | Sidekiq | 45-days | No | 7.3.2 | 7.3.2 | Yes | Yes |
19
+ | GraphQL | 45-days | No | 2.3.17 | 2.3.17 | Yes | Yes |
20
+ | Sequel | 45-days | No | 5.60.0 | 5.84.0 | Yes | No |
@@ -2,4 +2,3 @@ requests
2
2
  pandas
3
3
  beautifulsoup4
4
4
  tabulate
5
- kubernetes
@@ -89,6 +89,12 @@
89
89
  "Support Policy": "45-days",
90
90
  "Beta version": "No",
91
91
  "Cloud Native": "Yes"
92
+ },
93
+ {
94
+ "Package name": "Sequel",
95
+ "Support Policy": "45-days",
96
+ "Beta version": "No",
97
+ "Cloud Native": "Yes"
92
98
  }
93
99
  ]
94
100
  }
@@ -1,4 +1,5 @@
1
1
  # Standard Libraries
2
+ import glob
2
3
  import re
3
4
  from json import load
4
5
 
@@ -6,143 +7,50 @@ from json import load
6
7
  from requests import get
7
8
  from pandas import DataFrame
8
9
  from bs4 import BeautifulSoup
9
- from kubernetes import client, config
10
10
 
11
11
  JSON_FILE = "resources/table.json"
12
12
  REPORT_FILE = "docs/report.md"
13
13
  API_V1_ENDPOINT = "https://rubygems.org/api/v1/versions/"
14
14
 
15
- def filter_taskruns(taskrun_filter, taskruns):
16
- filtered_taskruns = list(filter(taskrun_filter, taskruns))
17
- filtered_taskruns.sort(
18
- key=lambda tr: tr["metadata"]["creationTimestamp"], reverse=True
19
- )
20
-
21
- return filtered_taskruns
22
-
23
-
24
- def get_taskruns(namespace, task_name):
25
- group = "tekton.dev"
26
- version = "v1"
27
- plural = "taskruns"
28
-
29
- # access the custom resource from tekton
30
- tektonV1 = client.CustomObjectsApi()
31
- taskruns = tektonV1.list_namespaced_custom_object(
32
- group,
33
- version,
34
- namespace,
35
- plural,
36
- label_selector=f"{group}/task={task_name}, triggers.tekton.dev/trigger=ruby-tracer-scheduled-pipeline-triggger",
37
- )["items"]
38
-
39
- return taskruns
40
-
41
-
42
- def process_taskrun_logs(
43
- taskruns, core_v1_client, namespace, library, tekton_ci_output
44
- ):
45
- for tr in taskruns:
46
- pod_name = tr["status"]["podName"]
47
- taskrun_name = tr["metadata"]["name"]
48
- logs = core_v1_client.read_namespaced_pod_log(
49
- pod_name, namespace, container="step-unittest"
50
- )
51
- if "Installing" not in logs:
52
- print(
53
- f"Unable to retrieve logs from taskrun pod {pod_name} of taskrun {taskrun_name} for gem {library}."
54
- )
55
- continue
56
-
57
- print(
58
- f"Retrieving logs from taskrun pod {pod_name} of taskrun {taskrun_name} for gem {library}.."
59
- )
60
-
61
- match = re.search(f"Installing ({library} [^\s]+)", logs)
62
- tekton_ci_output += f"{match[1]}\n"
63
- break
64
-
65
- return tekton_ci_output
66
-
67
-
68
- def get_tekton_ci_output():
69
- config.load_incluster_config()
70
-
71
- namespace = "default"
72
- core_v1_client = client.CoreV1Api()
73
-
74
- ruby_33_prefix = "unittest-default-ruby-33-"
75
- ruby_31_prefix = "unittest-default-ruby-31-"
76
-
77
- default_libraries_dict = {
78
- "cuba": f"{ruby_33_prefix}1",
79
- "excon": f"{ruby_33_prefix}4",
80
- "graphql": f"{ruby_33_prefix}6",
81
- "grpc": f"{ruby_33_prefix}7",
82
- "rack": f"{ruby_33_prefix}10",
83
- "rest-client": f"{ruby_33_prefix}11",
84
- "roda": f"{ruby_33_prefix}13",
85
- "sinatra": f"{ruby_33_prefix}16",
86
- "net-http": f"{ruby_31_prefix}8",
15
+ def get_bundle_install_output():
16
+
17
+ libraries_from_logs = {
18
+ "cuba": "cuba_40_ruby_3.3.",
19
+ "excon": "excon_100_ruby_3.3.",
20
+ "graphql": "graphql_20_ruby_3.3.",
21
+ "grpc": "grpc_10_ruby_3.3.",
22
+ "rack": "rack_30_ruby_3.3.",
23
+ "rest-client": "rest_client_20_ruby_3.3.",
24
+ "roda": "roda_30_ruby_3.3.",
25
+ "sinatra": "sinatra_40_ruby_3.3.",
26
+ "net-http": "net_http_01_ruby_3.1.",
27
+ "rails": "rails_71_sqlite3_ruby_3.3.",
28
+ "dalli": "dalli_32_ruby_3.3.",
29
+ "resque": "resque_20_ruby_3.3.",
30
+ "sidekiq": "sidekiq_70_ruby_3.3.",
31
+ "sequel": "sequel_58_ruby_3.3."
87
32
  }
88
33
 
89
- tekton_ci_output = ""
90
- task_name = "ruby-tracer-unittest-default-libraries-task"
91
- default_taskruns = get_taskruns(namespace, task_name)
34
+ bundle_install_output = ""
92
35
 
93
- for library, pattern in default_libraries_dict.items():
94
- taskrun_filter = (
95
- lambda tr: tr["metadata"]["name"].endswith(pattern)
96
- and tr["status"]["conditions"][0]["type"] == "Succeeded"
97
- )
98
- filtered_default_taskruns = filter_taskruns(taskrun_filter, default_taskruns)
99
-
100
- tekton_ci_output = process_taskrun_logs(
101
- filtered_default_taskruns,
102
- core_v1_client,
103
- namespace,
104
- library,
105
- tekton_ci_output,
106
- )
36
+ for library, pattern in libraries_from_logs.items():
37
+ glob_result = glob.glob(f"../../dep_{pattern}*")
38
+ if not glob_result:
39
+ print(f"Could not find bundle install log for gem '{library}'.")
40
+ continue
107
41
 
108
- other_libraries_dict = {
109
- "rails": {
110
- "pattern": "rails-postgres-11",
111
- "task_name": "ruby-tracer-unittest-rails-postgres-task",
112
- },
113
- "dalli": {
114
- "pattern": "memcached-11",
115
- "task_name": "ruby-tracer-unittest-memcached-libraries-task",
116
- },
117
- "resque": {
118
- "pattern": "unittest-redis-ruby-32-33-9",
119
- "task_name": "ruby-tracer-unittest-redis-libraries-task",
120
- },
121
- "sidekiq": {
122
- "pattern": "unittest-redis-ruby-32-33-18",
123
- "task_name": "ruby-tracer-unittest-redis-libraries-task",
124
- },
125
- }
42
+ with open(glob_result[0], 'r') as file:
43
+ logs = file.read().replace('\n', ' ')
126
44
 
127
- for library, inner_dict in other_libraries_dict.items():
128
- pattern = inner_dict["pattern"]
129
- task_name = inner_dict["task_name"]
130
- taskrun_filter = (
131
- lambda tr: tr["metadata"]["name"].endswith(pattern)
132
- and tr["status"]["conditions"][0]["type"] == "Succeeded"
133
- )
134
- other_taskruns = get_taskruns(namespace, task_name)
135
- filtered_other_taskruns = filter_taskruns(taskrun_filter, other_taskruns)
136
-
137
- tekton_ci_output = process_taskrun_logs(
138
- filtered_other_taskruns,
139
- core_v1_client,
140
- namespace,
141
- library,
142
- tekton_ci_output
143
- )
45
+ if "Installing" not in logs:
46
+ print( f"Unable to retrieve logs from for gem '{library}'.")
47
+ continue
48
+
49
+ print(f"Retrieving currency for gem '{library}'.")
50
+ match = re.search(f"Installing ({library} [^\s]+)", logs)
51
+ bundle_install_output += f"{match[1]}\n"
144
52
 
145
- return tekton_ci_output
53
+ return bundle_install_output
146
54
 
147
55
 
148
56
  def get_upstream_version(dependency):
@@ -161,11 +69,11 @@ def get_upstream_version(dependency):
161
69
  return latest_version
162
70
 
163
71
 
164
- def get_last_supported_version(tekton_ci_output, dependency):
72
+ def get_last_supported_version(bundle_install_output, dependency):
165
73
  """get up-to-date supported version"""
166
74
  pattern = r" ([^\s]+)"
167
75
 
168
- last_supported_version = re.search(dependency + pattern, tekton_ci_output, flags=re.I | re.M)
76
+ last_supported_version = re.search(dependency + pattern, bundle_install_output, flags=re.I | re.M)
169
77
 
170
78
  return last_supported_version[1]
171
79
 
@@ -183,7 +91,7 @@ def main():
183
91
  with open(JSON_FILE) as file:
184
92
  data = load(file)
185
93
 
186
- tekton_ci_output = get_tekton_ci_output()
94
+ bundle_install_output = get_bundle_install_output()
187
95
 
188
96
  items = data["table"]
189
97
 
@@ -194,7 +102,7 @@ def main():
194
102
  latest_version = get_upstream_version(package)
195
103
 
196
104
  if not package in ["rails lts", "rails-api"]:
197
- last_supported_version = get_last_supported_version(tekton_ci_output, package)
105
+ last_supported_version = get_last_supported_version(bundle_install_output, package)
198
106
  else:
199
107
  last_supported_version = latest_version
200
108