highlight_io 0.1.4 → 0.2.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 +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +5 -5
- data/lib/highlight/version.rb +1 -1
- data/lib/highlight.rb +9 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce73dd45dc718a3763e06ad6168954ff402294f28ad7b99a3ced2234b8d878d0
|
4
|
+
data.tar.gz: 9c37d1382204c7e542a525a88e6ec02953bac04e11b11771532f8e3039339a9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffd101b0284c9854b1d54b3f95f852d440609ab709faebd650cd1cafd67031fe97f0230b939b21981fc6a6c1f58a5e830daf214aa7ff71d374566a64767dc43d
|
7
|
+
data.tar.gz: c8437f01919ad43ad20f35a5c3a0f59470baf7acca5708834652dbba88d8008794e4c50768777b2f46b287e496c24c83141a1ad48f870b94e836c554b855a9be
|
data/CHANGELOG.md
CHANGED
@@ -6,3 +6,12 @@
|
|
6
6
|
|
7
7
|
- Tune settings of opentelemetry SDK to reduce memory usage.
|
8
8
|
- Enable GZIP compression of exported data.
|
9
|
+
|
10
|
+
## 0.2.0
|
11
|
+
|
12
|
+
- Support setting `environment` attribute to SDK initialization.
|
13
|
+
- `otlp_endpoint` updated to keyword parameter when initializing.
|
14
|
+
|
15
|
+
## 0.2.1
|
16
|
+
|
17
|
+
- Ensure `message` on logs is always a string.
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
highlight_io (0.1
|
4
|
+
highlight_io (0.2.1)
|
5
5
|
grpc (~> 1.52)
|
6
6
|
opentelemetry-exporter-otlp (~> 0.24.0)
|
7
7
|
opentelemetry-instrumentation-all (~> 0.32.0)
|
@@ -12,10 +12,10 @@ GEM
|
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
14
|
ast (2.4.2)
|
15
|
-
google-protobuf (3.23.4
|
15
|
+
google-protobuf (3.23.4)
|
16
16
|
googleapis-common-protos-types (1.8.0)
|
17
17
|
google-protobuf (~> 3.18)
|
18
|
-
grpc (1.57.0
|
18
|
+
grpc (1.57.0)
|
19
19
|
google-protobuf (~> 3.23)
|
20
20
|
googleapis-common-protos-types (~> 1.0)
|
21
21
|
json (2.6.3)
|
@@ -231,7 +231,7 @@ GEM
|
|
231
231
|
unicode-display_width (2.4.2)
|
232
232
|
|
233
233
|
PLATFORMS
|
234
|
-
|
234
|
+
ruby
|
235
235
|
|
236
236
|
DEPENDENCIES
|
237
237
|
highlight_io!
|
@@ -240,4 +240,4 @@ DEPENDENCIES
|
|
240
240
|
rubocop
|
241
241
|
|
242
242
|
BUNDLED WITH
|
243
|
-
2.4.
|
243
|
+
2.4.22
|
data/lib/highlight/version.rb
CHANGED
data/lib/highlight.rb
CHANGED
@@ -22,7 +22,7 @@ module Highlight
|
|
22
22
|
@@instance
|
23
23
|
end
|
24
24
|
|
25
|
-
def initialize(project_id, otlp_endpoint
|
25
|
+
def initialize(project_id, environment: '', otlp_endpoint: OTLP_HTTP)
|
26
26
|
@@instance = self # rubocop:disable Style/ClassVars
|
27
27
|
|
28
28
|
@project_id = project_id
|
@@ -34,6 +34,11 @@ module Highlight
|
|
34
34
|
endpoint: "#{@otlp_endpoint}/v1/traces", compression: 'gzip'
|
35
35
|
), schedule_delay: 1000, max_export_batch_size: 128, max_queue_size: 1024
|
36
36
|
))
|
37
|
+
|
38
|
+
c.resource = OpenTelemetry::SDK::Resources::Resource.create(
|
39
|
+
OpenTelemetry::SemanticConventions::Resource::DEPLOYMENT_ENVIRONMENT => environment
|
40
|
+
)
|
41
|
+
|
37
42
|
yield c if block_given?
|
38
43
|
end
|
39
44
|
|
@@ -65,6 +70,7 @@ module Highlight
|
|
65
70
|
span.record_exception(e, attributes: attrs)
|
66
71
|
end
|
67
72
|
|
73
|
+
# rubocop:disable Metrics/AbcSize
|
68
74
|
def record_log(session_id, request_id, level, message, attrs = {})
|
69
75
|
caller_info = caller[0].split(':', 3)
|
70
76
|
function = caller_info[2]
|
@@ -81,13 +87,14 @@ module Highlight
|
|
81
87
|
span.status = OpenTelemetry::Trace::Status.error(message) if [Logger::ERROR, Logger::FATAL].include?(level)
|
82
88
|
span.add_event(LOG_EVENT, attributes: {
|
83
89
|
LOG_SEVERITY_ATTRIBUTE => H.log_level_string(level),
|
84
|
-
LOG_MESSAGE_ATTRIBUTE => message,
|
90
|
+
LOG_MESSAGE_ATTRIBUTE => message.to_s,
|
85
91
|
CODE_FILEPATH => caller_info[0],
|
86
92
|
CODE_LINENO => caller_info[1],
|
87
93
|
CODE_FUNCTION => function
|
88
94
|
}.merge(attrs))
|
89
95
|
end
|
90
96
|
end
|
97
|
+
# rubocop:enable Metrics/AbcSize
|
91
98
|
|
92
99
|
HighlightHeaders = Struct.new('HighlightHeaders', :session_id, :request_id)
|
93
100
|
def self.parse_headers(headers)
|
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
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Highlight
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-06-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: grpc
|