helios-opentelemetry-sdk 0.1.14 → 0.1.15
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11a4d057dafe06241ebe7042f68f2675fa052e653cb325df1ed7df27e609d603
|
4
|
+
data.tar.gz: 8b4b103be5da44eb1944a2211c58af5a85397c2acc1f3c20c554663979bde68b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39f09188ae59c71fe5779d7af3d84221cf3fa439372fbc71128e2668a4cb21e3b285846004965601d21d9b273edef9a7c4c7106e70eaed6091decabf617b868f
|
7
|
+
data.tar.gz: 4001559c175453f4a13742233b698aa96fa03948f29f5aa0b1530e28e85e6c4056cb808f5c6199bfef7232a09d0e0f22006589aa1688908bfd7ae960b1463bb8
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -5,6 +5,11 @@ require_relative '../../semantic_attributes'
|
|
5
5
|
module FaradayPatch
|
6
6
|
module HeliosFaradayMiddleware
|
7
7
|
def trace_response(span, env)
|
8
|
+
extract_additional_attributes(span, env)
|
9
|
+
super(span, env)
|
10
|
+
end
|
11
|
+
|
12
|
+
def extract_additional_attributes(span, env)
|
8
13
|
request_headers = env.request_headers
|
9
14
|
semantic_attributes = Helios::OpenTelemetry::SemanticAttributes
|
10
15
|
span.set_attribute(semantic_attributes::HTTP_REQUEST_HEADERS, request_headers.to_json)
|
@@ -12,8 +17,6 @@ module FaradayPatch
|
|
12
17
|
response_headers = env.response_headers
|
13
18
|
span.set_attribute(semantic_attributes::HTTP_RESPONSE_HEADERS, response_headers.to_json)
|
14
19
|
span.set_attribute(semantic_attributes::HTTP_RESPONSE_BODY, env.response_body) unless env.response_body.nil?
|
15
|
-
|
16
|
-
super(span, env)
|
17
20
|
end
|
18
21
|
end
|
19
22
|
end
|
@@ -12,17 +12,14 @@ module RackPatch
|
|
12
12
|
res[semantic_attributes::HTTP_REQUEST_HEADERS] = request_headers.to_json
|
13
13
|
request_body = env['rack.input']&.read
|
14
14
|
env['rack.input']&.rewind
|
15
|
-
if request_body&.length&.positive?
|
16
|
-
res[semantic_attributes::HTTP_REQUEST_BODY] = request_body
|
17
|
-
end
|
18
|
-
|
15
|
+
res[semantic_attributes::HTTP_REQUEST_BODY] = request_body if request_body&.length&.positive?
|
19
16
|
res
|
20
17
|
end
|
21
18
|
|
22
19
|
def set_attributes_after_request(span, status, headers, response)
|
23
20
|
semantic_attributes = Helios::OpenTelemetry::SemanticAttributes
|
24
21
|
span.set_attribute(semantic_attributes::HTTP_RESPONSE_HEADERS, headers.to_json)
|
25
|
-
span.set_attribute(semantic_attributes::HTTP_RESPONSE_BODY, response[0]) if response
|
22
|
+
span.set_attribute(semantic_attributes::HTTP_RESPONSE_BODY, response[0]) if response&.first&.length&.positive?
|
26
23
|
super(span, status, headers, response)
|
27
24
|
end
|
28
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helios-opentelemetry-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Team Helios
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|