traces 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/traces/backend/capture.rb +5 -0
- data/lib/traces/backend/console.rb +5 -0
- data/lib/traces/backend/test.rb +5 -0
- data/lib/traces/backend.rb +6 -0
- data/lib/traces/config.rb +1 -3
- data/lib/traces/provider.rb +2 -0
- data/lib/traces/version.rb +1 -1
- data/readme.md +1 -1
- data/releases.md +3 -3
- data.tar.gz.sig +0 -0
- metadata +3 -8
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5540f65335aab146d74616bfb46fe0119e93134ad8b3c241bfa97c31319d274
|
4
|
+
data.tar.gz: f4a13424f6035a3a11d1a3b5129123c391a3e3738a6a1594af83c17572d2410b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79f27a7a1e2fff3bfba6c17d933f957ae981778b9696c030f86cd12d08a0709ebc40a31b9812f2042d7bb3115bee52405f8eb27ec4a11e94032fa83d8302c39a
|
7
|
+
data.tar.gz: 277a0b1427ee998fb017d8043d550aabde68371481395ff0b1b1a6733f6a80136889d9e3e934897059fa69bd32b11c1f30fa3598be4443933f9563f746dfc9cb
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/traces/backend/test.rb
CHANGED
data/lib/traces/backend.rb
CHANGED
@@ -10,5 +10,11 @@ module Traces
|
|
10
10
|
module Backend
|
11
11
|
end
|
12
12
|
|
13
|
+
# This is a default implementation, which can be replaced by the backend.
|
14
|
+
# @returns [Boolean] Whether there is an active trace.
|
15
|
+
def self.active?
|
16
|
+
!!self.trace_context
|
17
|
+
end
|
18
|
+
|
13
19
|
Config::DEFAULT.require_backend
|
14
20
|
end
|
data/lib/traces/config.rb
CHANGED
@@ -38,12 +38,10 @@ module Traces
|
|
38
38
|
if require(backend)
|
39
39
|
Traces.extend(Backend::Interface)
|
40
40
|
|
41
|
-
self.prepare
|
42
|
-
|
43
41
|
return true
|
44
42
|
end
|
45
43
|
rescue LoadError => error
|
46
|
-
|
44
|
+
warn "Unable to load traces backend: #{backend.inspect}!"
|
47
45
|
end
|
48
46
|
end
|
49
47
|
|
data/lib/traces/provider.rb
CHANGED
data/lib/traces/version.rb
CHANGED
data/readme.md
CHANGED
@@ -25,7 +25,7 @@ Please see the [project releases](https://socketry.github.io/traces/releases/ind
|
|
25
25
|
|
26
26
|
### v0.14.0
|
27
27
|
|
28
|
-
- [Introduce `Traces::Config` to
|
28
|
+
- [Introduce `Traces::Config` to Expose `prepare` Hook](https://socketry.github.io/traces/releases/index#introduce-traces::config-to-expose-prepare-hook)
|
29
29
|
|
30
30
|
## Contributing
|
31
31
|
|
data/releases.md
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
## v0.14.0
|
4
4
|
|
5
|
-
### Introduce `Traces::Config` to
|
5
|
+
### Introduce `Traces::Config` to Expose `prepare` Hook
|
6
6
|
|
7
|
-
|
7
|
+
The `traces` gem uses aspect-oriented programming to wrap existing methods to emit traces. However, while there are some reasonable defaults for emitting traces, it can be useful to customize the behavior and level of detail. To that end, the `traces` gem now optionally loads a `config/traces.rb` which includes a `prepare` hook that can be used to load additional providers.
|
8
8
|
|
9
9
|
``` ruby
|
10
10
|
# config/traces.rb
|
@@ -15,4 +15,4 @@ def prepare
|
|
15
15
|
end
|
16
16
|
```
|
17
17
|
|
18
|
-
The `prepare` method is called
|
18
|
+
The `prepare` method is called immediately after the traces backend is loaded. You can require any provider you want in this file, or even add your own custom providers.
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: traces
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
- Felix Yan
|
9
|
-
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain:
|
12
11
|
- |
|
@@ -38,10 +37,8 @@ cert_chain:
|
|
38
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
39
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
40
39
|
-----END CERTIFICATE-----
|
41
|
-
date:
|
40
|
+
date: 2025-01-31 00:00:00.000000000 Z
|
42
41
|
dependencies: []
|
43
|
-
description:
|
44
|
-
email:
|
45
42
|
executables: []
|
46
43
|
extensions: []
|
47
44
|
extra_rdoc_files: []
|
@@ -64,7 +61,6 @@ licenses:
|
|
64
61
|
metadata:
|
65
62
|
documentation_uri: https://socketry.github.io/traces/
|
66
63
|
source_code_uri: https://github.com/socketry/traces.git
|
67
|
-
post_install_message:
|
68
64
|
rdoc_options: []
|
69
65
|
require_paths:
|
70
66
|
- lib
|
@@ -79,8 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
75
|
- !ruby/object:Gem::Version
|
80
76
|
version: '0'
|
81
77
|
requirements: []
|
82
|
-
rubygems_version: 3.
|
83
|
-
signing_key:
|
78
|
+
rubygems_version: 3.6.2
|
84
79
|
specification_version: 4
|
85
80
|
summary: Application instrumentation and tracing.
|
86
81
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|