sqreen-kit 0.2.0 → 0.2.4

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: '09939c2b1e179a32121dafa7f96c9e1af87c40369894a8809bdd165aa2412388'
4
- data.tar.gz: 59500cef9fd4048141ffca62431661150732575841e5c8a896c85d39c8f66279
3
+ metadata.gz: d3c3c3a3932f0d6fcde7f95a2ad0743cace17a4b58ee48708a78348314bc16e4
4
+ data.tar.gz: ac001f1b98cc096028068725184dc5fc71c4dfb88076ac770bea440bb5df194e
5
5
  SHA512:
6
- metadata.gz: 74ffacce1b772023b8ee9fb460a4569ccd5865f91b4782ec04d0266aba3f4ccf1c8076afb405e752dc3bd82899347e7657f610b9d89ef44675b0f1bfb5d20ef7
7
- data.tar.gz: a9a6ad2cd45e96689329bc6091a09015c50b6a55c6271c083f2f4ba47d75bf099fc504194ac26cfbfe4ddb07611e7e1a9081321ad028033b84e9ccecbbc2532b
6
+ metadata.gz: fc908669f1f9458cabcefae588e5d666bf52d1824be0cdb23c7c34125f609aed0e9acf794c95ad5728f7738525e8c4ec528f481052cf1af598837a22aa0f5d23
7
+ data.tar.gz: 862ede7a8b46278f64dee327c672a6f8f865904d2988dbcd9ed529fc1a157955467503376eb1ca3f706f9829265b8499d7cc778f0fd58c91b95e452ae79547b3
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.4
4
+
5
+ Allow location without stacktrace
6
+
7
+ ## 0.2.3
8
+
9
+ Add Datadog correlation data
10
+
11
+ ## 0.2.2
12
+
13
+ * Make user agent optional for HTTP context payload
14
+
15
+ ## 0.2.1
16
+
17
+ * Add configurable certificate store
18
+
3
19
  ## 0.2.0
4
20
 
5
21
  * Add configurable source information
data/lib/sqreen/kit.rb CHANGED
@@ -57,6 +57,7 @@ module Sqreen
57
57
  @http_client ||=
58
58
  HttpClient.new(Configuration.ingestion_url,
59
59
  retry_policy,
60
+ certificate_store: Configuration.certificate_store,
60
61
  proxy_address: Configuration.proxy_address,
61
62
  proxy_port: Configuration.proxy_port,
62
63
  proxy_user: Configuration.proxy_user,
@@ -14,6 +14,7 @@ module Sqreen
14
14
 
15
15
  # http client related
16
16
  attr_accessor :ingestion_url,
17
+ :certificate_store,
17
18
  :proxy_address,
18
19
  :proxy_port,
19
20
  :proxy_user,
@@ -37,6 +37,7 @@ module Sqreen
37
37
  opts[:proxy_port], opts[:proxy_user],
38
38
  opts[:proxy_pass])
39
39
  @http.use_ssl = @base_url.scheme.downcase == 'https'
40
+ @http.cert_store = opts[:certificate_store]
40
41
  @http.verify_mode = OpenSSL::SSL::VERIFY_NONE if ENV['SQREEN_SSL_NO_VERIFY'] # for testing
41
42
 
42
43
  @http.open_timeout = opts[:connect_timeout] || DEFAULT_CONNECT_TIMEOUT_S
@@ -23,7 +23,7 @@ class Sqreen::Kit::Signals::Context::HttpContext
23
23
  :params_json, :params_other].freeze
24
24
 
25
25
  SCHEMA_VERSION = 'http/2020-01-01T00:00:00.000Z'.freeze
26
- add_mandatory_attrs :headers, :user_agent, :scheme, :verb,
26
+ add_mandatory_attrs :headers, :scheme, :verb,
27
27
  :host, :port, :remote_ip, :remote_port, :path
28
28
 
29
29
  # @return [String]
@@ -107,6 +107,14 @@ class Sqreen::Kit::Signals::Context::HttpContext
107
107
  # @return [String]
108
108
  attr_accessor :content_type
109
109
 
110
+ # Datadog trace id
111
+ # @return [Integer]
112
+ attr_accessor :datadog_trace_id
113
+
114
+ # Datadog span id
115
+ # @return [Integer]
116
+ attr_accessor :datadog_span_id
117
+
110
118
  def to_h
111
119
  check_mandatories
112
120
 
@@ -139,6 +147,9 @@ class Sqreen::Kit::Signals::Context::HttpContext
139
147
  content_type: content_type,
140
148
  content_length: content_length,
141
149
  }),
142
- }
150
+ }.merge!(compact_hash(
151
+ datadog_trace_id: datadog_trace_id,
152
+ datadog_span_id: datadog_span_id,
153
+ ))
143
154
  end
144
155
  end
@@ -60,13 +60,19 @@ module Sqreen
60
60
  # @param [Exception] e
61
61
  attr_writer :exception
62
62
 
63
+ # Datadog trace id
64
+ # @return [Integer]
65
+ attr_accessor :datadog_trace_id
66
+
67
+ # Datadog span id
68
+ # @return [Integer]
69
+ attr_accessor :datadog_span_id
70
+
63
71
  def stack_trace
64
72
  if @exception
65
73
  Sqreen::Kit::StackTrace.parse(@exception)
66
74
  elsif @stack_trace
67
75
  Sqreen::Kit::StackTrace.parse_backtrace(@stack_trace)
68
- else
69
- raise 'Neither exception not stack_trace set'
70
76
  end
71
77
  end
72
78
  end
@@ -1,3 +1,5 @@
1
+ # typed: ignore
2
+
1
3
  # Copyright (c) 2015 Sqreen. All Rights Reserved.
2
4
  # Please refer to our terms for more information: https://www.sqreen.com/terms.html
3
5
 
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqreen-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loic Nageleisen
8
8
  - Gustavo Lopes
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-06-18 00:00:00.000000000 Z
12
+ date: 1980-01-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqreen-backport
@@ -25,8 +25,8 @@ dependencies:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: 0.1.0
28
- description:
29
- email:
28
+ description:
29
+ email:
30
30
  executables: []
31
31
  extensions: []
32
32
  extra_rdoc_files: []
@@ -60,7 +60,7 @@ licenses:
60
60
  - Sqreen
61
61
  metadata:
62
62
  source_code_uri: https://github.com/sqreen/ruby-sdk
63
- post_install_message:
63
+ post_install_message:
64
64
  rdoc_options: []
65
65
  require_paths:
66
66
  - lib
@@ -75,8 +75,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  requirements: []
78
- rubygems_version: 3.0.3
79
- signing_key:
78
+ rubygems_version: 3.2.16
79
+ signing_key:
80
80
  specification_version: 4
81
81
  summary: Sqreen development kit for Ruby
82
82
  test_files: []