instana 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/lib/instana/setup.rb +1 -0
  3. data/lib/instana/span_filtering/condition.rb +134 -0
  4. data/lib/instana/span_filtering/configuration.rb +262 -0
  5. data/lib/instana/span_filtering/filter_rule.rb +31 -0
  6. data/lib/instana/span_filtering.rb +62 -0
  7. data/lib/instana/trace/span.rb +5 -3
  8. data/lib/instana/version.rb +1 -1
  9. metadata +7 -258
  10. data/.circleci/config.yml +0 -361
  11. data/.codeclimate.yml +0 -23
  12. data/.editorconfig +0 -10
  13. data/.fasterer.yml +0 -23
  14. data/.github/ISSUE_TEMPLATE/bug.yml +0 -39
  15. data/.github/ISSUE_TEMPLATE/config.yml +0 -8
  16. data/.github/workflows/pr_commits_signed_off.yml +0 -16
  17. data/.github/workflows/release-notification-on-slack.yml +0 -34
  18. data/.gitignore +0 -19
  19. data/.rubocop.yml +0 -34
  20. data/.rubocop_todo.yml +0 -1140
  21. data/.tekton/.currency/docs/report.md +0 -20
  22. data/.tekton/.currency/resources/requirements.txt +0 -4
  23. data/.tekton/.currency/resources/table.json +0 -100
  24. data/.tekton/.currency/scripts/generate_report.py +0 -308
  25. data/.tekton/README.md +0 -278
  26. data/.tekton/github-interceptor-secret.yaml +0 -8
  27. data/.tekton/github-pr-eventlistener.yaml +0 -104
  28. data/.tekton/github-pr-pipeline.yaml.part +0 -38
  29. data/.tekton/github-set-status-task.yaml +0 -43
  30. data/.tekton/github-webhook-ingress.yaml +0 -20
  31. data/.tekton/pipeline.yaml +0 -484
  32. data/.tekton/pipelinerun.yaml +0 -21
  33. data/.tekton/prepuller-restart-service-account.yaml +0 -31
  34. data/.tekton/ruby-tracer-prepuller-cronjob.yaml +0 -20
  35. data/.tekton/ruby-tracer-prepuller.yaml +0 -88
  36. data/.tekton/run_unittests.sh +0 -87
  37. data/.tekton/scheduled-eventlistener.yaml +0 -108
  38. data/.tekton/task.yaml +0 -453
  39. data/.tekton/tekton-triggers-eventlistener-serviceaccount.yaml +0 -29
  40. data/Appraisals +0 -124
  41. data/CONTRIBUTING.md +0 -86
  42. data/Gemfile +0 -22
  43. data/LICENSE +0 -22
  44. data/MAINTAINERS.md +0 -3
  45. data/Rakefile +0 -49
  46. data/bin/announce_release_on_slack.py +0 -103
  47. data/docker-compose.yml +0 -20
  48. data/download.sh +0 -85
  49. data/examples/otel.rb +0 -98
  50. data/examples/tracing.rb +0 -85
  51. data/extras/license_header.rb +0 -44
  52. data/gemfiles/.bundle/config +0 -2
  53. data/gemfiles/aws_30.gemfile +0 -21
  54. data/gemfiles/aws_60.gemfile +0 -16
  55. data/gemfiles/cuba_30.gemfile +0 -16
  56. data/gemfiles/cuba_40.gemfile +0 -13
  57. data/gemfiles/dalli_20.gemfile +0 -15
  58. data/gemfiles/dalli_30.gemfile +0 -12
  59. data/gemfiles/dalli_32.gemfile +0 -12
  60. data/gemfiles/excon_0100.gemfile +0 -14
  61. data/gemfiles/excon_021.gemfile +0 -17
  62. data/gemfiles/excon_079.gemfile +0 -17
  63. data/gemfiles/excon_100.gemfile +0 -14
  64. data/gemfiles/graphql_10.gemfile +0 -16
  65. data/gemfiles/graphql_20.gemfile +0 -15
  66. data/gemfiles/grpc_10.gemfile +0 -15
  67. data/gemfiles/mongo_216.gemfile +0 -15
  68. data/gemfiles/mongo_219.gemfile +0 -12
  69. data/gemfiles/net_http_01.gemfile +0 -17
  70. data/gemfiles/rack_16.gemfile +0 -15
  71. data/gemfiles/rack_20.gemfile +0 -15
  72. data/gemfiles/rack_30.gemfile +0 -13
  73. data/gemfiles/rails_42.gemfile +0 -18
  74. data/gemfiles/rails_50.gemfile +0 -19
  75. data/gemfiles/rails_52.gemfile +0 -19
  76. data/gemfiles/rails_60.gemfile +0 -19
  77. data/gemfiles/rails_61.gemfile +0 -21
  78. data/gemfiles/rails_70.gemfile +0 -18
  79. data/gemfiles/rails_71.gemfile +0 -17
  80. data/gemfiles/rails_80.gemfile +0 -17
  81. data/gemfiles/redis_40.gemfile +0 -15
  82. data/gemfiles/redis_50.gemfile +0 -13
  83. data/gemfiles/redis_51.gemfile +0 -13
  84. data/gemfiles/resque_122.gemfile +0 -16
  85. data/gemfiles/resque_1274_3scale.gemfile +0 -17
  86. data/gemfiles/resque_20.gemfile +0 -16
  87. data/gemfiles/rest_client_16.gemfile +0 -17
  88. data/gemfiles/rest_client_20.gemfile +0 -17
  89. data/gemfiles/roda_20.gemfile +0 -16
  90. data/gemfiles/roda_30.gemfile +0 -16
  91. data/gemfiles/rubocop_162.gemfile +0 -6
  92. data/gemfiles/sequel_56.gemfile +0 -16
  93. data/gemfiles/sequel_57.gemfile +0 -16
  94. data/gemfiles/sequel_58.gemfile +0 -16
  95. data/gemfiles/shoryuken_50.gemfile +0 -16
  96. data/gemfiles/shoryuken_60.gemfile +0 -13
  97. data/gemfiles/sidekiq_42.gemfile +0 -15
  98. data/gemfiles/sidekiq_50.gemfile +0 -15
  99. data/gemfiles/sidekiq_60.gemfile +0 -12
  100. data/gemfiles/sidekiq_65.gemfile +0 -12
  101. data/gemfiles/sidekiq_70.gemfile +0 -12
  102. data/gemfiles/sinatra_14.gemfile +0 -15
  103. data/gemfiles/sinatra_22.gemfile +0 -12
  104. data/gemfiles/sinatra_30.gemfile +0 -12
  105. data/gemfiles/sinatra_40.gemfile +0 -12
  106. data/instana.gemspec +0 -53
  107. data/log/.keep +0 -0
  108. data/sonar-project.properties +0 -9
  109. data/test/activator_test.rb +0 -50
  110. data/test/backend/agent_test.rb +0 -80
  111. data/test/backend/gc_snapshot_test.rb +0 -11
  112. data/test/backend/host_agent_activation_observer_test.rb +0 -73
  113. data/test/backend/host_agent_lookup_test.rb +0 -78
  114. data/test/backend/host_agent_reporting_observer_test.rb +0 -276
  115. data/test/backend/host_agent_test.rb +0 -89
  116. data/test/backend/process_info_test.rb +0 -83
  117. data/test/backend/request_client_test.rb +0 -39
  118. data/test/backend/serverless_agent_test.rb +0 -83
  119. data/test/benchmarks/bench_id_generation.rb +0 -15
  120. data/test/benchmarks/bench_opentracing.rb +0 -16
  121. data/test/config_test.rb +0 -34
  122. data/test/frameworks/cuba_test.rb +0 -61
  123. data/test/frameworks/roda_test.rb +0 -60
  124. data/test/frameworks/sinatra_test.rb +0 -71
  125. data/test/instana_test.rb +0 -37
  126. data/test/instrumentation/aws_test.rb +0 -241
  127. data/test/instrumentation/dalli_test.rb +0 -325
  128. data/test/instrumentation/excon_test.rb +0 -204
  129. data/test/instrumentation/graphql_test.rb +0 -289
  130. data/test/instrumentation/grpc_test.rb +0 -420
  131. data/test/instrumentation/mongo_test.rb +0 -68
  132. data/test/instrumentation/net_http_test.rb +0 -220
  133. data/test/instrumentation/rack_instrumented_request_test.rb +0 -211
  134. data/test/instrumentation/rack_test.rb +0 -415
  135. data/test/instrumentation/rails_action_cable_test.rb +0 -135
  136. data/test/instrumentation/rails_action_controller_test.rb +0 -218
  137. data/test/instrumentation/rails_action_mailer_test.rb +0 -66
  138. data/test/instrumentation/rails_action_view_test.rb +0 -154
  139. data/test/instrumentation/rails_active_job_test.rb +0 -65
  140. data/test/instrumentation/rails_active_record_database_missing_test.rb +0 -44
  141. data/test/instrumentation/rails_active_record_test.rb +0 -116
  142. data/test/instrumentation/redis_test.rb +0 -152
  143. data/test/instrumentation/resque_test.rb +0 -188
  144. data/test/instrumentation/rest_client_test.rb +0 -106
  145. data/test/instrumentation/sequel_test.rb +0 -111
  146. data/test/instrumentation/shoryuken_test.rb +0 -47
  147. data/test/instrumentation/sidekiq-client_test.rb +0 -169
  148. data/test/instrumentation/sidekiq-worker_test.rb +0 -180
  149. data/test/secrets_test.rb +0 -112
  150. data/test/serverless_test.rb +0 -369
  151. data/test/snapshot/deltable_test.rb +0 -17
  152. data/test/snapshot/docker_container_test.rb +0 -82
  153. data/test/snapshot/fargate_container_test.rb +0 -82
  154. data/test/snapshot/fargate_process_test.rb +0 -35
  155. data/test/snapshot/fargate_task_test.rb +0 -49
  156. data/test/snapshot/google_cloud_run_instance_test.rb +0 -74
  157. data/test/snapshot/google_cloud_run_process_test.rb +0 -33
  158. data/test/snapshot/lambda_function_test.rb +0 -37
  159. data/test/snapshot/ruby_process_test.rb +0 -32
  160. data/test/support/apps/active_record/active_record.rb +0 -24
  161. data/test/support/apps/grpc/boot.rb +0 -23
  162. data/test/support/apps/grpc/grpc_server.rb +0 -84
  163. data/test/support/apps/http_endpoint/boot.rb +0 -28
  164. data/test/support/apps/rails/boot.rb +0 -219
  165. data/test/support/apps/rails/models/block.rb +0 -21
  166. data/test/support/apps/rails/models/block6.rb +0 -21
  167. data/test/support/apps/resque/boot.rb +0 -5
  168. data/test/support/apps/resque/jobs/resque_error_job.rb +0 -22
  169. data/test/support/apps/resque/jobs/resque_fast_job.rb +0 -23
  170. data/test/support/apps/sidekiq/boot.rb +0 -25
  171. data/test/support/apps/sidekiq/jobs/sidekiq_job_1.rb +0 -9
  172. data/test/support/apps/sidekiq/jobs/sidekiq_job_2.rb +0 -10
  173. data/test/support/apps/sidekiq/worker.rb +0 -37
  174. data/test/support/helpers.rb +0 -85
  175. data/test/support/mock_timer.rb +0 -20
  176. data/test/test_helper.rb +0 -69
  177. data/test/trace/custom_test.rb +0 -233
  178. data/test/trace/id_management_test.rb +0 -78
  179. data/test/trace/instrumented_logger_test.rb +0 -39
  180. data/test/trace/processor_test.rb +0 -58
  181. data/test/trace/span_context_test.rb +0 -22
  182. data/test/trace/span_test.rb +0 -179
  183. data/test/trace/tracer_async_test.rb +0 -243
  184. data/test/trace/tracer_provider_test.rb +0 -148
  185. data/test/trace/tracer_test.rb +0 -363
  186. data/test/util_test.rb +0 -10
data/Appraisals DELETED
@@ -1,124 +0,0 @@
1
- # (c) Copyright IBM Corp. 2021
2
- # (c) Copyright Instana Inc. 2021
3
-
4
- appraise 'aws-30' do
5
- gem 'aws-sdk-dynamodb', '~> 1.59'
6
- gem 'aws-sdk-s3', '~> 1.59'
7
- gem 'aws-sdk-sns', '~> 1.38'
8
- gem 'aws-sdk-sqs', '~> 1.36'
9
- gem 'aws-sdk-lambda', '~> 1.62'
10
- end
11
-
12
- appraise 'cuba-30' do
13
- gem 'cuba', '>= 3.0', '< 4.0'
14
- end
15
-
16
- appraise 'dalli-20' do
17
- gem 'dalli', '>= 2.0', '< 3.0'
18
- end
19
-
20
- appraise 'excon-021' do
21
- gem 'excon', '>= 0.21.0', '< 1.0'
22
- end
23
-
24
- appraise 'excon-079' do
25
- gem 'excon', '>= 0.79.0', '< 1.0'
26
- end
27
-
28
- appraise 'grpc-10' do
29
- gem 'grpc', '>= 1.0', '< 2.0'
30
- end
31
-
32
- appraise 'graphql-10' do
33
- gem 'graphql', '>= 1.0', '< 2.0'
34
- end
35
-
36
- appraise 'rack-16' do
37
- gem 'rack', '~> 1.6'
38
- end
39
-
40
- appraise 'rack-20' do
41
- gem 'rack', '>= 2.0', '< 3.0'
42
- end
43
-
44
- appraise 'rails-42' do
45
- gem 'rails', '>= 4.2', '< 5.0'
46
- gem 'mysql2', '0.4.10'
47
- gem 'pg', '~> 0.21'
48
- gem 'sqlite3', '~> 1.3', '< 1.4'
49
- end
50
-
51
- appraise 'rails-50' do
52
- gem 'rails', '>= 5.0', '< 5.1'
53
- gem 'mysql2', '0.4.10'
54
- gem 'pg'
55
- gem 'sqlite3', '~> 1.3', '< 1.4'
56
- end
57
-
58
- appraise 'rails-52' do
59
- gem 'rails', '>= 5.2', '< 6.0'
60
- gem 'mysql2', '0.4.10'
61
- gem 'pg'
62
- gem 'sqlite3', '~> 1.3', '< 1.4'
63
- end
64
-
65
- appraise 'rails-60' do
66
- gem 'rails', '>= 6.0', '< 6.1'
67
- gem 'mysql2', '0.4.10'
68
- gem 'pg'
69
- gem 'sqlite3', '~> 1.4'
70
- end
71
-
72
- appraise 'redis-40' do
73
- gem 'redis', '>= 4.0.0', '< 5.0'
74
- end
75
-
76
- appraise 'rest-client-16' do
77
- gem 'rest-client', '>= 1.6', '< 2.0'
78
- end
79
-
80
- appraise 'rest-client-20' do
81
- gem 'rest-client', '>= 2.0', '< 3.0'
82
- end
83
-
84
- appraise 'resque-122' do
85
- gem 'resque', '>= 1.22', '< 2.0'
86
- gem 'redis', '~> 3.3', '>= 3.3.5'
87
- end
88
-
89
- appraise 'resque-20' do
90
- gem 'resque', '>= 2.0', '< 3.0'
91
- end
92
-
93
- appraise 'roda-20' do
94
- gem 'roda', '>= 2.0', '< 3.0'
95
- end
96
-
97
- appraise 'roda-30' do
98
- gem 'roda', '>= 3.0', '< 4.0'
99
- end
100
-
101
- appraise 'net-http-01' do
102
- # gem 'net-http', '~> 0.1.1'
103
- end
104
-
105
- appraise 'sinatra-14' do
106
- gem 'sinatra', '1.4.7'
107
- end
108
-
109
- appraise 'shoryuken-50' do
110
- gem 'shoryuken', '~> 5.2'
111
- gem 'aws-sdk-sqs', '~> 1.36'
112
- end
113
-
114
- appraise 'sidekiq-42' do
115
- gem 'sidekiq', '~> 4.2.10'
116
- end
117
-
118
- appraise 'sidekiq-50' do
119
- gem 'sidekiq', '>= 5.0', '< 6.0'
120
- end
121
-
122
- appraise 'mongo-216' do
123
- gem 'mongo', '>= 2.16', '< 3'
124
- end
data/CONTRIBUTING.md DELETED
@@ -1,86 +0,0 @@
1
- ## Contributing In General
2
- Our project welcomes external contributions. If you have an itch, please feel
3
- free to scratch it.
4
-
5
- To contribute code or documentation, please submit a [pull request](https://github.com/instana/ruby-sensor/pulls).
6
-
7
- A good way to familiarize yourself with the codebase and contribution process is
8
- to look for and tackle low-hanging fruit in the [issue tracker](https://github.com/instana/ruby-sensor/issues).
9
- <!--Before embarking on a more ambitious contribution, please quickly [get in touch](#communication) with us.-->
10
-
11
- **Note: We appreciate your effort, and want to avoid a situation where a contribution
12
- requires extensive rework (by you or by us), sits in backlog for a long time, or
13
- cannot be accepted at all!**
14
-
15
- ### Proposing new features
16
-
17
- If you would like to implement a new feature, please [raise an issue](https://github.com/instana/ruby-sensor/issues)
18
- before sending a pull request so the feature can be discussed. This is to avoid
19
- you wasting your valuable time working on a feature that the project developers
20
- are not interested in accepting into the code base.
21
-
22
- ### Fixing bugs
23
-
24
- If you would like to fix a bug, please [raise an issue](https://github.com/instana/ruby-sensor/issues) before sending a
25
- pull request so it can be tracked.
26
-
27
- ### Merge approval
28
-
29
- The project maintainers use LGTM (Looks Good To Me) in comments on the code
30
- review to indicate acceptance. A change requires LGTMs from two of the
31
- maintainers of each component affected.
32
-
33
- For a list of the maintainers, see the [MAINTAINERS.md](MAINTAINERS.md) page.
34
-
35
- ## Legal
36
-
37
- Each source file must include a license header for the MIT
38
- License. Using the SPDX format is the simplest approach.
39
- e.g.
40
-
41
- ```
42
- /*
43
- Copyright <holder> All Rights Reserved.
44
-
45
- SPDX-License-Identifier: MIT
46
- */
47
- ```
48
-
49
- We have tried to make it as easy as possible to make contributions. This
50
- applies to how we handle the legal aspects of contribution. We use the
51
- same approach - the [Developer's Certificate of Origin 1.1 (DCO)](https://github.com/hyperledger/fabric/blob/master/docs/source/DCO1.1.txt) - that the Linux® Kernel [community](https://elinux.org/Developer_Certificate_Of_Origin)
52
- uses to manage code contributions.
53
-
54
- We simply ask that when submitting a patch for review, the developer
55
- must include a sign-off statement in the commit message.
56
-
57
- Here is an example Signed-off-by line, which indicates that the
58
- submitter accepts the DCO:
59
-
60
- ```
61
- Signed-off-by: John Doe <john.doe@example.com>
62
- ```
63
-
64
- You can include this automatically when you commit a change to your
65
- local git repository using the following command:
66
-
67
- ```
68
- git commit -s
69
- ```
70
-
71
- <!--
72
- ## Communication
73
- **FIXME** Please feel free to connect with us on our [Slack channel](link).
74
-
75
- ## Setup
76
- **FIXME** Please add any special setup instructions for your project to help the developer
77
- become productive quickly.
78
-
79
- ## Testing
80
- **FIXME** Please provide information that helps the developer test any changes they make
81
- before submitting.
82
-
83
- ## Coding style guidelines
84
- **FIXME** Optional, but recommended: please share any specific style guidelines you might
85
- have for your project.
86
- -->
data/Gemfile DELETED
@@ -1,22 +0,0 @@
1
- # (c) Copyright IBM Corp. 2021
2
- # (c) Copyright Instana Inc. 2016
3
-
4
- source 'https://rubygems.org'
5
-
6
- gem 'minitest-reporters'
7
- gem 'webmock'
8
- gem 'puma'
9
-
10
- gem 'rack'
11
- gem 'rackup'
12
- gem 'rack-test'
13
-
14
- gem 'simplecov', '~> 0.21.2'
15
-
16
- # instana.gemspec
17
- gemspec
18
-
19
- gem "opentelemetry-api", "~> 1.4"
20
-
21
- gem "rubocop", "~> 1.71"
22
- gem "opentelemetry-common", "~> 0.22.0"
data/LICENSE DELETED
@@ -1,22 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) Copyright IBM Corp. 2021
4
- Copyright (c) 2017 Instana, Inc. https://www.instana.com/
5
-
6
- Permission is hereby granted, free of charge, to any person obtaining a copy
7
- of this software and associated documentation files (the "Software"), to deal
8
- in the Software without restriction, including without limitation the rights
9
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the Software is
11
- furnished to do so, subject to the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be included in all
14
- copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- SOFTWARE.
data/MAINTAINERS.md DELETED
@@ -1,3 +0,0 @@
1
- # MAINTAINERS
2
-
3
- [instana/eng-ruby](https://github.com/orgs/instana/teams/eng-ruby) can be reached with @instana/eng-ruby
data/Rakefile DELETED
@@ -1,49 +0,0 @@
1
- # (c) Copyright IBM Corp. 2021
2
- # (c) Copyright Instana Inc. 2016
3
-
4
- require 'bundler/gem_tasks'
5
- require 'rake/testtask'
6
-
7
- require 'json'
8
-
9
- Rake::TestTask.new(:test) do |t|
10
- t.verbose = false
11
- t.warning = false
12
- t.ruby_opts = ["--parser=parse.y"] if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('3.3')
13
-
14
- t.libs << "test"
15
- t.libs << "lib"
16
-
17
- if ENV['APPRAISAL_INITIALIZED']
18
- appraised_group = File.basename(ENV['BUNDLE_GEMFILE']).split(/_[0-9]+\./).first
19
- suite_files = Dir['test/{instrumentation,frameworks}/*_test.rb']
20
-
21
- t.test_files = suite_files.select { |f| File.basename(f).start_with?(appraised_group) }
22
- else
23
- t.test_files = Dir[
24
- 'test/*_test.rb',
25
- 'test/{agent,trace,backend,snapshot}/*_test.rb'
26
- ]
27
- end
28
- end
29
-
30
- namespace :coverage do
31
- task :merge_reports do
32
- require 'simplecov'
33
- require 'simplecov_json_formatter'
34
-
35
- SimpleCov.start do
36
- enable_coverage :branch
37
- SimpleCov.collate Dir["partial_coverage_results/.resultset-*.json"] do
38
- formatter SimpleCov::Formatter::MultiFormatter.new(
39
- [
40
- SimpleCov::Formatter::SimpleFormatter,
41
- SimpleCov::Formatter::JSONFormatter
42
- ]
43
- )
44
- end
45
- end
46
- end
47
- end
48
-
49
- task :default => :test
@@ -1,103 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- # (c) Copyright IBM Corp. 2023
4
-
5
- import json
6
- import logging
7
- import os
8
- import re
9
- import requests
10
- import sys
11
-
12
- from github import Github
13
-
14
-
15
- def ensure_environment_variables_are_present():
16
- required_env_vars = ('GITHUB_RELEASE_TAG', 'GITHUB_TOKEN',
17
- 'SLACK_BOT_TOKEN', 'SLACK_CHANNEL_ID_RELEASES')
18
-
19
- for v in required_env_vars:
20
- if not os.environ.get(v):
21
- logging.fatal("A required environment variable is missing: %s", v)
22
- sys.exit(1)
23
-
24
-
25
- def get_gh_release_info_text_with_token(release_tag, access_token):
26
- g = Github(access_token)
27
- repo_name = "instana/ruby-sensor"
28
- repo = g.get_repo(repo_name)
29
- release = repo.get_release(release_tag)
30
-
31
- logging.info("GH Release fetched successfully %s", release)
32
-
33
- msg = (
34
- f":mega: :package: A new version is released in {repo_name}\n"
35
- f"Name: {release.title}\n"
36
- f"Tag: {release.tag_name}\n"
37
- f"Created at: {release.created_at}\n"
38
- f"Published at: {release.published_at}\n"
39
- f"{release.body}\n")
40
-
41
- logging.info(msg)
42
- return msg
43
-
44
-
45
- def reformat_github_md_to_slack_markup(msg):
46
- # Based on:
47
- # https://github.com/atomist/slack-messages/blob
48
- # /c938c67e957345ba6a0015ca3ace1fd779d0979c/lib/Markdown.ts#LL111C1-L116C44
49
-
50
- msg = re.sub(r'^(\s*)[-*](\s+)', r'\1•\2', msg, flags=re.MULTILINE)
51
- msg = re.sub(r'(\*|_)\1(\S|\S.*?\S)\1\1(?!\1)', r'<bdmkd>\2</bdmkd>', msg)
52
- msg = re.sub(r'(\*|_)(?!\1)(\S|\S.*?\S)\1(?!\1)', r'<itmkd>\2</itmkd>', msg)
53
- msg = msg.replace('<bdmkd>', '*').replace('<itmkd>', '_')
54
- msg = re.sub(r'^([#]+)\s+([\S ]+)$', r'*\2*', msg, flags=re.MULTILINE)
55
-
56
- # TODO: The message text has to have a partial entity encoding
57
- # https://api.slack.com/reference/surfaces/formatting#escaping
58
- # Validate it if we can?
59
- # A naive replace like this is not enough, because
60
- # it might already be encoded and then we would encode again.
61
- #s = s.replace('&', '&amp;')
62
- #s = s.replace('<', '&lt;')
63
- #s = s.replace('>', '&gt;')
64
-
65
- # Use the tester here:
66
- # https://api.slack.com/methods/chat.postMessage/test
67
- return msg
68
-
69
-
70
- def post_on_slack_channel(slack_token, slack_channel_id, message_text):
71
- api_url = "https://slack.com/api/chat.postMessage"
72
-
73
- headers = {"Authorization": f"Bearer {slack_token}",
74
- "Content-Type": "application/json"}
75
- body = {"channel": slack_channel_id, "text": message_text}
76
-
77
- response = requests.post(api_url, headers=headers, data=json.dumps(body))
78
- response_data = json.loads(response.text)
79
-
80
- if response_data["ok"]:
81
- logging.info("Message sent successfully!")
82
- else:
83
- logging.fatal("Error sending message: %s", response_data['error'])
84
-
85
-
86
- def main():
87
- # Setting this globally to DEBUG will also debug PyGithub,
88
- # which will produce even more log output
89
- logging.basicConfig(level=logging.INFO)
90
- ensure_environment_variables_are_present()
91
-
92
- msg = get_gh_release_info_text_with_token(os.environ['GITHUB_RELEASE_TAG'],
93
- os.environ['GITHUB_TOKEN'])
94
-
95
- slack_formatted_msg = reformat_github_md_to_slack_markup(msg)
96
-
97
- post_on_slack_channel(os.environ['SLACK_BOT_TOKEN'],
98
- os.environ['SLACK_CHANNEL_ID_RELEASES'],
99
- slack_formatted_msg)
100
-
101
-
102
- if __name__ == "__main__":
103
- main()
data/docker-compose.yml DELETED
@@ -1,20 +0,0 @@
1
- version: '3'
2
- services:
3
- sns:
4
- image: s12v/sns
5
- ports:
6
- - "9911:9911"
7
- s3:
8
- image: minio/minio:latest
9
- command: ["server", "/data"]
10
- ports:
11
- - "9000:9000"
12
- dynamodb:
13
- image: circleci/dynamodb
14
- ports:
15
- - "8000:8000"
16
- sqs:
17
- image: softwaremill/elasticmq-native
18
- ports:
19
- - "9324:9324"
20
- - "9325:9325"
data/download.sh DELETED
@@ -1,85 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- if [[ -z ${CIRCLE_TOKEN} ]]
4
- then
5
- echo "ERROR: The CIRCLE_TOKEN variable is missing"
6
- exit 255
7
- fi
8
-
9
- PROJECT_SLUG='https://circleci.com/api/v2/project/gh/instana/ruby-sensor'
10
- PIPELINE_SLUG='https://circleci.com/api/v2/pipeline/'
11
- WORKFLOW_SLUG='https://circleci.com/api/v2/workflow/'
12
-
13
- echo "Getting Pipeline ID"
14
- PIPELINE_ID=$(curl -s \
15
- -H "Circle-Token: ${CIRCLE_TOKEN}" \
16
- "${PROJECT_SLUG}/job/${CIRCLE_BUILD_NUM}" \
17
- | jq -rj '.pipeline.id')
18
-
19
-
20
- echo "Received Pipeline ID is: ${PIPELINE_ID}"
21
-
22
- echo "Getting Workflows for Pipeline ID"
23
- WORKFLOW_IDS=$(curl -s \
24
- -H "Circle-Token: ${CIRCLE_TOKEN}" \
25
- "${PIPELINE_SLUG}/${PIPELINE_ID}/workflow" \
26
- | jq -r '.items[] | select(.name!="report_coverage") | .id')
27
-
28
- echo "Received Workflow IDs are: ${WORKFLOW_IDS}"
29
-
30
- for workflow_id in ${WORKFLOW_IDS}
31
- do
32
- echo "Waiting for workflow ${workflow_id} to finish"
33
- while true
34
- do
35
- STATUS=$(curl -s \
36
- -H "Circle-Token: ${CIRCLE_TOKEN}" \
37
- "${WORKFLOW_SLUG}/${workflow_id}" \
38
- | jq -r '.status')
39
- if [[ ${STATUS} != "running" && ${STATUS} != "on_hold" ]]
40
- then
41
- break
42
- else
43
- echo "Workflow ${workflow_id} has not finished yet. Status is: ${STATUS}"
44
- sleep 10
45
- fi
46
- done
47
-
48
- if [[ "${STATUS}" != "success" ]]
49
- then
50
- echo "ERROR: Workflow ${workflow_id} did not succeed! Status is: ${STATUS}"
51
- exit 254
52
- else
53
- echo "Workflow ${workflow_id} has finished successfully! Status is: ${STATUS}"
54
- fi
55
- done
56
-
57
-
58
- echo "All workflows have successfully finished, downloading artifacts."
59
-
60
- mkdir partial_coverage_results
61
- for workflow_id in ${WORKFLOW_IDS}
62
- do
63
- JOB_NUMBERS=$(curl -s \
64
- -H "Circle-Token: ${CIRCLE_TOKEN}" \
65
- "${WORKFLOW_SLUG}/${workflow_id}/job" \
66
- | jq -r '.items[] | .job_number' \
67
- | tr '\n' ' ')
68
-
69
- for job in ${JOB_NUMBERS}
70
- do
71
- ARTIFACT_DOWNLOAD_LINK=$(curl -s \
72
- -H "Circle-Token: ${CIRCLE_TOKEN}" \
73
- "${PROJECT_SLUG}/${job}/artifacts" \
74
- | jq -r \
75
- '.items[] | select(.path=="coverage/.resultset.json") | .url')
76
- #'.items[] | select(.path=="coverage/coverage.json" or .path=="coverage/.resultset.json") | .url')
77
- curl -s \
78
- -L \
79
- -H "Circle-Token: ${CIRCLE_TOKEN}" \
80
- "${ARTIFACT_DOWNLOAD_LINK}" \
81
- -o partial_coverage_results/.resultset-${job}.json
82
- done
83
- done
84
-
85
- echo "All artifacts have been successfully downloaded."
data/examples/otel.rb DELETED
@@ -1,98 +0,0 @@
1
- # Simple Instana Tracing Examples
2
- # ===========================
3
-
4
- # (c) Copyright IBM Corp. 2025
5
-
6
- #######################################
7
- ## in_span Method Examples
8
- #######################################
9
-
10
- # 1. Basic tracing - simplest way to trace code
11
- Instana.tracer.in_span('my_operation') do
12
- # Your code here
13
- end
14
-
15
- # 2. HTTP request tracing with basic attributes
16
- Instana.tracer.in_span('http.request',
17
- attributes: {
18
- 'http.method' => 'GET',
19
- 'http.url' => 'https://example.com'
20
- },
21
- kind: Instana::Trace::SpanKind::CLIENT) do
22
- # HTTP request code here
23
- end
24
-
25
- # 3. Error handling - errors are automatically captured
26
- begin
27
- Instana.tracer.in_span('risky_operation') do
28
- raise StandardError, 'Something went wrong'
29
- end
30
- rescue
31
- # Handle error
32
- end
33
-
34
- # 4. Nested spans - parent-child relationship
35
- Instana.tracer.in_span('parent') do
36
- # Parent code
37
- Instana.tracer.in_span('child') do
38
- # Child code
39
- end
40
- end
41
-
42
- # 5. Adding tags during execution
43
- Instana.tracer.in_span('process_order') do |span|
44
- span.set_tag('order.id', 12345)
45
- span.set_tag('status', 'completed')
46
- end
47
-
48
- #######################################
49
- ## start_span Method Examples
50
- #######################################
51
-
52
- # 1. Basic manual span control
53
- span = Instana.tracer.start_span('manual_operation')
54
- # Your code here
55
- span.finish
56
-
57
- # 2. Spans across methods
58
- def start_work
59
- span = Instana.tracer.start_span('long_process')
60
- # Initial work
61
- finish_work(span)
62
- end
63
-
64
- def finish_work(span)
65
- # More work
66
- span.finish
67
- end
68
-
69
- # 3. Async operations across threads
70
- parent_span = Instana.tracer.start_span('main_task')
71
-
72
- Thread.new do
73
- child_span = Instana.tracer.start_span('async_task',
74
- with_parent: parent_span.context)
75
- # Async work
76
- child_span.finish
77
- end
78
-
79
- parent_span.finish
80
-
81
- # 4. Manual error handling
82
- span = Instana.tracer.start_span('custom_error_handling')
83
- begin
84
- # Your code here
85
- rescue => e
86
- span.record_exception(e)
87
- ensure
88
- span.finish
89
- end
90
-
91
- # 5. Parent-child relationship (explicit)
92
- parent = Instana.tracer.start_span('parent_task')
93
- child = Instana.tracer.start_span('child_task', with_parent: parent.context)
94
-
95
- child.finish
96
- parent.finish
97
-
98
- # Made with Bob