highlight_io 0.1.2 → 0.1.4

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: 391312c21e44302ef6e836b0f33bce8af2ba7c739ec8e4999c996cf74614cbe4
4
- data.tar.gz: ac48bca9cb8f1d0dc573d5077a1efadf0b38e9b6f539862c670c666f21b015c5
3
+ metadata.gz: '097aa8d0420fe1617bba3f9bc5358b4f4a4b33fc86c9100add607f0000a21a31'
4
+ data.tar.gz: 9c2a3730d42efa5fe5fe7b2406d6e74b660cde344a72842845834f998ccdfc6d
5
5
  SHA512:
6
- metadata.gz: cf00cd6ae014743e2b6fdddd65fc52117d27d1679024f51aae7845f53bcbd51967063a1b1bcf0dca95e1d73abc3f0dc13738f3c345797daba709c3f9872381f6
7
- data.tar.gz: 6979cc7ffbf29ddaea91432ff6e6e31f207197d1f1dbb10b71f988338df0617e68e4b179baf8ad296ea8c35112280979a8975c82b3245502f5dec32410315552
6
+ metadata.gz: 8d8a6b916b6ae7dee9a47c86e8ffba1da90c60b2ccdf12ca44b768f7e6022189377688ec24fa7efdef5defe78b3ee706dff681e447a41e0b082f7c2f182d5b0d
7
+ data.tar.gz: '00832a7b4bdad74f86c8d488705eb5f979c2bd05d94ca963afed72fd5d86377e8890630ecb137f5605f3bf16a0b0c7090280ece588378ba0022bff8adc5e2944'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
1
  ## 0.1.2
2
2
 
3
3
  - Add ability to set `service_name` and `service_version`
4
+
5
+ ## 0.1.4
6
+
7
+ - Tune settings of opentelemetry SDK to reduce memory usage.
8
+ - Enable GZIP compression of exported data.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- highlight_io (0.1.2)
4
+ highlight_io (0.1.4)
5
5
  grpc (~> 1.52)
6
6
  opentelemetry-exporter-otlp (~> 0.24.0)
7
7
  opentelemetry-instrumentation-all (~> 0.32.0)
@@ -13,9 +13,9 @@ GEM
13
13
  specs:
14
14
  ast (2.4.2)
15
15
  google-protobuf (3.23.4-x86_64-linux)
16
- googleapis-common-protos-types (1.7.0)
17
- google-protobuf (~> 3.14)
18
- grpc (1.56.2-x86_64-linux)
16
+ googleapis-common-protos-types (1.8.0)
17
+ google-protobuf (~> 3.18)
18
+ grpc (1.57.0-x86_64-linux)
19
19
  google-protobuf (~> 3.23)
20
20
  googleapis-common-protos-types (~> 1.0)
21
21
  json (2.6.3)
@@ -240,4 +240,4 @@ DEPENDENCIES
240
240
  rubocop
241
241
 
242
242
  BUNDLED WITH
243
- 2.4.18
243
+ 2.4.19
@@ -1,3 +1,3 @@
1
1
  module Highlight
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
data/lib/highlight.rb CHANGED
@@ -30,7 +30,9 @@ module Highlight
30
30
 
31
31
  OpenTelemetry::SDK.configure do |c|
32
32
  c.add_span_processor(OpenTelemetry::SDK::Trace::Export::BatchSpanProcessor.new(
33
- OpenTelemetry::Exporter::OTLP::Exporter.new(endpoint: "#{@otlp_endpoint}/v1/traces")
33
+ OpenTelemetry::Exporter::OTLP::Exporter.new(
34
+ endpoint: "#{@otlp_endpoint}/v1/traces", compression: 'gzip'
35
+ ), schedule_delay: 1000, max_export_batch_size: 128, max_queue_size: 1024
34
36
  ))
35
37
  yield c if block_given?
36
38
  end
@@ -43,12 +45,12 @@ module Highlight
43
45
  @tracer_provider.force_flush
44
46
  end
45
47
 
46
- def trace(session_id, request_id)
48
+ def trace(session_id, request_id, attrs = {})
47
49
  @tracer.in_span('highlight-ctx', attributes: {
48
50
  HIGHLIGHT_PROJECT_ATTRIBUTE => @project_id,
49
51
  HIGHLIGHT_SESSION_ATTRIBUTE => session_id,
50
52
  HIGHLIGHT_TRACE_ATTRIBUTE => request_id
51
- }.compact) do |_span|
53
+ }.merge(attrs).compact) do |_span|
52
54
  yield
53
55
  rescue StandardError => e
54
56
  record_exception(e)
@@ -56,11 +58,11 @@ module Highlight
56
58
  end
57
59
  end
58
60
 
59
- def record_exception(e)
61
+ def record_exception(e, attrs = {})
60
62
  span = OpenTelemetry::Trace.current_span
61
63
  return unless span
62
64
 
63
- span.record_exception(e)
65
+ span.record_exception(e, attributes: attrs)
64
66
  end
65
67
 
66
68
  def record_log(session_id, request_id, level, message, attrs = {})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: highlight_io
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Highlight
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-10 00:00:00.000000000 Z
11
+ date: 2023-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grpc