instana 1.215.0 → 1.216.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +83 -3
  3. data/.tekton/.currency/resources/requirements.txt +0 -1
  4. data/.tekton/.currency/resources/table.json +13 -13
  5. data/.tekton/.currency/scripts/generate_report.py +37 -130
  6. data/.tekton/README.md +278 -0
  7. data/.tekton/github-pr-eventlistener.yaml +1 -1
  8. data/.tekton/pipeline.yaml +96 -2
  9. data/.tekton/pipelinerun.yaml +2 -2
  10. data/.tekton/ruby-tracer-prepuller.yaml +4 -0
  11. data/.tekton/run_unittests.sh +27 -6
  12. data/.tekton/scheduled-eventlistener.yaml +1 -1
  13. data/.tekton/task.yaml +72 -0
  14. data/gemfiles/rails_61.gemfile +1 -0
  15. data/gemfiles/rails_70.gemfile +1 -0
  16. data/gemfiles/rails_71.gemfile +1 -0
  17. data/gemfiles/sequel_56.gemfile +16 -0
  18. data/gemfiles/sequel_57.gemfile +16 -0
  19. data/gemfiles/sequel_58.gemfile +16 -0
  20. data/instana.gemspec +2 -0
  21. data/lib/instana/activators/sequel.rb +20 -0
  22. data/lib/instana/backend/host_agent.rb +5 -1
  23. data/lib/instana/config.rb +1 -0
  24. data/lib/instana/instrumentation/sequel.rb +42 -0
  25. data/lib/instana/tracing/span.rb +2 -2
  26. data/lib/instana/version.rb +1 -1
  27. data/test/activator_test.rb +1 -1
  28. data/test/backend/host_agent_test.rb +2 -0
  29. data/test/instrumentation/rails_active_record_test.rb +1 -1
  30. data/test/instrumentation/sequel_test.rb +105 -0
  31. data/test/tracing/span_test.rb +2 -2
  32. data/test/tracing/tracer_test.rb +1 -3
  33. metadata +39 -8
  34. data/.tekton/.currency/currency-pipeline.yaml +0 -36
  35. data/.tekton/.currency/currency-pipelinerun.yaml +0 -20
  36. data/.tekton/.currency/currency-rbac.yaml +0 -29
  37. data/.tekton/.currency/currency-scheduled-eventlistener.yaml +0 -56
  38. data/.tekton/.currency/currency-tasks.yaml +0 -94
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18251267394e2bad33fbd75aec3a2c9a8c846ae7076ee101dc7aa58cdf4b12d1
4
- data.tar.gz: 920422e3ad64902191910d428335ec984ff56ece4204a6f53ef709fc07dff166
3
+ metadata.gz: d537c1bb144d87403ff4f77159269e31e8af893fd31f6c942d5d6c00a2f89a4a
4
+ data.tar.gz: 81d978a21bd5bd84c1305851a34570a20c69dd794ccaef7081490db78037c5d4
5
5
  SHA512:
6
- metadata.gz: bbd2324015660989cfdc10af661fc2416ffa473291affdfe06d0e2aa78a2f0de1accc570962166cd9cf7a6c50e9bd68e91efd483e0a69d68e93816f9fac59705
7
- data.tar.gz: cfcd4bb472effa2ff81c04eb4b768cd91d70dcf56b59794c00644aacfb36872797e864bb5b60511ff2b1fca2409ce441226b9fe9bf5ff3b8f342da5f3e1762bc
6
+ metadata.gz: 423d36b04c2e7b6035b566d0bd9617dfd9c2d7700e8d0c8ae934ce2631703cdc4e875ac73a64b136aed2f511a07bb5cfdd257c881a293a2cb85b66bc1d347bd9
7
+ data.tar.gz: ef472837810e93803daef7776c0b0e664093ddb72cb44f149be2798c9f8ddc0d26eeefe25a9d01a5114e42fb578d050ddc75e03470d1735d1d34eecd5226baa5
data/.circleci/config.yml CHANGED
@@ -183,6 +183,43 @@ executors:
183
183
  environment:
184
184
  POSTGRES_PASSWORD: 'test'
185
185
  POSTGRES_DB: 'ci_test'
186
+ ruby_34:
187
+ docker:
188
+ - image: ruby:3.4.0-preview1-bookworm
189
+ environment:
190
+ MEMCACHED_HOST: '127.0.0.1:11211'
191
+ REDIS_URL: 'redis://127.0.0.1:6379'
192
+ DATABASE_URL: 'sqlite3::memory:'
193
+ - image: memcached
194
+ - image: redis
195
+ - image: amazon/dynamodb-local
196
+ - image: minio/minio:latest
197
+ command: ["server", "/data"]
198
+ - image: s12v/sns
199
+ - image: softwaremill/elasticmq-native
200
+ - image: mongo:5-focal
201
+ ruby_34_mysql2:
202
+ docker:
203
+ - image: ruby:3.4.0-preview1-bookworm
204
+ environment:
205
+ DATABASE_URL: "mysql2://root@127.0.0.1:3306/ci_test"
206
+ - image: mariadb
207
+ environment:
208
+ MYSQL_DATABASE: 'ci_test'
209
+ MYSQL_USER: 'root'
210
+ MYSQL_PASSWORD: ''
211
+ MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
212
+ MYSQL_ROOT_PASSWORD: ''
213
+ MYSQL_ROOT_HOST: '%'
214
+ ruby_34_postgres:
215
+ docker:
216
+ - image: ruby:3.4.0-preview1-bookworm
217
+ environment:
218
+ DATABASE_URL: "postgres://postgres:test@127.0.0.1:5432/ci_test"
219
+ - image: postgres
220
+ environment:
221
+ POSTGRES_PASSWORD: 'test'
222
+ POSTGRES_DB: 'ci_test'
186
223
  ruby_33_lint:
187
224
  docker:
188
225
  - image: cimg/ruby:3.3-node
@@ -319,12 +356,12 @@ jobs:
319
356
  bundle check || bundle install
320
357
  - run_rubocop
321
358
  report_coverage:
322
- executor: ruby_32
359
+ executor: ruby_33
323
360
  steps:
324
361
  - checkout
325
362
  - run_sonarqube
326
363
  publish:
327
- executor: ruby_30
364
+ executor: ruby_33
328
365
  steps:
329
366
  - checkout
330
367
  - setup
@@ -350,7 +387,8 @@ workflows:
350
387
  - ruby_31
351
388
  - ruby_32
352
389
  - ruby_33
353
- libraries_ruby_3:
390
+ - ruby_34
391
+ libraries_ruby_30_32:
354
392
  jobs:
355
393
  - test_apprisal:
356
394
  matrix:
@@ -359,8 +397,26 @@ workflows:
359
397
  - ruby_30
360
398
  - ruby_31
361
399
  - ruby_32
400
+ <<: *library_gemfile
401
+ libraries_ruby_33_34:
402
+ jobs:
403
+ - test_apprisal:
404
+ matrix:
405
+ parameters:
406
+ stack:
362
407
  - ruby_33
408
+ - ruby_34
363
409
  <<: *library_gemfile
410
+ # Currently compiling the native extensions for `grpc`
411
+ # exceeds an internal RAM and/or CPU limit of CircleCI executor,
412
+ # and the job gets terminated with:
413
+ # `Received "killed" signal`
414
+ # Hence we exclude it here for the time being.
415
+ # TODO: Remove this exclusion as soon as pre-built binaries are available
416
+ # on https://rubygems.org/gems/grpc/versions
417
+ exclude:
418
+ - stack: ruby_34
419
+ gemfile: "./gemfiles/grpc_10.gemfile"
364
420
  rails_ruby_3:
365
421
  jobs:
366
422
  - test_apprisal:
@@ -376,12 +432,36 @@ workflows:
376
432
  - ruby_32
377
433
  - ruby_32_postgres
378
434
  - ruby_32_mysql2
435
+ - ruby_33
379
436
  - ruby_33_postgres
380
437
  - ruby_33_mysql2
438
+ - ruby_34
439
+ - ruby_34_postgres
440
+ - ruby_34_mysql2
381
441
  gemfile:
382
442
  - "./gemfiles/rails_61.gemfile"
383
443
  - "./gemfiles/rails_70.gemfile"
384
444
  - "./gemfiles/rails_71.gemfile"
445
+ sequel:
446
+ jobs:
447
+ - test_apprisal:
448
+ matrix:
449
+ parameters:
450
+ stack:
451
+ - ruby_30
452
+ - ruby_30_mysql2
453
+ - ruby_31
454
+ - ruby_31_mysql2
455
+ - ruby_32
456
+ - ruby_32_mysql2
457
+ - ruby_33
458
+ - ruby_33_mysql2
459
+ - ruby_34
460
+ - ruby_34_mysql2
461
+ gemfile:
462
+ - "./gemfiles/sequel_56.gemfile"
463
+ - "./gemfiles/sequel_57.gemfile"
464
+ - "./gemfiles/sequel_58.gemfile"
385
465
  report_coverage:
386
466
  jobs:
387
467
  - report_coverage
@@ -2,4 +2,3 @@ requests
2
2
  pandas
3
3
  beautifulsoup4
4
4
  tabulate
5
- kubernetes
@@ -8,19 +8,19 @@
8
8
  },
9
9
  {
10
10
  "Package name": "Rack",
11
- "Support Policy": "0-day",
11
+ "Support Policy": "45-days",
12
12
  "Beta version": "No",
13
13
  "Cloud Native": "No"
14
14
  },
15
15
  {
16
16
  "Package name": "Rails",
17
- "Support Policy": "30-days",
17
+ "Support Policy": "45-days",
18
18
  "Beta version": "No",
19
19
  "Cloud Native": "No"
20
20
  },
21
21
  {
22
22
  "Package name": "Rails::API",
23
- "Support Policy": "30-days",
23
+ "Support Policy": "45-days",
24
24
  "Beta version": "No",
25
25
  "Cloud Native": "No"
26
26
  },
@@ -32,61 +32,61 @@
32
32
  },
33
33
  {
34
34
  "Package name": "Roda",
35
- "Support Policy": "30-days",
35
+ "Support Policy": "45-days",
36
36
  "Beta version": "No",
37
37
  "Cloud Native": "No"
38
38
  },
39
39
  {
40
40
  "Package name": "Sinatra",
41
- "Support Policy": "30-days",
41
+ "Support Policy": "45-days",
42
42
  "Beta version": "No",
43
43
  "Cloud Native": "No"
44
44
  },
45
45
  {
46
46
  "Package name": "Excon",
47
- "Support Policy": "30-days",
47
+ "Support Policy": "45-days",
48
48
  "Beta version": "No",
49
49
  "Cloud Native": "Yes"
50
50
  },
51
51
  {
52
52
  "Package name": "gRPC",
53
- "Support Policy": "30-days",
53
+ "Support Policy": "45-days",
54
54
  "Beta version": "No",
55
55
  "Cloud Native": "No"
56
56
  },
57
57
  {
58
58
  "Package name": "Net::HTTP",
59
59
  "Support Policy": "0-day",
60
- "Beta version": "No",
60
+ "Beta version": "Yes",
61
61
  "Cloud Native": "No"
62
62
  },
63
63
  {
64
64
  "Package name": "Rest-Client",
65
- "Support Policy": "30-days",
65
+ "Support Policy": "45-days",
66
66
  "Beta version": "No",
67
67
  "Cloud Native": "No"
68
68
  },
69
69
  {
70
70
  "Package name": "Dalli",
71
- "Support Policy": "30-days",
71
+ "Support Policy": "45-days",
72
72
  "Beta version": "No",
73
73
  "Cloud Native": "No"
74
74
  },
75
75
  {
76
76
  "Package name": "Resque",
77
- "Support Policy": "30-days",
77
+ "Support Policy": "45-days",
78
78
  "Beta version": "No",
79
79
  "Cloud Native": "Yes"
80
80
  },
81
81
  {
82
82
  "Package name": "Sidekiq",
83
- "Support Policy": "30-days",
83
+ "Support Policy": "45-days",
84
84
  "Beta version": "No",
85
85
  "Cloud Native": "Yes"
86
86
  },
87
87
  {
88
88
  "Package name": "GraphQL",
89
- "Support Policy": "30-days",
89
+ "Support Policy": "45-days",
90
90
  "Beta version": "No",
91
91
  "Cloud Native": "Yes"
92
92
  }
@@ -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,49 @@ 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."
87
31
  }
88
32
 
89
- tekton_ci_output = ""
90
- task_name = "ruby-tracer-unittest-default-libraries-task"
91
- default_taskruns = get_taskruns(namespace, task_name)
33
+ bundle_install_output = ""
92
34
 
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
- )
35
+ for library, pattern in libraries_from_logs.items():
36
+ glob_result = glob.glob(f"../../dep_{pattern}*")
37
+ if not glob_result:
38
+ print(f"Could not find bundle install log for gem '{library}'.")
39
+ continue
107
40
 
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
- }
41
+ with open(glob_result[0], 'r') as file:
42
+ logs = file.read().replace('\n', ' ')
126
43
 
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
- )
44
+ if "Installing" not in logs:
45
+ print( f"Unable to retrieve logs from for gem '{library}'.")
46
+ continue
47
+
48
+ print(f"Retrieving currency for gem '{library}'.")
49
+ match = re.search(f"Installing ({library} [^\s]+)", logs)
50
+ bundle_install_output += f"{match[1]}\n"
144
51
 
145
- return tekton_ci_output
52
+ return bundle_install_output
146
53
 
147
54
 
148
55
  def get_upstream_version(dependency):
@@ -161,11 +68,11 @@ def get_upstream_version(dependency):
161
68
  return latest_version
162
69
 
163
70
 
164
- def get_last_supported_version(tekton_ci_output, dependency):
71
+ def get_last_supported_version(bundle_install_output, dependency):
165
72
  """get up-to-date supported version"""
166
73
  pattern = r" ([^\s]+)"
167
74
 
168
- last_supported_version = re.search(dependency + pattern, tekton_ci_output, flags=re.I | re.M)
75
+ last_supported_version = re.search(dependency + pattern, bundle_install_output, flags=re.I | re.M)
169
76
 
170
77
  return last_supported_version[1]
171
78
 
@@ -183,7 +90,7 @@ def main():
183
90
  with open(JSON_FILE) as file:
184
91
  data = load(file)
185
92
 
186
- tekton_ci_output = get_tekton_ci_output()
93
+ bundle_install_output = get_bundle_install_output()
187
94
 
188
95
  items = data["table"]
189
96
 
@@ -194,7 +101,7 @@ def main():
194
101
  latest_version = get_upstream_version(package)
195
102
 
196
103
  if not package in ["rails lts", "rails-api"]:
197
- last_supported_version = get_last_supported_version(tekton_ci_output, package)
104
+ last_supported_version = get_last_supported_version(bundle_install_output, package)
198
105
  else:
199
106
  last_supported_version = latest_version
200
107