opentelemetry-api 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/opentelemetry.rb +15 -1
- data/lib/opentelemetry/instrumentation/registry.rb +1 -2
- data/lib/opentelemetry/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7c58fd79dce24997ec350919d59c831940d6604acea611b2a0be72177f0b692
|
4
|
+
data.tar.gz: a0c08af587e1002da839ff0f4d9860f528256fbb3dbba3b885c0494f06c71b95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3988fc0200883dadf62a8623d6c727d032c6648c2bc4e860cac0e3f7ae3e8bacc6a0c8a05638272cbf24d254cfaf3723bfdb2564e306bb99e029d1f88860d5d4
|
7
|
+
data.tar.gz: 183d0203693f3585a153992582aee24e7df9ce3afc66ba536dd3dcfc7295ca00226b3cb02f468fa9ce17fce2dc6b5a54523c5cfba4b79c87d8f879255d6a34e1
|
data/CHANGELOG.md
CHANGED
data/lib/opentelemetry.rb
CHANGED
@@ -22,13 +22,27 @@ require 'opentelemetry/version'
|
|
22
22
|
module OpenTelemetry
|
23
23
|
extend self
|
24
24
|
|
25
|
-
attr_writer :tracer_provider, :meter_provider, :baggage, :logger
|
25
|
+
attr_writer :tracer_provider, :meter_provider, :baggage, :logger, :error_handler
|
26
26
|
|
27
27
|
# @return [Object, Logger] configured Logger or a default STDOUT Logger.
|
28
28
|
def logger
|
29
29
|
@logger ||= Logger.new(STDOUT, level: ENV['OTEL_LOG_LEVEL'] || Logger::INFO)
|
30
30
|
end
|
31
31
|
|
32
|
+
# @return [Callable] configured error handler or a default that logs the
|
33
|
+
# exception and message at ERROR level.
|
34
|
+
def error_handler
|
35
|
+
@error_handler ||= ->(exception: nil, message: nil) { logger.error("OpenTelemetry error: #{[message, exception&.message].compact.join(' - ')}") }
|
36
|
+
end
|
37
|
+
|
38
|
+
# Handles an error by calling the configured error_handler.
|
39
|
+
#
|
40
|
+
# @param [optional Exception] exception The exception to be handled
|
41
|
+
# @param [optional String] message An error message.
|
42
|
+
def handle_error(exception: nil, message: nil)
|
43
|
+
error_handler.call(exception: exception, message: message)
|
44
|
+
end
|
45
|
+
|
32
46
|
# @return [Object, Trace::TracerProvider] registered tracer provider or a
|
33
47
|
# default no-op implementation of the tracer provider.
|
34
48
|
def tracer_provider
|
@@ -79,8 +79,7 @@ module OpenTelemetry
|
|
79
79
|
OpenTelemetry.logger.warn "Instrumentation: #{instrumentation.name} failed to install"
|
80
80
|
end
|
81
81
|
rescue => e # rubocop:disable Style/RescueStandardError
|
82
|
-
OpenTelemetry.
|
83
|
-
"during install #{e}: #{e.backtrace}"
|
82
|
+
OpenTelemetry.handle_error(exception: e, message: "Instrumentation: #{instrumentation.name} unhandled exception during install: #{e.backtrace}")
|
84
83
|
end
|
85
84
|
end
|
86
85
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OpenTelemetry Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: benchmark-ipsa
|
@@ -196,10 +196,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
196
196
|
licenses:
|
197
197
|
- Apache-2.0
|
198
198
|
metadata:
|
199
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v0.
|
199
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v0.12.0/file.CHANGELOG.html
|
200
200
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/master/api
|
201
201
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
202
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v0.
|
202
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-api/v0.12.0
|
203
203
|
post_install_message:
|
204
204
|
rdoc_options: []
|
205
205
|
require_paths:
|