instana 1.214.1 → 1.214.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef0f66b536659d6dbfe42cc74441f7c18e599901cfbb9bbc90ba9a4bcf711cdc
4
- data.tar.gz: 98b92de5fb14e66c75168e1c6c4a8420447498921dccf690ddb7d70a4754c2b5
3
+ metadata.gz: 3e1392f093e37988f8cb349c73f1314d81b4058f896c244382328e636a18bd83
4
+ data.tar.gz: 307c18d065c6618c544e6b3bc2f622c184cafdb8c98096e375b84a0018bd6c6b
5
5
  SHA512:
6
- metadata.gz: 81b5f89a9ae1cb841c094270eb536f03a6b93da23c8cd82defc796f220db797d462860baf7e8c21fb8832a1bce573f257ea08c13a30603c51e3f0507d559d7b2
7
- data.tar.gz: e08833db6248c228c51d8f03dffacca72936137b21b862cd79419fa17ae498c2303c78e1bea74fe6cfe61ff7b134d7aa60b34248ac0a4c4894c14912523bc825
6
+ metadata.gz: 1d895f1cc6dc321277f366a11040e6626c31e08b4486e662bdf407ea20e91d7c1927b04f7441a942e7392254a7d491c41c788bd0344109dee524514d31c3a074
7
+ data.tar.gz: 52f4e79e404d0ec0efe6f091f57cd09a9cfc8418d229a55324e5cf4e96a381b75a976a352b79c0659f03a805d5aab519df9b8c6a0b9d7e9ec7e99014601896fd
@@ -0,0 +1,8 @@
1
+ apiVersion: v1
2
+ kind: Secret
3
+ metadata:
4
+ name: github-interceptor-secret
5
+ type: Opaque
6
+ stringData:
7
+ # Always use a long, strong and random generated token
8
+ secretToken: "<--- TOKEN GOES HERE --->"
@@ -0,0 +1,102 @@
1
+ apiVersion: triggers.tekton.dev/v1beta1
2
+ kind: TriggerTemplate
3
+ metadata:
4
+ name: github-pr-ruby-tracer-pipeline-template
5
+ spec:
6
+ params:
7
+ - description: The git branch name
8
+ name: git-branch
9
+ - description: The git branch name shortened and converted to RFC 1123 subdomain names
10
+ name: git-branch-normalized
11
+ - description: The full sha of the git commit
12
+ name: git-commit-sha
13
+ - description: The short 7 digit sha of the git commit
14
+ name: git-commit-short-sha
15
+ resourcetemplates:
16
+ - apiVersion: tekton.dev/v1
17
+ kind: PipelineRun
18
+ metadata:
19
+ # After variable resolution, this has to be maximum 63 character long,
20
+ # lower case, RFC 1123 subdomain name. The regex used for validation is
21
+ # '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'
22
+ name: ruby-tracer-pr-$(tt.params.git-branch-normalized)-$(tt.params.git-commit-short-sha)
23
+ spec:
24
+ params:
25
+ - name: revision
26
+ value: $(tt.params.git-branch)
27
+ - name: git-commit-sha
28
+ value: $(tt.params.git-commit-sha)
29
+ pipelineRef:
30
+ name: github-pr-ruby-tracer-ci-pipeline
31
+ workspaces:
32
+ - name: ruby-tracer-ci-pipeline-pvc
33
+ volumeClaimTemplate:
34
+ spec:
35
+ accessModes:
36
+ - ReadWriteOnce
37
+ resources:
38
+ requests:
39
+ storage: 100Mi
40
+ ---
41
+ apiVersion: triggers.tekton.dev/v1beta1
42
+ kind: TriggerBinding
43
+ metadata:
44
+ name: github-pr-ruby-tracer-binding
45
+ spec:
46
+ params:
47
+ - name: git-branch
48
+ value: $(body.pull_request.head.ref)
49
+ - name: git-branch-normalized
50
+ value: $(extensions.git_branch_normalized)
51
+ - name: git-commit-sha
52
+ value: $(body.pull_request.head.sha)
53
+ - name: git-commit-short-sha
54
+ value: $(extensions.truncated_sha)
55
+ ---
56
+ apiVersion: triggers.tekton.dev/v1beta1
57
+ kind: EventListener
58
+ metadata:
59
+ name: github-pr-ruby-eventlistener
60
+ spec:
61
+ serviceAccountName: tekton-triggers-eventlistener-serviceaccount
62
+ triggers:
63
+ - name: github-pr-trigger
64
+ interceptors:
65
+ - name: receive-github-event
66
+ ref:
67
+ name: "github"
68
+ params:
69
+ - name: "secretRef"
70
+ value:
71
+ secretName: github-interceptor-secret
72
+ secretKey: secretToken
73
+ - name: "eventTypes"
74
+ value: ["pull_request"]
75
+ - name: filter-irrelevant-events
76
+ ref:
77
+ name: "cel"
78
+ params:
79
+ - name: "filter"
80
+ # We should not trigger on 'closed', 'assigned', 'unassigned', 'converted_to_draft'
81
+ value: "body.action in ['opened', 'synchronize', 'reopened']"
82
+ - name: add-truncated-sha
83
+ ref:
84
+ name: "cel"
85
+ params:
86
+ - name: "overlays"
87
+ value:
88
+ - key: truncated_sha
89
+ expression: "body.pull_request.head.sha.truncate(7)"
90
+ - name: add-normalized-branch-name
91
+ ref:
92
+ name: "cel"
93
+ params:
94
+ - name: "overlays"
95
+ value:
96
+ - key: git_branch_normalized
97
+ # The git branch name shortened and converted to RFC 1123 subdomain names
98
+ expression: 'body.pull_request.head.ref.truncate(38).lowerAscii().translate("_", "-")'
99
+ bindings:
100
+ - ref: github-pr-ruby-tracer-binding
101
+ template:
102
+ ref: github-pr-ruby-tracer-pipeline-template
@@ -0,0 +1,38 @@
1
+ apiVersion: tekton.dev/v1
2
+ kind: Pipeline
3
+ metadata:
4
+ name: github-pr-ruby-tracer-ci-pipeline
5
+ spec:
6
+ params:
7
+ - name: revision
8
+ type: string
9
+ - name: git-commit-sha
10
+ type: string
11
+ workspaces:
12
+ - name: ruby-tracer-ci-pipeline-pvc
13
+ tasks:
14
+ - name: github-set-check-status-to-pending
15
+ taskRef:
16
+ kind: Task
17
+ name: github-set-status
18
+ params:
19
+ - name: SHA
20
+ value: $(params.git-commit-sha)
21
+ - name: STATE
22
+ value: pending
23
+ - name: REPO
24
+ value: instana/ruby-sensor
25
+ - name: github-set-check-status-to-success-or-failure
26
+ runAfter:
27
+ - github-set-check-status-to-pending
28
+ - unittest-rails-postgres
29
+ taskRef:
30
+ kind: Task
31
+ name: github-set-status
32
+ params:
33
+ - name: SHA
34
+ value: $(params.git-commit-sha)
35
+ - name: STATE
36
+ value: success
37
+ - name: REPO
38
+ value: instana/ruby-sensor
@@ -0,0 +1,43 @@
1
+ ---
2
+ apiVersion: tekton.dev/v1
3
+ kind: Task
4
+ metadata:
5
+ name: github-set-status
6
+ spec:
7
+ params:
8
+ - name: SHA
9
+ - name: STATE
10
+ - name: REPO
11
+ volumes:
12
+ - name: githubtoken
13
+ secret:
14
+ secretName: githubtoken
15
+ steps:
16
+ - name: set-status
17
+ # curlimages/curl:8.6.0
18
+ image: curlimages/curl@sha256:f2237028bed58de91f62aea74260bb2a299cf12fbcabc23cfaf125fef276c884
19
+ env:
20
+ - name: SHA
21
+ value: $(params.SHA)
22
+ - name: STATE
23
+ value: $(params.STATE)
24
+ - name: REPO
25
+ value: $(params.REPO)
26
+ volumeMounts:
27
+ - name: githubtoken
28
+ mountPath: /etc/github-set-status
29
+ script: |
30
+ #!/bin/sh
31
+ curl -L \
32
+ -X POST \
33
+ -H "Accept: application/vnd.github+json" \
34
+ -H "Authorization: Bearer $(cat /etc/github-set-status/token)" \
35
+ -H "Content-Type: application/json" \
36
+ -H "X-GitHub-Api-Version: 2022-11-28" \
37
+ "https://api.github.com/repos/${REPO}/statuses/${SHA}" \
38
+ -d '{
39
+ "state":"'${STATE}'",
40
+ "target_url":"http://localhost:8001/api/v1/namespaces/tekton-pipelines/services/tekton-dashboard:http/proxy/#/namespaces/default/pipelineruns/",
41
+ "description":"Tekton build is in state: '${STATE}'",
42
+ "context":"Tekton"
43
+ }'
@@ -0,0 +1,20 @@
1
+ apiVersion: networking.k8s.io/v1
2
+ kind: Ingress
3
+ metadata:
4
+ name: github-pr-ruby-webhook-ingress
5
+ spec:
6
+ ingressClassName: public-iks-k8s-nginx
7
+ tls:
8
+ - hosts:
9
+ - <ENTER_YOUR_DOMAIN_NAME_HERE>
10
+ rules:
11
+ - host: <ENTER_YOUR_DOMAIN_NAME_HERE>
12
+ http:
13
+ paths:
14
+ - path: /github-pr-ruby-hooks
15
+ pathType: Exact
16
+ backend:
17
+ service:
18
+ name: el-github-pr-ruby-eventlistener
19
+ port:
20
+ number: 8080
@@ -0,0 +1,108 @@
1
+ apiVersion: triggers.tekton.dev/v1beta1
2
+ kind: TriggerTemplate
3
+ metadata:
4
+ name: ruby-tracer-scheduled-ci-pipeline-template
5
+ spec:
6
+ params:
7
+ - description: The ISO-8601 date and time converted to RFC 1123 subdomain names
8
+ name: date-time-normalized
9
+ - description: The full sha of the git commit
10
+ name: git-commit-sha
11
+ - description: The short 7 digit sha of the git commit
12
+ name: git-commit-short-sha
13
+ resourcetemplates:
14
+ - apiVersion: tekton.dev/v1
15
+ kind: PipelineRun
16
+ metadata:
17
+ # After variable resolution, this has to be maximum 63 character long,
18
+ # lower case, RFC 1123 subdomain name. The regex used for validation is
19
+ # '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'
20
+ name: ruby-tracer-scheduled-ci-pipeline-$(tt.params.date-time-normalized)-$(tt.params.git-commit-short-sha)
21
+ spec:
22
+ params:
23
+ - name: revision
24
+ value: master
25
+ - name: git-commit-sha
26
+ value: $(tt.params.git-commit-sha)
27
+ pipelineRef:
28
+ name: github-pr-ruby-tracer-ci-pipeline
29
+ workspaces:
30
+ - name: ruby-tracer-ci-pipeline-pvc
31
+ volumeClaimTemplate:
32
+ spec:
33
+ accessModes:
34
+ - ReadWriteOnce
35
+ resources:
36
+ requests:
37
+ storage: 100Mi
38
+ ---
39
+ apiVersion: triggers.tekton.dev/v1beta1
40
+ kind: TriggerBinding
41
+ metadata:
42
+ name: ruby-tracer-scheduled-binding
43
+ spec:
44
+ params:
45
+ - name: date-time-normalized
46
+ value: $(extensions.normalized_date_time)
47
+ - name: git-commit-sha
48
+ value: $(body.git_master_head_commit_sha)
49
+ - name: git-commit-short-sha
50
+ value: $(extensions.truncated_sha)
51
+ ---
52
+ apiVersion: batch/v1
53
+ kind: CronJob
54
+ metadata:
55
+ name: ruby-tracer-scheduled-ci-cronjob
56
+ spec:
57
+ schedule: "5 1 * * Mon-Fri"
58
+ jobTemplate:
59
+ spec:
60
+ template:
61
+ spec:
62
+ containers:
63
+ - name: git
64
+ # alpine/git:2.43.0
65
+ image: alpine/git@sha256:6ff4de047dcc8f0c7d75d2efff63fbc189e87d2f458305f2cc8f165ff83309cf
66
+ command:
67
+ - sh
68
+ - -c
69
+ - |
70
+ wget -O- \
71
+ --header 'Content-Type: application/json' \
72
+ --post-data '{
73
+ "git_master_head_commit_sha":"'"$(git ls-remote https://github.com/instana/ruby-sensor master | cut -f1)"'",
74
+ "date_time":"'"$(date -u -Iminutes )"'"
75
+ }' \
76
+ 'http://el-ruby-tracer-scheduled-pipeline-listener.default.svc.cluster.local:8080'
77
+ restartPolicy: OnFailure
78
+ ---
79
+ apiVersion: triggers.tekton.dev/v1beta1
80
+ kind: EventListener
81
+ metadata:
82
+ name: ruby-tracer-scheduled-pipeline-listener
83
+ spec:
84
+ serviceAccountName: tekton-triggers-eventlistener-serviceaccount
85
+ triggers:
86
+ - name: ruby-tracer-scheduled-pipeline-triggger
87
+ interceptors:
88
+ - name: add-truncated-sha
89
+ ref:
90
+ name: "cel"
91
+ params:
92
+ - name: "overlays"
93
+ value:
94
+ - key: truncated_sha
95
+ expression: "body.git_master_head_commit_sha.truncate(7)"
96
+ - name: add-normalized-date-time
97
+ ref:
98
+ name: "cel"
99
+ params:
100
+ - name: "overlays"
101
+ value:
102
+ - key: normalized_date_time
103
+ # The date-time converted to RFC 1123 subdomain names
104
+ expression: 'body.date_time.split("+")[0].lowerAscii().translate(":", "-")'
105
+ bindings:
106
+ - ref: ruby-tracer-scheduled-binding
107
+ template:
108
+ ref: ruby-tracer-scheduled-ci-pipeline-template
@@ -0,0 +1,29 @@
1
+ apiVersion: v1
2
+ kind: ServiceAccount
3
+ metadata:
4
+ name: tekton-triggers-eventlistener-serviceaccount
5
+ ---
6
+ apiVersion: rbac.authorization.k8s.io/v1
7
+ kind: RoleBinding
8
+ metadata:
9
+ name: tekton-triggers-eventlistener-serviceaccount-binding
10
+ subjects:
11
+ - kind: ServiceAccount
12
+ name: tekton-triggers-eventlistener-serviceaccount
13
+ roleRef:
14
+ apiGroup: rbac.authorization.k8s.io
15
+ kind: ClusterRole
16
+ name: tekton-triggers-eventlistener-roles
17
+ ---
18
+ apiVersion: rbac.authorization.k8s.io/v1
19
+ kind: ClusterRoleBinding
20
+ metadata:
21
+ name: tekton-triggers-eventlistener-serviceaccount-clusterbinding
22
+ subjects:
23
+ - kind: ServiceAccount
24
+ name: tekton-triggers-eventlistener-serviceaccount
25
+ namespace: default
26
+ roleRef:
27
+ apiGroup: rbac.authorization.k8s.io
28
+ kind: ClusterRole
29
+ name: tekton-triggers-eventlistener-clusterroles
@@ -11,6 +11,7 @@ gem "webrick"
11
11
  gem "puma"
12
12
  gem "rack-test"
13
13
  gem "simplecov", "~> 0.21.2"
14
+ gem "aws-sdk-core", "= 3.191.6"
14
15
  gem "aws-sdk-dynamodb", ">= 1.59", "< 1.99"
15
16
  gem "aws-sdk-s3", ">= 1.59", "< 1.60"
16
17
  gem "aws-sdk-sns", ">= 1.38", "< 1.59"
@@ -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
- defined?(Oj) ? Oj.dump(data, mode: :strict) : JSON.dump(data)
71
+ INSTANA_USE_OJ ? Oj.dump(data, mode: :strict) : JSON.dump(data)
70
72
  # :nocov:
71
73
  end
72
74
  end
@@ -10,30 +10,27 @@ module Instana
10
10
  :multi => ::RedisClient.instance_method(:multi)
11
11
  }.freeze
12
12
 
13
- def call_v(*args, &block)
13
+ def call_v(*args, **kwargs, &block)
14
14
  if skip_instrumentation?
15
- super(*args, &block)
15
+ super(*args, **kwargs, &block)
16
16
  else
17
- call_with_instana(args[0][0].to_s.upcase, ORIGINAL_METHODS[:call_v], *args, &block)
17
+ call_with_instana(args[0][0].to_s.upcase, ORIGINAL_METHODS[:call_v], args, kwargs, &block)
18
18
  end
19
19
  end
20
20
 
21
- def pipelined(*args, &block)
21
+ def pipelined(*args, **kwargs, &block)
22
22
  if skip_instrumentation?
23
- super(*args, &block)
23
+ super(*args, **kwargs, &block)
24
24
  else
25
- call_with_instana('PIPELINE', ORIGINAL_METHODS[:pipelined], *args, &block)
25
+ call_with_instana('PIPELINE', ORIGINAL_METHODS[:pipelined], args, kwargs, &block)
26
26
  end
27
27
  end
28
28
 
29
- # Since, starting with 5.1 redis/client.rb:114:multi takes an unused default argument `watch: nil`
30
- # but calls redis_client.rb:442:multi, which doesn't take any argument,
31
- # here we have to take arguments but we should not use it.
32
- def multi(*_, &block)
29
+ def multi(*args, **kwargs, &block)
33
30
  if skip_instrumentation?
34
- super(&block)
31
+ super(*args, **kwargs, &block)
35
32
  else
36
- call_with_instana('MULTI', ORIGINAL_METHODS[:multi], &block)
33
+ call_with_instana('MULTI', ORIGINAL_METHODS[:multi], args, kwargs, &block)
37
34
  end
38
35
  end
39
36
 
@@ -43,19 +40,19 @@ module Instana
43
40
  :call_pipeline => ::Redis::Client.instance_method(:call_pipeline)
44
41
  }.freeze
45
42
 
46
- def call(*args, &block)
43
+ def call(*args, **kwargs, &block)
47
44
  if skip_instrumentation?
48
- super(*args, &block)
45
+ super(*args, **kwargs, &block)
49
46
  else
50
- call_with_instana(args[0][0].to_s.upcase, ORIGINAL_METHODS[:call], *args, &block)
47
+ call_with_instana(args[0][0].to_s.upcase, ORIGINAL_METHODS[:call], args, kwargs, &block)
51
48
  end
52
49
  end
53
50
 
54
- def call_pipeline(*args, &block)
51
+ def call_pipeline(*args, **kwargs, &block)
55
52
  if skip_instrumentation?
56
- super(*args, &block)
53
+ super(*args, **kwargs, &block)
57
54
  else
58
- call_with_instana(args.first.is_a?(::Redis::Pipeline::Multi) ? 'MULTI' : 'PIPELINE', ORIGINAL_METHODS[:call_pipeline], *args, &block)
55
+ call_with_instana(args.first.is_a?(::Redis::Pipeline::Multi) ? 'MULTI' : 'PIPELINE', ORIGINAL_METHODS[:call_pipeline], args, kwargs, &block)
59
56
  end
60
57
  end
61
58
  end
@@ -65,8 +62,7 @@ module Instana
65
62
  !Instana.tracer.tracing? || dnt_spans.include?(::Instana.tracer.current_span.name) || !Instana.config[:redis][:enabled]
66
63
  end
67
64
 
68
- def call_with_instana(*args, &block)
69
- command, original_super, *original_args = *args
65
+ def call_with_instana(command, original_super, args, kwargs, &block)
70
66
  kv_payload = { redis: {} }
71
67
 
72
68
  begin
@@ -79,7 +75,7 @@ module Instana
79
75
  rescue
80
76
  nil
81
77
  end
82
- original_super.bind(self).call(*original_args, &block)
78
+ original_super.bind(self).call(*args, **kwargs, &block)
83
79
  rescue => e
84
80
  ::Instana.tracer.log_info({ redis: {error: true} })
85
81
  ::Instana.tracer.log_error(e)
@@ -2,6 +2,6 @@
2
2
  # (c) Copyright Instana Inc. 2016
3
3
 
4
4
  module Instana
5
- VERSION = "1.214.1"
5
+ VERSION = "1.214.3"
6
6
  VERSION_FULL = "instana-#{VERSION}"
7
7
  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.1
4
+ version: 1.214.3
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-04-08 00:00:00.000000000 Z
11
+ date: 2024-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -142,10 +142,17 @@ files:
142
142
  - ".gitignore"
143
143
  - ".rubocop.yml"
144
144
  - ".rubocop_todo.yml"
145
+ - ".tekton/github-interceptor-secret.yaml"
146
+ - ".tekton/github-pr-eventlistener.yaml"
147
+ - ".tekton/github-pr-pipeline.yaml.part"
148
+ - ".tekton/github-set-status-task.yaml"
149
+ - ".tekton/github-webhook-ingress.yaml"
145
150
  - ".tekton/pipeline.yaml"
146
151
  - ".tekton/pipelinerun.yaml"
147
152
  - ".tekton/run_unittests.sh"
153
+ - ".tekton/scheduled-eventlistener.yaml"
148
154
  - ".tekton/task.yaml"
155
+ - ".tekton/tekton-triggers-eventlistener-serviceaccount.yaml"
149
156
  - Appraisals
150
157
  - CONTRIBUTING.md
151
158
  - Gemfile
@@ -411,7 +418,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
411
418
  - !ruby/object:Gem::Version
412
419
  version: '0'
413
420
  requirements: []
414
- rubygems_version: 3.4.19
421
+ rubygems_version: 3.5.9
415
422
  signing_key:
416
423
  specification_version: 4
417
424
  summary: Ruby Distributed Tracing & Metrics Sensor for Instana