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: 3e7f2f77a8b66880739f7a053fd1e0ac0ed6a9330d9d9068ccbeb060460ba7db
4
- data.tar.gz: 806da26e71661cb27095bcc616d098b1a36af5ffbb4699e461cdeae5d0e077f4
3
+ metadata.gz: 11a4d057dafe06241ebe7042f68f2675fa052e653cb325df1ed7df27e609d603
4
+ data.tar.gz: 8b4b103be5da44eb1944a2211c58af5a85397c2acc1f3c20c554663979bde68b
5
5
  SHA512:
6
- metadata.gz: 4dd2dac65944039de49814d7958161bcd5317864bc1bc3b35c89024691739ce4dd4bdfbd168fcd9a2a2df75212dea7c7a7c81e716156880c5e5ce6bc8618aee0
7
- data.tar.gz: f5ae7746690135bf149d897fcb61fe53709a5b7bc0f8f7ed32c48116b686a2a74e4b3d79f762ce0c16425cbfb5b7cc760da4f9d23c69a848c97fa03132e03df5
6
+ metadata.gz: 39f09188ae59c71fe5779d7af3d84221cf3fa439372fbc71128e2668a4cb21e3b285846004965601d21d9b273edef9a7c4c7106e70eaed6091decabf617b868f
7
+ data.tar.gz: 4001559c175453f4a13742233b698aa96fa03948f29f5aa0b1530e28e85e6c4056cb808f5c6199bfef7232a09d0e0f22006589aa1688908bfd7ae960b1463bb8
data/.rubocop.yml CHANGED
@@ -21,3 +21,6 @@ Style/HashSyntax:
21
21
 
22
22
  Metrics/BlockLength:
23
23
  Enabled: false
24
+
25
+ Metrics/CyclomaticComplexity:
26
+ Enabled: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- helios-opentelemetry-sdk (0.1.14)
4
+ helios-opentelemetry-sdk (0.1.15)
5
5
  opentelemetry-exporter-otlp (~> 0.22.0)
6
6
  opentelemetry-instrumentation-all (~> 0.25.0)
7
7
  opentelemetry-instrumentation-rspec (~> 0.2.0)
@@ -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[0]&.length&.positive?
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
@@ -1,7 +1,7 @@
1
1
  module Helios
2
2
  module OpenTelemetry
3
3
  module SDK
4
- VERSION = '0.1.14'
4
+ VERSION = '0.1.15'
5
5
  end
6
6
  end
7
7
  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.14
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-23 00:00:00.000000000 Z
11
+ date: 2022-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler