opentelemetry-instrumentation-aws_lambda 0.1.0 → 0.1.1
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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25cdbdbb4f636b8da6e8ee8ba34f85207ddb290289e90cfa9696c4da63c81cf2
|
4
|
+
data.tar.gz: 171eed89cc4964890346576d2cec1453075571fc8d8aa412fde20e0859bde6c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 565f46f2a5a333db8fb2b063e14de403c4292b6e0117200f2225a2e4fccc0f521f2a4d735a368cbaa7a8493c8a389d1903eee531bc3fc21017fe504445f4e639
|
7
|
+
data.tar.gz: 3e81740226a8e4f4919cd986743c381c46411bfbba07d2939e6be089db7fe580a2381eb874658357faaf6ff5e007df4aba91aaf3c947132fc47f14e1c645f825
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -36,6 +36,7 @@ To run the example:
|
|
36
36
|
* `bundle install`
|
37
37
|
2. Run the sample client script
|
38
38
|
* `ruby trace_demonstration.rb`
|
39
|
+
* or `bundle exec ruby trace_demonstration.rb`
|
39
40
|
|
40
41
|
This will run SNS publish command, printing OpenTelemetry traces to the console as it goes.
|
41
42
|
|
@@ -40,33 +40,25 @@ module OpenTelemetry
|
|
40
40
|
original_handler_error = nil
|
41
41
|
original_response = nil
|
42
42
|
OpenTelemetry::Context.with_current(parent_context) do
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
original_response = response
|
43
|
+
tracer.in_span(@original_handler, attributes: otel_attributes(event, context), kind: span_kind) do |span|
|
44
|
+
begin
|
45
|
+
response = call_original_handler(event: event, context: context)
|
46
|
+
status_code = response['statusCode'] || response[:statusCode] if response.is_a?(Hash)
|
47
|
+
span.set_attribute(OpenTelemetry::SemanticConventions::Trace::HTTP_STATUS_CODE, status_code) if status_code
|
48
|
+
rescue StandardError => e
|
49
|
+
original_handler_error = e
|
50
|
+
ensure
|
51
|
+
original_response = response
|
52
|
+
end
|
53
|
+
if original_handler_error
|
54
|
+
span.record_exception(original_handler_error)
|
55
|
+
span.status = OpenTelemetry::Trace::Status.error(original_handler_error.message)
|
56
|
+
end
|
58
57
|
end
|
59
|
-
rescue StandardError => e
|
60
|
-
OpenTelemetry.logger.error("aws-lambda instrumentation #{e.class}: #{e.message}")
|
61
|
-
ensure
|
62
|
-
if original_handler_error
|
63
|
-
span&.record_exception(original_handler_error)
|
64
|
-
span&.status = OpenTelemetry::Trace::Status.error(original_handler_error.message)
|
65
|
-
end
|
66
|
-
span&.finish
|
67
|
-
OpenTelemetry.tracer_provider.force_flush(timeout: @flush_timeout)
|
68
58
|
end
|
69
59
|
|
60
|
+
OpenTelemetry.tracer_provider.force_flush(timeout: @flush_timeout)
|
61
|
+
|
70
62
|
raise original_handler_error if original_handler_error
|
71
63
|
|
72
64
|
original_response
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-instrumentation-aws_lambda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenTelemetry Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -156,14 +156,14 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 1.
|
159
|
+
version: 1.65.0
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 1.
|
166
|
+
version: 1.65.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rubocop-performance
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -241,10 +241,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby-contrib
|
|
241
241
|
licenses:
|
242
242
|
- Apache-2.0
|
243
243
|
metadata:
|
244
|
-
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_lambda/0.1.
|
244
|
+
changelog_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_lambda/0.1.1/file/CHANGELOG.md
|
245
245
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/tree/main/instrumentation/aws_lambda
|
246
246
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby-contrib/issues
|
247
|
-
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_lambda/0.1.
|
247
|
+
documentation_uri: https://rubydoc.info/gems/opentelemetry-instrumentation-aws_lambda/0.1.1
|
248
248
|
post_install_message:
|
249
249
|
rdoc_options: []
|
250
250
|
require_paths:
|