opentelemetry-test-helpers 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/opentelemetry/test_helpers/version.rb +1 -1
- data/lib/opentelemetry/test_helpers.rb +20 -0
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd237508ac940ebf92dcfc6aa7746889a8abfe3bc65f79ac68b52097d6249f74
|
4
|
+
data.tar.gz: 6e2fd84912d49ddc95fa3ec179d7f86dcd23bcc3c8fdafbd0e4ef07404105c03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c41d529101597bdf7f8e6c34d00775a0575819f9ce956d5e60a0f0b2003274154d413fa173c0f3936e5b3839e706fc10a48b65668ef711fdfa120185dff441cd
|
7
|
+
data.tar.gz: 900b42f72f917d8c1f05f8bc9225fc1ceecd9b32426c3b950ad051e0b1ce64a2e517a7b33e9ad8ca60e06e0f8bcdb227c65d85d12c52933104116b614cbb6af5
|
data/CHANGELOG.md
CHANGED
@@ -54,5 +54,25 @@ module OpenTelemetry
|
|
54
54
|
env_to_reset.each_pair { |k, v| ENV[k] = v }
|
55
55
|
keys_to_delete.each { |k| ENV.delete(k) }
|
56
56
|
end
|
57
|
+
|
58
|
+
def with_ids(trace_id, span_id)
|
59
|
+
OpenTelemetry::Trace.stub(:generate_trace_id, trace_id) do
|
60
|
+
OpenTelemetry::Trace.stub(:generate_span_id, span_id) do
|
61
|
+
yield
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def create_span_data(name: '', kind: nil, status: nil, parent_span_id: OpenTelemetry::Trace::INVALID_SPAN_ID,
|
67
|
+
total_recorded_attributes: 0, total_recorded_events: 0, total_recorded_links: 0, start_timestamp: OpenTelemetry::TestHelpers.exportable_timestamp,
|
68
|
+
end_timestamp: OpenTelemetry::TestHelpers.exportable_timestamp, attributes: nil, links: nil, events: nil, resource: nil,
|
69
|
+
instrumentation_library: OpenTelemetry::SDK::InstrumentationLibrary.new('', 'v0.0.1'),
|
70
|
+
span_id: OpenTelemetry::Trace.generate_span_id, trace_id: OpenTelemetry::Trace.generate_trace_id,
|
71
|
+
trace_flags: OpenTelemetry::Trace::TraceFlags::DEFAULT, tracestate: nil)
|
72
|
+
resource ||= OpenTelemetry::SDK::Resources::Resource.telemetry_sdk
|
73
|
+
OpenTelemetry::SDK::Trace::SpanData.new(name, kind, status, parent_span_id, total_recorded_attributes,
|
74
|
+
total_recorded_events, total_recorded_links, start_timestamp, end_timestamp,
|
75
|
+
attributes, links, events, resource, instrumentation_library, span_id, trace_id, trace_flags, tracestate)
|
76
|
+
end
|
57
77
|
end
|
58
78
|
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.
|
4
|
+
version: 0.2.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-
|
11
|
+
date: 2022-06-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: opentelemetry-sdk
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: pry
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,10 +168,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
154
168
|
licenses:
|
155
169
|
- Apache-2.0
|
156
170
|
metadata:
|
157
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-test-helpers/v0.
|
171
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-test-helpers/v0.2.0/file.CHANGELOG.html
|
158
172
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/test_helpers
|
159
173
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
160
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-test-helpers/v0.
|
174
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-test-helpers/v0.2.0
|
161
175
|
post_install_message:
|
162
176
|
rdoc_options: []
|
163
177
|
require_paths:
|
@@ -166,7 +180,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
166
180
|
requirements:
|
167
181
|
- - ">="
|
168
182
|
- !ruby/object:Gem::Version
|
169
|
-
version: 2.
|
183
|
+
version: 2.6.0
|
170
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
171
185
|
requirements:
|
172
186
|
- - ">="
|