utrace 0.2.0 → 0.3.0

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: 46ed491afce143bf3ba3d5dc901052b0a14203a242d03b2d71e78f7e5d7c8235
4
- data.tar.gz: 9f617cb819e87ded61ebba36fdcd1fb454b1df5f3cd663720a4e1ebb3fd0b690
3
+ metadata.gz: 7f5f8e1fc691a3e740ded9d5e84c646ff95fafeb3b414a57cafcbd8e7afac4ea
4
+ data.tar.gz: a2d795a1f147cce99ac1e00ebfb471428c7112521f25f469cd24d186eb4f2dd0
5
5
  SHA512:
6
- metadata.gz: c328834aacb892e790e9bcb49698e68410652370acda9860ccb959fd69238bc5bfa048ccd96e785e195d3608055c69fedd2d6d0990acfa3ce2f63e190cc3684d
7
- data.tar.gz: 5aeb5a695e025cef8dbb019f90413d8f97e8918ce5ae2712fe65867c1efc85de9f83a3dc5a82693b6fcf68206d83ce9eaa69e960f85fcd0774edae2582a514e6
6
+ metadata.gz: 814c631c00744632ac7428e54fdde2491642de2e0232338a88765b00a3c46e453fa068eaeccdedfa93f734bbf86b2b583396f2d138314dbaeaef73abf10ad3fb
7
+ data.tar.gz: 7ca000aecb5785ca287eee4da0caf61bac96e828e2902d27c29ab93219dfe7744ea7b09a0fc594f39484e3dab896b3d582858723359fbcef6b4a1b6b5aeb91fe
data/README.md CHANGED
@@ -33,13 +33,13 @@ Make instrumentation
33
33
 
34
34
  ```ruby
35
35
  Utrace.new_span('slow-query') do
36
- Utrace.add_attrs({user_id: 123})
37
- Utrace.log_event('step-1-start')
36
+ Utrace.attrs({user_id: 123})
37
+ Utrace.event('step-1-start')
38
38
  # ...
39
- Utrace.log_event('step-2-start')
39
+ Utrace.event('step-2-start')
40
40
  # ...
41
41
  rescue => e
42
- Utrace.log_error(e)
42
+ Utrace.error(e)
43
43
  end
44
44
  ```
45
45
 
data/lib/utrace/none.rb CHANGED
@@ -1,6 +1,12 @@
1
1
  module Utrace
2
2
  class None
3
- def new_span(name, &block); end
3
+ def new_span(name, &block)
4
+ block.call
5
+ end
6
+
7
+ def untraced(&block)
8
+ block.call
9
+ end
4
10
 
5
11
  def event(name, attrs: nil); end
6
12
 
data/lib/utrace/otel.rb CHANGED
@@ -8,6 +8,10 @@ module Utrace
8
8
  @tracer.in_span(name.to_s) { |_span| block.call }
9
9
  end
10
10
 
11
+ def untraced(&block)
12
+ ::OpenTelemetry::Common::Utilities.untraced(&block)
13
+ end
14
+
11
15
  def event(name, attrs: nil)
12
16
  ::OpenTelemetry::Trace.current_span.add_event(name, attributes: validate_attrs(attrs))
13
17
  end
@@ -1,3 +1,3 @@
1
1
  module Utrace
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/utrace.rb CHANGED
@@ -15,6 +15,10 @@ module Utrace
15
15
  instance.new_span(name, &block)
16
16
  end
17
17
 
18
+ def untraced(&block)
19
+ instance.untraced(&block)
20
+ end
21
+
18
22
  def event(name, attrs: nil)
19
23
  instance.event(name, attrs: attrs)
20
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utrace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ken
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-08 00:00:00.000000000 Z
11
+ date: 2024-10-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: