instana 1.214.2 → 1.214.4
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 +1 -10
- data/.tekton/.currency/currency-pipeline.yaml +36 -0
- data/.tekton/.currency/currency-pipelinerun.yaml +20 -0
- data/.tekton/.currency/currency-rbac.yaml +29 -0
- data/.tekton/.currency/currency-scheduled-eventlistener.yaml +56 -0
- data/.tekton/.currency/currency-tasks.yaml +94 -0
- data/.tekton/.currency/docs/report.md +19 -0
- data/.tekton/.currency/resources/requirements.txt +5 -0
- data/.tekton/.currency/resources/table.json +94 -0
- data/.tekton/.currency/scripts/generate_report.py +228 -0
- data/.tekton/github-pr-eventlistener.yaml +2 -0
- data/.tekton/pipeline.yaml +61 -19
- data/.tekton/pipelinerun.yaml +2 -0
- data/.tekton/ruby-tracer-prepuller.yaml +83 -0
- data/.tekton/scheduled-eventlistener.yaml +2 -0
- data/.tekton/task.yaml +3 -26
- data/gemfiles/net_http_01.gemfile +1 -0
- data/lib/instana/activators/action_view.rb +5 -2
- data/lib/instana/backend/request_client.rb +3 -1
- data/lib/instana/instrumentation/action_view.rb +40 -14
- data/lib/instana/version.rb +1 -1
- data/test/backend/host_agent_test.rb +16 -4
- data/test/instrumentation/net_http_test.rb +2 -2
- data/test/instrumentation/rails_action_view_test.rb +0 -41
- metadata +13 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 424b7ef31ac74b0ba82b7c010fe21074ccf6851670b18efe98fdf2d01360b71f
|
4
|
+
data.tar.gz: eabcd2216cc6c209444ba2e9400a4b446fdd31933c462b300d7f3e6fcdb7ee02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 166f7c5dbf87cbec5ad22690ad848be4fbd2a02d37514c57ca9fc560f4d98248749fb9894f07567fe4d4fdabe2750c703df86136b1c2cb9f773a97c016d36a90
|
7
|
+
data.tar.gz: ad43e911090d2e4cc107157a6bf052428a610dac4911c7c843de99e4770c926a80ccc92517378ec41d4a836cfbc584c133027cf58f6f3f1bbaea538b098e9c2b
|
data/.circleci/config.yml
CHANGED
@@ -189,15 +189,6 @@ executors:
|
|
189
189
|
commands:
|
190
190
|
setup:
|
191
191
|
steps:
|
192
|
-
- run:
|
193
|
-
name: Install iproute2
|
194
|
-
command: |
|
195
|
-
sudo apt-get update
|
196
|
-
sudo apt-get install iproute2
|
197
|
-
- run:
|
198
|
-
name: Install Java
|
199
|
-
command: |
|
200
|
-
sudo apt-get install openjdk-11-jdk
|
201
192
|
- run:
|
202
193
|
name: Update RubyGems
|
203
194
|
command: |
|
@@ -239,7 +230,7 @@ commands:
|
|
239
230
|
environment:
|
240
231
|
BUNDLE_GEMFILE: './Gemfile'
|
241
232
|
- run:
|
242
|
-
name: Run SonarQube to
|
233
|
+
name: Run SonarQube to report the coverage
|
243
234
|
command: |
|
244
235
|
wget -O /tmp/sonar-scanner-cli.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.1.3023.zip
|
245
236
|
unzip -d /tmp /tmp/sonar-scanner-cli.zip
|
@@ -0,0 +1,36 @@
|
|
1
|
+
apiVersion: tekton.dev/v1beta1
|
2
|
+
kind: Pipeline
|
3
|
+
metadata:
|
4
|
+
name: ruby-currency-pipeline
|
5
|
+
spec:
|
6
|
+
params:
|
7
|
+
- name: revision
|
8
|
+
type: string
|
9
|
+
workspaces:
|
10
|
+
- name: ruby-currency-pvc
|
11
|
+
tasks:
|
12
|
+
- name: clone-repo
|
13
|
+
params:
|
14
|
+
- name: revision
|
15
|
+
value: $(params.revision)
|
16
|
+
taskRef:
|
17
|
+
name: ruby-git-clone-task
|
18
|
+
workspaces:
|
19
|
+
- name: task-pvc
|
20
|
+
workspace: ruby-currency-pvc
|
21
|
+
- name: generate-currency-report
|
22
|
+
runAfter:
|
23
|
+
- clone-repo
|
24
|
+
taskRef:
|
25
|
+
name: ruby-generate-currency-report-task
|
26
|
+
workspaces:
|
27
|
+
- name: task-pvc
|
28
|
+
workspace: ruby-currency-pvc
|
29
|
+
- name: upload-currency-report
|
30
|
+
runAfter:
|
31
|
+
- generate-currency-report
|
32
|
+
taskRef:
|
33
|
+
name: ruby-upload-currency-report-task
|
34
|
+
workspaces:
|
35
|
+
- name: task-pvc
|
36
|
+
workspace: ruby-currency-pvc
|
@@ -0,0 +1,20 @@
|
|
1
|
+
apiVersion: tekton.dev/v1beta1
|
2
|
+
kind: PipelineRun
|
3
|
+
metadata:
|
4
|
+
name: ruby-currency-pipelinerun
|
5
|
+
spec:
|
6
|
+
params:
|
7
|
+
- name: revision
|
8
|
+
value: "master"
|
9
|
+
pipelineRef:
|
10
|
+
name: ruby-currency-pipeline
|
11
|
+
serviceAccountName: currency-serviceaccount
|
12
|
+
workspaces:
|
13
|
+
- name: ruby-currency-pvc
|
14
|
+
volumeClaimTemplate:
|
15
|
+
spec:
|
16
|
+
accessModes:
|
17
|
+
- ReadWriteOnce
|
18
|
+
resources:
|
19
|
+
requests:
|
20
|
+
storage: 100Mi
|
@@ -0,0 +1,29 @@
|
|
1
|
+
apiVersion: v1
|
2
|
+
kind: ServiceAccount
|
3
|
+
metadata:
|
4
|
+
name: currency-serviceaccount
|
5
|
+
---
|
6
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
7
|
+
kind: ClusterRole
|
8
|
+
metadata:
|
9
|
+
name: currency-clusterrole
|
10
|
+
rules:
|
11
|
+
- apiGroups: [""]
|
12
|
+
resources: ["pods", "pods/log"]
|
13
|
+
verbs: ["get", "list"]
|
14
|
+
- apiGroups: ["tekton.dev"]
|
15
|
+
resources: ["taskruns"]
|
16
|
+
verbs: ["get", "list"]
|
17
|
+
---
|
18
|
+
apiVersion: rbac.authorization.k8s.io/v1
|
19
|
+
kind: ClusterRoleBinding
|
20
|
+
metadata:
|
21
|
+
name: currency-clusterrolebinding
|
22
|
+
subjects:
|
23
|
+
- kind: ServiceAccount
|
24
|
+
name: currency-serviceaccount
|
25
|
+
namespace: default
|
26
|
+
roleRef:
|
27
|
+
apiGroup: rbac.authorization.k8s.io
|
28
|
+
kind: ClusterRole
|
29
|
+
name: currency-clusterrole
|
@@ -0,0 +1,56 @@
|
|
1
|
+
apiVersion: triggers.tekton.dev/v1beta1
|
2
|
+
kind: EventListener
|
3
|
+
metadata:
|
4
|
+
name: ruby-currency-cron-listener
|
5
|
+
spec:
|
6
|
+
serviceAccountName: tekton-triggers-eventlistener-serviceaccount
|
7
|
+
triggers:
|
8
|
+
- name: currency-cron-trigger
|
9
|
+
template:
|
10
|
+
ref: ruby-currency-trigger-template
|
11
|
+
---
|
12
|
+
apiVersion: triggers.tekton.dev/v1beta1
|
13
|
+
kind: TriggerTemplate
|
14
|
+
metadata:
|
15
|
+
name: ruby-currency-trigger-template
|
16
|
+
spec:
|
17
|
+
resourcetemplates:
|
18
|
+
- apiVersion: tekton.dev/v1beta1
|
19
|
+
kind: PipelineRun
|
20
|
+
metadata:
|
21
|
+
generateName: ruby-currency-
|
22
|
+
spec:
|
23
|
+
pipelineRef:
|
24
|
+
name: ruby-currency-pipeline
|
25
|
+
serviceAccountName: currency-serviceaccount
|
26
|
+
params:
|
27
|
+
- name: revision
|
28
|
+
value: "master"
|
29
|
+
workspaces:
|
30
|
+
- name: ruby-currency-pvc
|
31
|
+
volumeClaimTemplate:
|
32
|
+
spec:
|
33
|
+
accessModes:
|
34
|
+
- ReadWriteOnce
|
35
|
+
resources:
|
36
|
+
requests:
|
37
|
+
storage: 100Mi
|
38
|
+
---
|
39
|
+
apiVersion: batch/v1
|
40
|
+
kind: CronJob
|
41
|
+
metadata:
|
42
|
+
name: ruby-currency-cronjob
|
43
|
+
spec:
|
44
|
+
schedule: "5 3 * * Mon-Fri"
|
45
|
+
jobTemplate:
|
46
|
+
spec:
|
47
|
+
template:
|
48
|
+
spec:
|
49
|
+
containers:
|
50
|
+
- name: http-request-to-el-svc
|
51
|
+
# curlimages/curl:8.6.0
|
52
|
+
image: curlimages/curl@sha256:f2237028bed58de91f62aea74260bb2a299cf12fbcabc23cfaf125fef276c884
|
53
|
+
imagePullPolicy: IfNotPresent
|
54
|
+
args: ["curl", "-X", "POST", "--data", "{}", "el-ruby-currency-cron-listener.default.svc.cluster.local:8080"]
|
55
|
+
restartPolicy: OnFailure
|
56
|
+
---
|
@@ -0,0 +1,94 @@
|
|
1
|
+
apiVersion: tekton.dev/v1beta1
|
2
|
+
kind: Task
|
3
|
+
metadata:
|
4
|
+
name: ruby-git-clone-task
|
5
|
+
spec:
|
6
|
+
params:
|
7
|
+
- name: revision
|
8
|
+
type: string
|
9
|
+
workspaces:
|
10
|
+
- name: task-pvc
|
11
|
+
mountPath: /workspace
|
12
|
+
steps:
|
13
|
+
- name: clone-repo
|
14
|
+
# alpine/git:2.43.0
|
15
|
+
image: alpine/git@sha256:6ff4de047dcc8f0c7d75d2efff63fbc189e87d2f458305f2cc8f165ff83309cf
|
16
|
+
script: |
|
17
|
+
#!/bin/sh
|
18
|
+
echo "Cloning repo"
|
19
|
+
cd /workspace && git clone --filter=blob:none --sparse --depth 1 https://github.com/instana/ruby-sensor -b $(params.revision)
|
20
|
+
cd ruby-sensor
|
21
|
+
git sparse-checkout add .tekton/.currency
|
22
|
+
ls -lah /workspace/ruby-sensor
|
23
|
+
---
|
24
|
+
apiVersion: tekton.dev/v1beta1
|
25
|
+
kind: Task
|
26
|
+
metadata:
|
27
|
+
name: ruby-generate-currency-report-task
|
28
|
+
spec:
|
29
|
+
workspaces:
|
30
|
+
- name: task-pvc
|
31
|
+
mountPath: /workspace
|
32
|
+
steps:
|
33
|
+
- name: generate-currency-report
|
34
|
+
# 3.10.13-bookworm
|
35
|
+
image: python@sha256:c970ff53939772f47b0672e380328afb50d8fd1c0568ed4f82c22effc54244fc
|
36
|
+
script: |
|
37
|
+
#!/usr/bin/env bash
|
38
|
+
|
39
|
+
cd /workspace/ruby-sensor/.tekton/.currency
|
40
|
+
|
41
|
+
python -m venv /tmp/venv
|
42
|
+
source /tmp/venv/bin/activate
|
43
|
+
pip install -r resources/requirements.txt
|
44
|
+
|
45
|
+
python scripts/generate_report.py
|
46
|
+
if [ $? -ne 0 ]; then
|
47
|
+
echo "Error occured while generating the ruby tracer currency report." >&2
|
48
|
+
exit 1
|
49
|
+
fi
|
50
|
+
cat docs/report.md
|
51
|
+
---
|
52
|
+
apiVersion: tekton.dev/v1beta1
|
53
|
+
kind: Task
|
54
|
+
metadata:
|
55
|
+
name: ruby-upload-currency-report-task
|
56
|
+
spec:
|
57
|
+
params:
|
58
|
+
- name: github-token-secret
|
59
|
+
default: instanacd-github-api-token
|
60
|
+
workspaces:
|
61
|
+
- name: task-pvc
|
62
|
+
mountPath: /workspace
|
63
|
+
steps:
|
64
|
+
- name: upload-currency-report
|
65
|
+
# alpine/git:2.43.0
|
66
|
+
image: alpine/git@sha256:6ff4de047dcc8f0c7d75d2efff63fbc189e87d2f458305f2cc8f165ff83309cf
|
67
|
+
env:
|
68
|
+
- name: GH_ENTERPRISE_TOKEN
|
69
|
+
valueFrom:
|
70
|
+
secretKeyRef:
|
71
|
+
name: $(params.github-token-secret)
|
72
|
+
key: "GH_ENTERPRISE_TOKEN"
|
73
|
+
script: |
|
74
|
+
#!/bin/sh
|
75
|
+
|
76
|
+
cd /workspace
|
77
|
+
git clone https://oauth2:$GH_ENTERPRISE_TOKEN@github.ibm.com/instana/tracer-reports.git
|
78
|
+
|
79
|
+
if [ $? -ne 0 ]; then
|
80
|
+
echo "The attempt to clone the tracer-reports repository failed, preventing the upload of ruby tracer currency report." >&2
|
81
|
+
exit 1
|
82
|
+
fi
|
83
|
+
|
84
|
+
cd tracer-reports
|
85
|
+
|
86
|
+
cp ../ruby-sensor/.tekton/.currency/docs/report.md ./automated/currency/ruby/report.md
|
87
|
+
|
88
|
+
git config user.name "Instanacd PAT for GitHub Enterprise"
|
89
|
+
git config user.email instana.ibm.github.enterprise@ibm.com
|
90
|
+
|
91
|
+
git add .
|
92
|
+
|
93
|
+
git commit -m "chore: Updated ruby currency report"
|
94
|
+
git push origin main
|
@@ -0,0 +1,19 @@
|
|
1
|
+
##### This page is auto-generated. Any change will be overwritten after the next sync. Please apply changes directly to the files in the [ruby tracer](https://github.com/instana/ruby-sensor) repo.
|
2
|
+
## Ruby supported packages and versions
|
3
|
+
| Package name | Support Policy | Beta version | Last Supported Version | Latest version | Up-to-date | Cloud Native |
|
4
|
+
|:---------------|:-----------------|:---------------|:-------------------------|:-----------------|:-------------|:---------------|
|
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 |
|
@@ -0,0 +1,94 @@
|
|
1
|
+
{
|
2
|
+
"table": [
|
3
|
+
{
|
4
|
+
"Package name": "Cuba",
|
5
|
+
"Support Policy": "On demand",
|
6
|
+
"Beta version": "No",
|
7
|
+
"Cloud Native": "No"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"Package name": "Rack",
|
11
|
+
"Support Policy": "0-day",
|
12
|
+
"Beta version": "No",
|
13
|
+
"Cloud Native": "No"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"Package name": "Rails",
|
17
|
+
"Support Policy": "30-days",
|
18
|
+
"Beta version": "No",
|
19
|
+
"Cloud Native": "No"
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"Package name": "Rails::API",
|
23
|
+
"Support Policy": "30-days",
|
24
|
+
"Beta version": "No",
|
25
|
+
"Cloud Native": "No"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"Package name": "Rails LTS",
|
29
|
+
"Support Policy": "On demand",
|
30
|
+
"Beta version": "No",
|
31
|
+
"Cloud Native": "No"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"Package name": "Roda",
|
35
|
+
"Support Policy": "30-days",
|
36
|
+
"Beta version": "No",
|
37
|
+
"Cloud Native": "No"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"Package name": "Sinatra",
|
41
|
+
"Support Policy": "30-days",
|
42
|
+
"Beta version": "No",
|
43
|
+
"Cloud Native": "No"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"Package name": "Excon",
|
47
|
+
"Support Policy": "30-days",
|
48
|
+
"Beta version": "No",
|
49
|
+
"Cloud Native": "Yes"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"Package name": "gRPC",
|
53
|
+
"Support Policy": "30-days",
|
54
|
+
"Beta version": "No",
|
55
|
+
"Cloud Native": "No"
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"Package name": "Net::HTTP",
|
59
|
+
"Support Policy": "0-day",
|
60
|
+
"Beta version": "No",
|
61
|
+
"Cloud Native": "No"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"Package name": "Rest-Client",
|
65
|
+
"Support Policy": "30-days",
|
66
|
+
"Beta version": "No",
|
67
|
+
"Cloud Native": "No"
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"Package name": "Dalli",
|
71
|
+
"Support Policy": "30-days",
|
72
|
+
"Beta version": "No",
|
73
|
+
"Cloud Native": "No"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"Package name": "Resque",
|
77
|
+
"Support Policy": "30-days",
|
78
|
+
"Beta version": "No",
|
79
|
+
"Cloud Native": "Yes"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"Package name": "Sidekiq",
|
83
|
+
"Support Policy": "30-days",
|
84
|
+
"Beta version": "No",
|
85
|
+
"Cloud Native": "Yes"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"Package name": "GraphQL",
|
89
|
+
"Support Policy": "30-days",
|
90
|
+
"Beta version": "No",
|
91
|
+
"Cloud Native": "Yes"
|
92
|
+
}
|
93
|
+
]
|
94
|
+
}
|
@@ -0,0 +1,228 @@
|
|
1
|
+
# Standard Libraries
|
2
|
+
import re
|
3
|
+
from json import load
|
4
|
+
|
5
|
+
# Third Party
|
6
|
+
from requests import get
|
7
|
+
from pandas import DataFrame
|
8
|
+
from bs4 import BeautifulSoup
|
9
|
+
from kubernetes import client, config
|
10
|
+
|
11
|
+
JSON_FILE = "resources/table.json"
|
12
|
+
REPORT_FILE = "docs/report.md"
|
13
|
+
API_V1_ENDPOINT = "https://rubygems.org/api/v1/versions/"
|
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",
|
87
|
+
}
|
88
|
+
|
89
|
+
tekton_ci_output = ""
|
90
|
+
task_name = "ruby-tracer-unittest-default-libraries-task"
|
91
|
+
default_taskruns = get_taskruns(namespace, task_name)
|
92
|
+
|
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
|
+
)
|
107
|
+
|
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
|
+
}
|
126
|
+
|
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
|
+
)
|
144
|
+
|
145
|
+
return tekton_ci_output
|
146
|
+
|
147
|
+
|
148
|
+
def get_upstream_version(dependency):
|
149
|
+
"""get the latest version available upstream"""
|
150
|
+
if dependency != "rails lts":
|
151
|
+
response = get(f"{API_V1_ENDPOINT}/{dependency}/latest.json")
|
152
|
+
response_json = response.json()
|
153
|
+
latest_version = response_json["version"]
|
154
|
+
else:
|
155
|
+
url = "https://makandracards.com/railslts/16137-installing-rails-lts/read"
|
156
|
+
page = get(url)
|
157
|
+
soup = BeautifulSoup(page.text, "html.parser")
|
158
|
+
text = soup.findAll("li")[-1].text
|
159
|
+
pattern = "(\d+\.\d+\.?\d*)"
|
160
|
+
latest_version = re.search(pattern, text)[1]
|
161
|
+
return latest_version
|
162
|
+
|
163
|
+
|
164
|
+
def get_last_supported_version(tekton_ci_output, dependency):
|
165
|
+
"""get up-to-date supported version"""
|
166
|
+
pattern = r" ([^\s]+)"
|
167
|
+
|
168
|
+
last_supported_version = re.search(dependency + pattern, tekton_ci_output, flags=re.I | re.M)
|
169
|
+
|
170
|
+
return last_supported_version[1]
|
171
|
+
|
172
|
+
|
173
|
+
def isUptodate(last_supported_version, latest_version):
|
174
|
+
if last_supported_version == latest_version:
|
175
|
+
up_to_date = "Yes"
|
176
|
+
else:
|
177
|
+
up_to_date = "No"
|
178
|
+
|
179
|
+
return up_to_date
|
180
|
+
|
181
|
+
def main():
|
182
|
+
# Read the JSON file
|
183
|
+
with open(JSON_FILE) as file:
|
184
|
+
data = load(file)
|
185
|
+
|
186
|
+
tekton_ci_output = get_tekton_ci_output()
|
187
|
+
|
188
|
+
items = data["table"]
|
189
|
+
|
190
|
+
for item in items:
|
191
|
+
package = item["Package name"]
|
192
|
+
package = package.lower().replace("::", "-")
|
193
|
+
|
194
|
+
latest_version = get_upstream_version(package)
|
195
|
+
|
196
|
+
if not package in ["rails lts", "rails-api"]:
|
197
|
+
last_supported_version = get_last_supported_version(tekton_ci_output, package)
|
198
|
+
else:
|
199
|
+
last_supported_version = latest_version
|
200
|
+
|
201
|
+
up_to_date = isUptodate(last_supported_version, latest_version)
|
202
|
+
|
203
|
+
item.update(
|
204
|
+
{
|
205
|
+
"Last Supported Version": last_supported_version,
|
206
|
+
"Latest version": latest_version,
|
207
|
+
"Up-to-date": up_to_date,
|
208
|
+
},
|
209
|
+
)
|
210
|
+
|
211
|
+
# Create a DataFrame from the list of dictionaries
|
212
|
+
df = DataFrame(items)
|
213
|
+
df.insert(len(df.columns) - 1, "Cloud Native", df.pop("Cloud Native"))
|
214
|
+
|
215
|
+
# Convert dataframe to markdown
|
216
|
+
markdown_table = df.to_markdown(index=False)
|
217
|
+
|
218
|
+
disclaimer = "##### This page is auto-generated. Any change will be overwritten after the next sync. Please apply changes directly to the files in the [ruby tracer](https://github.com/instana/ruby-sensor) repo."
|
219
|
+
title = "## Ruby supported packages and versions"
|
220
|
+
|
221
|
+
# Combine disclaimer, title, and markdown table with line breaks
|
222
|
+
final_markdown = disclaimer + "\n" + title + "\n" + markdown_table
|
223
|
+
|
224
|
+
with open(REPORT_FILE, "w") as file:
|
225
|
+
file.write(final_markdown)
|
226
|
+
|
227
|
+
if __name__ == "__main__":
|
228
|
+
main()
|
@@ -21,6 +21,8 @@ spec:
|
|
21
21
|
# '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'
|
22
22
|
name: ruby-tracer-pr-$(tt.params.git-branch-normalized)-$(tt.params.git-commit-short-sha)
|
23
23
|
spec:
|
24
|
+
timeouts:
|
25
|
+
pipeline: "2h"
|
24
26
|
params:
|
25
27
|
- name: revision
|
26
28
|
value: $(tt.params.git-branch)
|
data/.tekton/pipeline.yaml
CHANGED
@@ -25,19 +25,49 @@ spec:
|
|
25
25
|
params:
|
26
26
|
- name: imageDigest
|
27
27
|
value:
|
28
|
-
# 3.3.
|
29
|
-
- "sha256:
|
28
|
+
# 3.3.1-bookworm
|
29
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
30
30
|
- name: gemfile
|
31
31
|
value:
|
32
32
|
- "gemfiles/rubocop_162.gemfile"
|
33
|
+
- name: configuration
|
34
|
+
value:
|
35
|
+
- "lint"
|
36
|
+
taskRef:
|
37
|
+
name: ruby-tracer-unittest-default-libraries-task
|
38
|
+
workspaces:
|
39
|
+
- name: task-pvc
|
40
|
+
workspace: ruby-tracer-ci-pipeline-pvc
|
41
|
+
- name: core
|
42
|
+
runAfter:
|
43
|
+
- clone
|
44
|
+
matrix:
|
45
|
+
params:
|
46
|
+
- name: imageDigest
|
47
|
+
value:
|
48
|
+
# 3.0.6-bullseye
|
49
|
+
- "sha256:3166618469ad8a3190d80f43b322818fafb4bfac0b4882255eee3346af2a0a35"
|
50
|
+
# 3.1.4-bookworm
|
51
|
+
- "sha256:ec69284bcbceb0a23ffc070ef2e0e8eb0fe495c20efbd51846b103338c3da1e4"
|
52
|
+
# 3.2.3-bookworm
|
53
|
+
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
54
|
+
# 3.3.1-bookworm
|
55
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
56
|
+
- name: gemfile
|
57
|
+
value:
|
58
|
+
- "./Gemfile"
|
59
|
+
- name: configuration
|
60
|
+
value:
|
61
|
+
- "core"
|
33
62
|
taskRef:
|
34
|
-
name: ruby-tracer-
|
63
|
+
name: ruby-tracer-unittest-default-libraries-task
|
35
64
|
workspaces:
|
36
65
|
- name: task-pvc
|
37
66
|
workspace: ruby-tracer-ci-pipeline-pvc
|
38
67
|
- name: unittest-default-ruby-30
|
39
68
|
runAfter:
|
40
69
|
- lint
|
70
|
+
- core
|
41
71
|
matrix:
|
42
72
|
params:
|
43
73
|
- name: imageDigest
|
@@ -65,6 +95,9 @@ spec:
|
|
65
95
|
- "./gemfiles/sinatra_40.gemfile"
|
66
96
|
- "./gemfiles/shoryuken_50.gemfile"
|
67
97
|
- "./gemfiles/shoryuken_60.gemfile"
|
98
|
+
- name: configuration
|
99
|
+
value:
|
100
|
+
- "libraries"
|
68
101
|
taskRef:
|
69
102
|
name: ruby-tracer-unittest-default-libraries-task
|
70
103
|
workspaces:
|
@@ -100,6 +133,9 @@ spec:
|
|
100
133
|
- "./gemfiles/sinatra_40.gemfile"
|
101
134
|
- "./gemfiles/shoryuken_50.gemfile"
|
102
135
|
- "./gemfiles/shoryuken_60.gemfile"
|
136
|
+
- name: configuration
|
137
|
+
value:
|
138
|
+
- "libraries"
|
103
139
|
taskRef:
|
104
140
|
name: ruby-tracer-unittest-default-libraries-task
|
105
141
|
workspaces:
|
@@ -135,6 +171,9 @@ spec:
|
|
135
171
|
- "./gemfiles/sinatra_40.gemfile"
|
136
172
|
- "./gemfiles/shoryuken_50.gemfile"
|
137
173
|
- "./gemfiles/shoryuken_60.gemfile"
|
174
|
+
- name: configuration
|
175
|
+
value:
|
176
|
+
- "libraries"
|
138
177
|
taskRef:
|
139
178
|
name: ruby-tracer-unittest-default-libraries-task
|
140
179
|
workspaces:
|
@@ -147,8 +186,8 @@ spec:
|
|
147
186
|
params:
|
148
187
|
- name: imageDigest
|
149
188
|
value:
|
150
|
-
# 3.3.
|
151
|
-
- "sha256:
|
189
|
+
# 3.3.1-bookworm
|
190
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
152
191
|
- name: gemfile
|
153
192
|
value:
|
154
193
|
- "./gemfiles/cuba_30.gemfile"
|
@@ -170,6 +209,9 @@ spec:
|
|
170
209
|
- "./gemfiles/sinatra_40.gemfile"
|
171
210
|
- "./gemfiles/shoryuken_50.gemfile"
|
172
211
|
- "./gemfiles/shoryuken_60.gemfile"
|
212
|
+
- name: configuration
|
213
|
+
value:
|
214
|
+
- "libraries"
|
173
215
|
taskRef:
|
174
216
|
name: ruby-tracer-unittest-default-libraries-task
|
175
217
|
workspaces:
|
@@ -188,8 +230,8 @@ spec:
|
|
188
230
|
- "sha256:ec69284bcbceb0a23ffc070ef2e0e8eb0fe495c20efbd51846b103338c3da1e4"
|
189
231
|
# 3.2.3-bookworm
|
190
232
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
191
|
-
# 3.3.
|
192
|
-
- "sha256:
|
233
|
+
# 3.3.1-bookworm
|
234
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
193
235
|
- name: gemfile
|
194
236
|
value:
|
195
237
|
- "./gemfiles/mongo_216.gemfile"
|
@@ -212,8 +254,8 @@ spec:
|
|
212
254
|
- "sha256:ec69284bcbceb0a23ffc070ef2e0e8eb0fe495c20efbd51846b103338c3da1e4"
|
213
255
|
# 3.2.3-bookworm
|
214
256
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
215
|
-
# 3.3.
|
216
|
-
- "sha256:
|
257
|
+
# 3.3.1-bookworm
|
258
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
217
259
|
- name: gemfile
|
218
260
|
value:
|
219
261
|
- "./gemfiles/dalli_20.gemfile"
|
@@ -237,8 +279,8 @@ spec:
|
|
237
279
|
- "sha256:ec69284bcbceb0a23ffc070ef2e0e8eb0fe495c20efbd51846b103338c3da1e4"
|
238
280
|
# 3.2.3-bookworm
|
239
281
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
240
|
-
# 3.3.
|
241
|
-
- "sha256:
|
282
|
+
# 3.3.1-bookworm
|
283
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
242
284
|
- name: gemfile
|
243
285
|
value:
|
244
286
|
- "./gemfiles/aws_30.gemfile"
|
@@ -285,8 +327,8 @@ spec:
|
|
285
327
|
value:
|
286
328
|
# 3.2.3-bookworm
|
287
329
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
288
|
-
# 3.3.
|
289
|
-
- "sha256:
|
330
|
+
# 3.3.1-bookworm
|
331
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
290
332
|
- name: gemfile
|
291
333
|
value:
|
292
334
|
- "./gemfiles/redis_40.gemfile"
|
@@ -317,8 +359,8 @@ spec:
|
|
317
359
|
- "sha256:ec69284bcbceb0a23ffc070ef2e0e8eb0fe495c20efbd51846b103338c3da1e4"
|
318
360
|
# 3.2.3-bookworm
|
319
361
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
320
|
-
# 3.3.
|
321
|
-
- "sha256:
|
362
|
+
# 3.3.1-bookworm
|
363
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
322
364
|
- name: gemfile
|
323
365
|
value:
|
324
366
|
- "./gemfiles/rails_61.gemfile"
|
@@ -342,8 +384,8 @@ spec:
|
|
342
384
|
- "sha256:ec69284bcbceb0a23ffc070ef2e0e8eb0fe495c20efbd51846b103338c3da1e4"
|
343
385
|
# 3.2.3-bookworm
|
344
386
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
345
|
-
# 3.3.
|
346
|
-
- "sha256:
|
387
|
+
# 3.3.1-bookworm
|
388
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
347
389
|
- name: gemfile
|
348
390
|
value:
|
349
391
|
- "./gemfiles/rails_61.gemfile"
|
@@ -367,8 +409,8 @@ spec:
|
|
367
409
|
- "sha256:ec69284bcbceb0a23ffc070ef2e0e8eb0fe495c20efbd51846b103338c3da1e4"
|
368
410
|
# 3.2.3-bookworm
|
369
411
|
- "sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed"
|
370
|
-
# 3.3.
|
371
|
-
- "sha256:
|
412
|
+
# 3.3.1-bookworm
|
413
|
+
- "sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d"
|
372
414
|
- name: gemfile
|
373
415
|
value:
|
374
416
|
- "./gemfiles/rails_61.gemfile"
|
data/.tekton/pipelinerun.yaml
CHANGED
@@ -0,0 +1,83 @@
|
|
1
|
+
apiVersion: apps/v1
|
2
|
+
kind: DaemonSet
|
3
|
+
metadata:
|
4
|
+
name: ruby-tracer-prepuller
|
5
|
+
spec:
|
6
|
+
selector:
|
7
|
+
matchLabels:
|
8
|
+
name: ruby-tracer-prepuller
|
9
|
+
template:
|
10
|
+
metadata:
|
11
|
+
labels:
|
12
|
+
name: ruby-tracer-prepuller
|
13
|
+
spec:
|
14
|
+
# Configure an init container for each image you want to pull
|
15
|
+
initContainers:
|
16
|
+
- name: prepuller-git
|
17
|
+
# alpine/git:2.43.0
|
18
|
+
image: alpine/git@sha256:6ff4de047dcc8f0c7d75d2efff63fbc189e87d2f458305f2cc8f165ff83309cf
|
19
|
+
command: ["sh", "-c", "'true'"]
|
20
|
+
- name: prepuller-dynamodb
|
21
|
+
# amazon/dynamodb-local:2.3.0
|
22
|
+
image: amazon/dynamodb-local@sha256:0e42a967205042118277be031a59f7aa035c2f90b1695b1b3250d0ce03a7c8f0
|
23
|
+
command: ["sh", "-c", "'true'"]
|
24
|
+
- name: prepuller-s3
|
25
|
+
# minio/minio:RELEASE.2024-03-07T00-43-48Z
|
26
|
+
image: minio/minio@sha256:9224601c529f424e5efac79f95606f0c7e1fe234f3f45344a49deaccd66d5bf5
|
27
|
+
command: ["sh", "-c", "'true'"]
|
28
|
+
- name: prepuller-sns
|
29
|
+
# s12v/sns:latest
|
30
|
+
image: s12v/sns@sha256:a80f1cd6318d22419cab38650ee6824f72cc2dc902d2b38e4f997d0530fe4e07
|
31
|
+
command: ["sh", "-c", "'true'"]
|
32
|
+
- name: prepuller-sqs
|
33
|
+
# softwaremill/elasticmq-native:1.5.7
|
34
|
+
image: softwaremill/elasticmq-native@sha256:9183333a9ea4666686c37dc83a2b1f8cee9c15ffd161a219a131e171039f1ac3
|
35
|
+
command: ["sh", "-c", "'true'"]
|
36
|
+
- name: prepuller-memcached
|
37
|
+
# memcached:1.6.24-bookworm
|
38
|
+
image: memcached@sha256:b2b562323463b6cda240a148fb2a5b7ea86e8017a8509e10a3c7f1681f259193
|
39
|
+
command: ["sh", "-c", "'true'"]
|
40
|
+
- name: prepuller-redis
|
41
|
+
# redis:7.2.4-bookworm
|
42
|
+
image: redis@sha256:fe98b2d39d462d06a7360e2860dd6ceff930745e3731eccb3c1406dd0dd7f744
|
43
|
+
command: ["sh", "-c", "'true'"]
|
44
|
+
- name: prepuller-mongo
|
45
|
+
# mongo:5.0.25-focal
|
46
|
+
image: mongo@sha256:d1b8a7b77424347397653ab8ff500c66b1e9979b4cebf826951d37b0d3966721
|
47
|
+
command: ["sh", "-c", "'true'"]
|
48
|
+
- name: prepuller-mariadb
|
49
|
+
# mariadb:11.3.2
|
50
|
+
image: mariadb@sha256:851f05fe1e4cb290442c1b12b7108436a33fd8f6a733d4989950322d06d45c65
|
51
|
+
command: ["sh", "-c", "'true'"]
|
52
|
+
- name: prepuller-postgres
|
53
|
+
# postgres:16.2-bookworm
|
54
|
+
image: postgres@sha256:6b841c8f6a819884207402f1209a8116844365df15fca8cf556fc54a24c70800
|
55
|
+
command: ["sh", "-c", "'true'"]
|
56
|
+
- name: prepuller-30
|
57
|
+
# 3.0.6-bullseye
|
58
|
+
image: ruby@sha256:3166618469ad8a3190d80f43b322818fafb4bfac0b4882255eee3346af2a0a35
|
59
|
+
command: ["sh", "-c", "'true'"]
|
60
|
+
- name: prepuller-31
|
61
|
+
# 3.1.4-bookworm
|
62
|
+
image: ruby@sha256:ec69284bcbceb0a23ffc070ef2e0e8eb0fe495c20efbd51846b103338c3da1e4
|
63
|
+
command: ["sh", "-c", "'true'"]
|
64
|
+
- name: prepuller-32
|
65
|
+
# 3.2.3-bookworm
|
66
|
+
image: ruby@sha256:007d2edd515f9cfc8c5c571486aca4fc4a25c903d004decee302961bb8c636ed
|
67
|
+
command: ["sh", "-c", "'true'"]
|
68
|
+
- name: prepuller-33
|
69
|
+
# 3.3.1-bookworm
|
70
|
+
image: ruby@sha256:5cf0004738f54bd67e4c4316394208ca38a6726eda7a1b0586d95601aad86e5d
|
71
|
+
command: ["sh", "-c", "'true'"]
|
72
|
+
# Use the pause container to ensure the Pod goes into a `Running` phase
|
73
|
+
# but doesn't take up resource on the cluster
|
74
|
+
containers:
|
75
|
+
- name: pause
|
76
|
+
image: gcr.io/google_containers/pause:3.2
|
77
|
+
resources:
|
78
|
+
limits:
|
79
|
+
cpu: 1m
|
80
|
+
memory: 8Mi
|
81
|
+
requests:
|
82
|
+
cpu: 1m
|
83
|
+
memory: 8Mi
|
@@ -19,6 +19,8 @@ spec:
|
|
19
19
|
# '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'
|
20
20
|
name: ruby-tracer-scheduled-ci-pipeline-$(tt.params.date-time-normalized)-$(tt.params.git-commit-short-sha)
|
21
21
|
spec:
|
22
|
+
timeouts:
|
23
|
+
pipeline: "2h"
|
22
24
|
params:
|
23
25
|
- name: revision
|
24
26
|
value: master
|
data/.tekton/task.yaml
CHANGED
@@ -273,30 +273,7 @@ spec:
|
|
273
273
|
params:
|
274
274
|
- name: imageDigest
|
275
275
|
type: string
|
276
|
-
- name:
|
277
|
-
type: string
|
278
|
-
workspaces:
|
279
|
-
- name: task-pvc
|
280
|
-
mountPath: /workspace
|
281
|
-
steps:
|
282
|
-
- name: unittest
|
283
|
-
image: ruby@$(params.imageDigest)
|
284
|
-
env:
|
285
|
-
- name: TEST_CONFIGURATION
|
286
|
-
value: libraries
|
287
|
-
- name: BUNDLE_GEMFILE
|
288
|
-
value: $(params.gemfile)
|
289
|
-
workingDir: /workspace/ruby-sensor/
|
290
|
-
command:
|
291
|
-
- /workspace/ruby-sensor/.tekton/run_unittests.sh
|
292
|
-
---
|
293
|
-
apiVersion: tekton.dev/v1
|
294
|
-
kind: Task
|
295
|
-
metadata:
|
296
|
-
name: ruby-tracer-lint-task
|
297
|
-
spec:
|
298
|
-
params:
|
299
|
-
- name: imageDigest
|
276
|
+
- name: configuration
|
300
277
|
type: string
|
301
278
|
- name: gemfile
|
302
279
|
type: string
|
@@ -304,11 +281,11 @@ spec:
|
|
304
281
|
- name: task-pvc
|
305
282
|
mountPath: /workspace
|
306
283
|
steps:
|
307
|
-
- name:
|
284
|
+
- name: unittest
|
308
285
|
image: ruby@$(params.imageDigest)
|
309
286
|
env:
|
310
287
|
- name: TEST_CONFIGURATION
|
311
|
-
value:
|
288
|
+
value: $(params.configuration)
|
312
289
|
- name: BUNDLE_GEMFILE
|
313
290
|
value: $(params.gemfile)
|
314
291
|
workingDir: /workspace/ruby-sensor/
|
@@ -12,8 +12,11 @@ module Instana
|
|
12
12
|
require 'instana/instrumentation/action_view'
|
13
13
|
|
14
14
|
::ActionView::PartialRenderer
|
15
|
-
.prepend(Instana::Instrumentation::ActionView)
|
16
|
-
|
15
|
+
.prepend(Instana::Instrumentation::ActionView::PartialRenderer)
|
16
|
+
if defined?(::ActionView::CollectionRenderer)
|
17
|
+
::ActionView::CollectionRenderer
|
18
|
+
.prepend(Instrumentation::ActionView::CollectionRenderer)
|
19
|
+
end
|
17
20
|
true
|
18
21
|
end
|
19
22
|
end
|
@@ -8,8 +8,10 @@ require 'json'
|
|
8
8
|
# :nocov:
|
9
9
|
begin
|
10
10
|
require 'oj'
|
11
|
+
INSTANA_USE_OJ = true
|
11
12
|
rescue LoadError => _e
|
12
13
|
Instana.logger.warn("Unable to load Oj.")
|
14
|
+
INSTANA_USE_OJ = false
|
13
15
|
end
|
14
16
|
# :nocov:
|
15
17
|
|
@@ -66,7 +68,7 @@ module Instana
|
|
66
68
|
|
67
69
|
def encode_body(data)
|
68
70
|
# :nocov:
|
69
|
-
|
71
|
+
INSTANA_USE_OJ ? Oj.dump(data, mode: :strict) : JSON.dump(data)
|
70
72
|
# :nocov:
|
71
73
|
end
|
72
74
|
end
|
@@ -4,26 +4,52 @@
|
|
4
4
|
module Instana
|
5
5
|
module Instrumentation
|
6
6
|
module ActionView
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
module PartialRenderer
|
8
|
+
def render_partial(*args)
|
9
|
+
call_payload = {
|
10
|
+
render: {
|
11
|
+
type: :partial,
|
12
|
+
name: @options.is_a?(Hash) ? @options[:partial].to_s : 'Unknown'
|
13
|
+
}
|
12
14
|
}
|
13
|
-
}
|
14
15
|
|
15
|
-
|
16
|
+
::Instana::Tracer.trace(:render, call_payload) { super(*args) }
|
17
|
+
end
|
18
|
+
|
19
|
+
def render_collection(*args)
|
20
|
+
call_payload = {
|
21
|
+
render: {
|
22
|
+
type: :collection,
|
23
|
+
name: @path.to_s
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
::Instana::Tracer.trace(:render, call_payload) { super(*args) }
|
28
|
+
end
|
29
|
+
|
30
|
+
def render_partial_template(*args)
|
31
|
+
call_payload = {
|
32
|
+
render: {
|
33
|
+
type: :partial,
|
34
|
+
name: @options.is_a?(Hash) ? @options[:partial].to_s : 'Unknown'
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
::Instana::Tracer.trace(:render, call_payload) { super(*args) }
|
39
|
+
end
|
16
40
|
end
|
17
41
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
42
|
+
module CollectionRenderer
|
43
|
+
def render_collection(*args)
|
44
|
+
call_payload = {
|
45
|
+
render: {
|
46
|
+
type: :collection,
|
47
|
+
name: @options.is_a?(Hash) ? @options[:partial].to_s : 'Unknown'
|
48
|
+
}
|
23
49
|
}
|
24
|
-
}
|
25
50
|
|
26
|
-
|
51
|
+
::Instana::Tracer.trace(:render, call_payload) { super(*args) }
|
52
|
+
end
|
27
53
|
end
|
28
54
|
end
|
29
55
|
end
|
data/lib/instana/version.rb
CHANGED
@@ -6,15 +6,27 @@ require 'test_helper'
|
|
6
6
|
class HostAgentTest < Minitest::Test
|
7
7
|
def test_spawn_background_thread
|
8
8
|
ENV['INSTANA_TEST'] = nil
|
9
|
-
|
9
|
+
agent_host = '10.10.10.10'
|
10
|
+
::Instana.config[:agent_host] = agent_host
|
10
11
|
|
11
|
-
if File.exist?('/
|
12
|
-
|
12
|
+
if File.exist?('/proc/net/route')
|
13
|
+
default_gateway_hex = lambda {
|
14
|
+
File.open('/proc/net/route', 'r') do |file|
|
15
|
+
file.each_line do |line|
|
16
|
+
columns = line.split("\t")
|
17
|
+
if columns[1] == '00000000' && columns[1] == columns[7]
|
18
|
+
return columns[2]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
}.call
|
23
|
+
|
24
|
+
addr = default_gateway_hex.scan(/.{2}/).map(&:hex).reverse.join('.')
|
13
25
|
stub_request(:get, "http://#{addr}:42699/")
|
14
26
|
.to_timeout
|
15
27
|
end
|
16
28
|
|
17
|
-
stub_request(:get, "http
|
29
|
+
stub_request(:get, "http://#{agent_host}:42699/")
|
18
30
|
.to_timeout.times(3).then
|
19
31
|
.to_return(status: 200, body: "", headers: {})
|
20
32
|
|
@@ -183,8 +183,8 @@ class NetHTTPTest < Minitest::Test
|
|
183
183
|
|
184
184
|
assert_equal :sdk, sdk_span[:n]
|
185
185
|
assert_equal :'net-http-error-test', sdk_span[:data][:sdk][:name]
|
186
|
-
|
187
|
-
|
186
|
+
assert_nil sdk_span[:error]
|
187
|
+
assert_nil sdk_span[:ec]
|
188
188
|
|
189
189
|
refute_nil http_span.key?(:data)
|
190
190
|
refute_nil http_span[:data].key?(:http)
|
@@ -17,18 +17,6 @@ class RailsActionViewTest < Minitest::Test
|
|
17
17
|
|
18
18
|
def setup
|
19
19
|
clear_all!
|
20
|
-
@framework_version = Gem::Specification.find_by_name('rails').version
|
21
|
-
@supported_framework_version = @framework_version < Gem::Version.new('6.1')
|
22
|
-
@execute_test_if_framework_version_is_supported = lambda {
|
23
|
-
unless @supported_framework_version
|
24
|
-
skip "Skipping this test because Rails version #{@framework_version} is not yet supported!"
|
25
|
-
end
|
26
|
-
}
|
27
|
-
@execute_test_only_if_framework_version_is_not_supported = lambda {
|
28
|
-
if @supported_framework_version
|
29
|
-
skip "Skipping this test because Rails version #{@framework_version} is already supported!"
|
30
|
-
end
|
31
|
-
}
|
32
20
|
end
|
33
21
|
|
34
22
|
def test_config_defaults
|
@@ -37,25 +25,7 @@ class RailsActionViewTest < Minitest::Test
|
|
37
25
|
assert_equal true, ::Instana.config[:action_view][:enabled]
|
38
26
|
end
|
39
27
|
|
40
|
-
def test_no_tracing_if_unsupported_version_only_render_is_ok
|
41
|
-
@execute_test_only_if_framework_version_is_not_supported.call
|
42
|
-
|
43
|
-
['/render_view', '/render_view_direct', '/render_partial', '/render_collection', '/render_file',
|
44
|
-
'/render_alternate_layout', '/render_json', '/render_xml',
|
45
|
-
'/render_rawbody', '/render_js'].each do |endpoint|
|
46
|
-
get endpoint
|
47
|
-
assert last_response.ok?
|
48
|
-
end
|
49
|
-
|
50
|
-
get '/render_partial_that_errors'
|
51
|
-
assert_equal false, last_response.ok?
|
52
|
-
|
53
|
-
spans = ::Instana.processor.queued_spans
|
54
|
-
assert_equal [], spans
|
55
|
-
end
|
56
|
-
|
57
28
|
def test_render_view
|
58
|
-
@execute_test_if_framework_version_is_supported.call
|
59
29
|
get '/render_view'
|
60
30
|
assert last_response.ok?
|
61
31
|
|
@@ -66,7 +36,6 @@ class RailsActionViewTest < Minitest::Test
|
|
66
36
|
end
|
67
37
|
|
68
38
|
def test_render_view_direct
|
69
|
-
@execute_test_if_framework_version_is_supported.call
|
70
39
|
get '/render_view_direct'
|
71
40
|
assert last_response.ok?
|
72
41
|
|
@@ -89,7 +58,6 @@ class RailsActionViewTest < Minitest::Test
|
|
89
58
|
end
|
90
59
|
|
91
60
|
def test_render_file
|
92
|
-
@execute_test_if_framework_version_is_supported.call
|
93
61
|
get '/render_file'
|
94
62
|
assert last_response.ok?
|
95
63
|
|
@@ -100,7 +68,6 @@ class RailsActionViewTest < Minitest::Test
|
|
100
68
|
end
|
101
69
|
|
102
70
|
def test_render_json
|
103
|
-
@execute_test_if_framework_version_is_supported.call
|
104
71
|
get '/render_json'
|
105
72
|
assert last_response.ok?
|
106
73
|
|
@@ -111,7 +78,6 @@ class RailsActionViewTest < Minitest::Test
|
|
111
78
|
end
|
112
79
|
|
113
80
|
def test_render_xml
|
114
|
-
@execute_test_if_framework_version_is_supported.call
|
115
81
|
get '/render_xml'
|
116
82
|
assert last_response.ok?
|
117
83
|
|
@@ -122,7 +88,6 @@ class RailsActionViewTest < Minitest::Test
|
|
122
88
|
end
|
123
89
|
|
124
90
|
def test_render_body
|
125
|
-
@execute_test_if_framework_version_is_supported.call
|
126
91
|
get '/render_rawbody'
|
127
92
|
assert last_response.ok?
|
128
93
|
|
@@ -133,7 +98,6 @@ class RailsActionViewTest < Minitest::Test
|
|
133
98
|
end
|
134
99
|
|
135
100
|
def test_render_js
|
136
|
-
@execute_test_if_framework_version_is_supported.call
|
137
101
|
get '/render_js'
|
138
102
|
assert last_response.ok?
|
139
103
|
|
@@ -144,7 +108,6 @@ class RailsActionViewTest < Minitest::Test
|
|
144
108
|
end
|
145
109
|
|
146
110
|
def test_render_alternate_layout
|
147
|
-
@execute_test_if_framework_version_is_supported.call
|
148
111
|
get '/render_alternate_layout'
|
149
112
|
assert last_response.ok?
|
150
113
|
|
@@ -155,7 +118,6 @@ class RailsActionViewTest < Minitest::Test
|
|
155
118
|
end
|
156
119
|
|
157
120
|
def test_render_partial
|
158
|
-
@execute_test_if_framework_version_is_supported.call
|
159
121
|
get '/render_partial'
|
160
122
|
assert last_response.ok?
|
161
123
|
|
@@ -166,7 +128,6 @@ class RailsActionViewTest < Minitest::Test
|
|
166
128
|
end
|
167
129
|
|
168
130
|
def test_render_partial_that_errors
|
169
|
-
@execute_test_if_framework_version_is_supported.call
|
170
131
|
get '/render_partial_that_errors'
|
171
132
|
refute last_response.ok?
|
172
133
|
|
@@ -182,13 +143,11 @@ class RailsActionViewTest < Minitest::Test
|
|
182
143
|
end
|
183
144
|
|
184
145
|
def test_render_collection
|
185
|
-
@execute_test_if_framework_version_is_supported.call
|
186
146
|
get '/render_collection'
|
187
147
|
assert last_response.ok?
|
188
148
|
|
189
149
|
spans = ::Instana.processor.queued_spans
|
190
150
|
span = find_first_span_by_name(spans, :render)
|
191
|
-
|
192
151
|
assert_equal :collection, span[:data][:render][:type]
|
193
152
|
assert_equal 'blocks/block', span[:data][:render][:name]
|
194
153
|
end
|
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.214.
|
4
|
+
version: 1.214.4
|
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: 2024-
|
11
|
+
date: 2024-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -142,6 +142,15 @@ files:
|
|
142
142
|
- ".gitignore"
|
143
143
|
- ".rubocop.yml"
|
144
144
|
- ".rubocop_todo.yml"
|
145
|
+
- ".tekton/.currency/currency-pipeline.yaml"
|
146
|
+
- ".tekton/.currency/currency-pipelinerun.yaml"
|
147
|
+
- ".tekton/.currency/currency-rbac.yaml"
|
148
|
+
- ".tekton/.currency/currency-scheduled-eventlistener.yaml"
|
149
|
+
- ".tekton/.currency/currency-tasks.yaml"
|
150
|
+
- ".tekton/.currency/docs/report.md"
|
151
|
+
- ".tekton/.currency/resources/requirements.txt"
|
152
|
+
- ".tekton/.currency/resources/table.json"
|
153
|
+
- ".tekton/.currency/scripts/generate_report.py"
|
145
154
|
- ".tekton/github-interceptor-secret.yaml"
|
146
155
|
- ".tekton/github-pr-eventlistener.yaml"
|
147
156
|
- ".tekton/github-pr-pipeline.yaml.part"
|
@@ -149,6 +158,7 @@ files:
|
|
149
158
|
- ".tekton/github-webhook-ingress.yaml"
|
150
159
|
- ".tekton/pipeline.yaml"
|
151
160
|
- ".tekton/pipelinerun.yaml"
|
161
|
+
- ".tekton/ruby-tracer-prepuller.yaml"
|
152
162
|
- ".tekton/run_unittests.sh"
|
153
163
|
- ".tekton/scheduled-eventlistener.yaml"
|
154
164
|
- ".tekton/task.yaml"
|
@@ -418,7 +428,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
418
428
|
- !ruby/object:Gem::Version
|
419
429
|
version: '0'
|
420
430
|
requirements: []
|
421
|
-
rubygems_version: 3.
|
431
|
+
rubygems_version: 3.5.9
|
422
432
|
signing_key:
|
423
433
|
specification_version: 4
|
424
434
|
summary: Ruby Distributed Tracing & Metrics Sensor for Instana
|