opentelemetry-test-helpers 0.3.0 → 0.5.0

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: 004b4b32010f297002452903941d889f42122d31a38d7b6a010f79b1753682ec
4
- data.tar.gz: 245145b11f04bd297da424bcff6d7b863ebdb30d9ef0485200d20a9b777dc945
3
+ metadata.gz: 6c36c4434cb0043d4840d1922230611ceda7ce6b73d9c783a4bc85dfc1b5ffdd
4
+ data.tar.gz: 32c2e073615840a8e879f493423037b615ef9d4cda3ce245efbeb7ee48bcbedd
5
5
  SHA512:
6
- metadata.gz: 89f57cfe1552dfab50710456112f2fe168c4e44a3140ddb326b9b5ae1a8a21d21fa2b3255a1df4b33f938f22c6a87ec3b23761dab474c0e8fe9ff37e77a4b5fb
7
- data.tar.gz: a79ca35ef8dbd2272a7a0071388f5d29a2bf798fefc4d373e3ae54fdf2598155d19d94f4f00ee805e4ba38295546d091f50854a9265b12053202b7f43dbd905b
6
+ metadata.gz: e645ba2e7a091ec8ad5978aa1c708c755df29eecaafbafbe4062c16658ec8f4006f6b82e39a9c9da6f0aeecf4e044f26b15b4869954649902ef8a4c51c87aa00
7
+ data.tar.gz: 2225aae58f967ee4083bf814f809b7c88febf9789f02e49210979906c305197abf2d7bfca53673652cda34b5d4458040fd40cfe0b39ee2e2e9d8d8073aba58e8
data/CHANGELOG.md CHANGED
@@ -1,12 +1,22 @@
1
1
  # Release History: opentelemetry-test-helpers
2
2
 
3
+ ### v0.5.0 / 2024-12-04
4
+
5
+ * ADDED: Add OTLP Log Record Exporter
6
+
7
+ ### v0.4.0 / 2023-06-08
8
+
9
+ * BREAKING CHANGE: Remove support for EoL Ruby 2.7
10
+
11
+ * ADDED: Remove support for EoL Ruby 2.7
12
+
3
13
  ### v0.3.0 / 2022-09-14
4
14
 
5
- * ADDED: Support InstrumentationScope, and update OTLP proto to 0.18.0
15
+ * ADDED: Support InstrumentationScope, and update OTLP proto to 0.18.0
6
16
 
7
17
  ### v0.2.0 / 2022-06-09
8
18
 
9
- * ADDED: Otlp grpc
19
+ * ADDED: Otlp grpc
10
20
 
11
21
  ### v0.1.0 / 2022-04-22
12
22
 
data/README.md CHANGED
@@ -16,13 +16,12 @@ The `opentelemetry-test-helpers` gem is home to commonly used snippets of test c
16
16
 
17
17
  Install the gem using:
18
18
 
19
- ```
19
+ ```sh
20
20
  gem install opentelemetry-test-helpers
21
21
  ```
22
22
 
23
23
  Or, if you use [bundler][bundler-home], include `opentelemetry-test-helpers` in your `Gemfile`.
24
24
 
25
-
26
25
  ## How can I get involved?
27
26
 
28
27
  The `opentelemetry-test-helpers` gem source is [on github][repo-github], along with related gems including `opentelemetry-api`.
@@ -33,12 +32,10 @@ The OpenTelemetry Ruby gems are maintained by the OpenTelemetry-Ruby special int
33
32
 
34
33
  The `opentelemetry-test-helpers` gem is distributed under the Apache 2.0 license. See [LICENSE][license-github] for more information.
35
34
 
36
-
37
35
  [opentelemetry-home]: https://opentelemetry.io
38
36
  [bundler-home]: https://bundler.io
39
37
  [repo-github]: https://github.com/open-telemetry/opentelemetry-ruby
40
38
  [license-github]: https://github.com/open-telemetry/opentelemetry-ruby/blob/main/LICENSE
41
- [examples-github]: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/examples
42
39
  [ruby-sig]: https://github.com/open-telemetry/community#ruby-sig
43
40
  [community-meetings]: https://github.com/open-telemetry/community#community-meetings
44
41
  [discussions-url]: https://github.com/open-telemetry/opentelemetry-ruby/discussions
@@ -7,6 +7,6 @@
7
7
  module OpenTelemetry
8
8
  ## Current OpenTelemetry Test Helpers version
9
9
  module TestHelpers
10
- VERSION = '0.3.0'
10
+ VERSION = '0.5.0'
11
11
  end
12
12
  end
@@ -55,11 +55,9 @@ module OpenTelemetry
55
55
  keys_to_delete.each { |k| ENV.delete(k) }
56
56
  end
57
57
 
58
- def with_ids(trace_id, span_id)
58
+ def with_ids(trace_id, span_id, &block)
59
59
  OpenTelemetry::Trace.stub(:generate_trace_id, trace_id) do
60
- OpenTelemetry::Trace.stub(:generate_span_id, span_id) do
61
- yield
62
- end
60
+ OpenTelemetry::Trace.stub(:generate_span_id, span_id, &block)
63
61
  end
64
62
  end
65
63
 
@@ -74,5 +72,34 @@ module OpenTelemetry
74
72
  total_recorded_events, total_recorded_links, start_timestamp, end_timestamp,
75
73
  attributes, links, events, resource, instrumentation_scope, span_id, trace_id, trace_flags, tracestate)
76
74
  end
75
+
76
+ def create_log_record_data(timestamp: OpenTelemetry::TestHelpers.exportable_timestamp,
77
+ observed_timestamp: OpenTelemetry::TestHelpers.exportable_timestamp,
78
+ severity_text: nil,
79
+ severity_number: nil,
80
+ body: nil,
81
+ attributes: nil,
82
+ trace_id: OpenTelemetry::Trace.generate_trace_id,
83
+ span_id: OpenTelemetry::Trace.generate_span_id,
84
+ trace_flags: OpenTelemetry::Trace::TraceFlags::DEFAULT,
85
+ resource: nil,
86
+ instrumentation_scope: OpenTelemetry::SDK::InstrumentationScope.new('', 'v0.0.1'),
87
+ total_recorded_attributes: 0)
88
+ resource ||= OpenTelemetry::SDK::Resources::Resource.telemetry_sdk
89
+ OpenTelemetry::SDK::Logs::LogRecordData.new(
90
+ timestamp,
91
+ observed_timestamp,
92
+ severity_text,
93
+ severity_number,
94
+ body,
95
+ attributes,
96
+ trace_id,
97
+ span_id,
98
+ trace_flags,
99
+ resource,
100
+ instrumentation_scope,
101
+ total_recorded_attributes
102
+ )
103
+ end
77
104
  end
78
105
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-test-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-14 00:00:00.000000000 Z
11
+ date: 2024-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.73.0
103
+ version: '1.65'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.73.0
110
+ version: '1.65'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simplecov
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -168,10 +168,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
168
168
  licenses:
169
169
  - Apache-2.0
170
170
  metadata:
171
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-test-helpers/v0.3.0/file.CHANGELOG.html
171
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-test-helpers/v0.5.0/file.CHANGELOG.html
172
172
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/test_helpers
173
173
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
174
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-test-helpers/v0.3.0
174
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-test-helpers/v0.5.0
175
175
  post_install_message:
176
176
  rdoc_options: []
177
177
  require_paths:
@@ -180,14 +180,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
180
180
  requirements:
181
181
  - - ">="
182
182
  - !ruby/object:Gem::Version
183
- version: 2.6.0
183
+ version: '3.0'
184
184
  required_rubygems_version: !ruby/object:Gem::Requirement
185
185
  requirements:
186
186
  - - ">="
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  requirements: []
190
- rubygems_version: 3.1.6
190
+ rubygems_version: 3.2.33
191
191
  signing_key:
192
192
  specification_version: 4
193
193
  summary: A collection of helpers for testing OpenTelemetry Ruby