opentelemetry-metrics-sdk 0.3.0 → 0.4.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45746399ac9cf72000a4a5531a1bb151731fd6fcb3354385d8821a6d9b109cce
|
4
|
+
data.tar.gz: 7da59da17348fc19abb319da95964a5902154b54eab28ca54166f971e3d366ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8a0095dda549fea543c7049e5cf228809ae5f67e449c6a1d11933fb1f1849b10a06200682c4fd52b016e9dc4ff2159236abeec9120d5997e56b76f34f6d11f7
|
7
|
+
data.tar.gz: 858df23a2dac33a1567a78aec7b6fac4c6afa02f274e8e5b2828d329f4073aa51cfe15277161be87fcc33402828fe20d9bc9f25b6ad2ac1999bb117a9a2fdac3
|
data/CHANGELOG.md
CHANGED
@@ -10,12 +10,47 @@ module OpenTelemetry
|
|
10
10
|
# The ConfiguratorPatch implements a hook to configure the metrics
|
11
11
|
# portion of the SDK.
|
12
12
|
module ConfiguratorPatch
|
13
|
+
def add_metric_reader(metric_reader)
|
14
|
+
@metric_readers << metric_reader
|
15
|
+
end
|
16
|
+
|
13
17
|
private
|
14
18
|
|
15
|
-
|
16
|
-
|
19
|
+
def initialize
|
20
|
+
super
|
21
|
+
@metric_readers = []
|
22
|
+
end
|
23
|
+
|
24
|
+
# The metrics_configuration_hook method is where we define the setup process for the metrics SDK.
|
17
25
|
def metrics_configuration_hook
|
18
26
|
OpenTelemetry.meter_provider = Metrics::MeterProvider.new(resource: @resource)
|
27
|
+
configure_metric_readers
|
28
|
+
end
|
29
|
+
|
30
|
+
def configure_metric_readers
|
31
|
+
readers = @metric_readers.empty? ? wrapped_metric_exporters_from_env.compact : @metric_readers
|
32
|
+
readers.each { |r| OpenTelemetry.meter_provider.add_metric_reader(r) }
|
33
|
+
end
|
34
|
+
|
35
|
+
def wrapped_metric_exporters_from_env
|
36
|
+
exporters = ENV.fetch('OTEL_METRICS_EXPORTER', 'otlp')
|
37
|
+
exporters.split(',').map do |exporter|
|
38
|
+
case exporter.strip
|
39
|
+
when 'none' then nil
|
40
|
+
when 'console' then OpenTelemetry.meter_provider.add_metric_reader(Metrics::Export::PeriodicMetricReader.new(exporter: Metrics::Export::ConsoleMetricPullExporter.new))
|
41
|
+
when 'in-memory' then OpenTelemetry.meter_provider.add_metric_reader(Metrics::Export::InMemoryMetricPullExporter.new)
|
42
|
+
when 'otlp'
|
43
|
+
begin
|
44
|
+
OpenTelemetry.meter_provider.add_metric_reader(Metrics::Export::PeriodicMetricReader.new(exporter: OpenTelemetry::Exporter::OTLP::Metrics::MetricsExporter.new))
|
45
|
+
rescue NameError
|
46
|
+
OpenTelemetry.logger.warn 'The otlp metrics exporter cannot be configured - please add opentelemetry-exporter-otlp-metrics to your Gemfile, metrics will not be exported'
|
47
|
+
nil
|
48
|
+
end
|
49
|
+
else
|
50
|
+
OpenTelemetry.logger.warn "The #{exporter} exporter is unknown and cannot be configured, metrics will not be exported"
|
51
|
+
nil
|
52
|
+
end
|
53
|
+
end
|
19
54
|
end
|
20
55
|
end
|
21
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opentelemetry-metrics-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.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: 2024-
|
11
|
+
date: 2024-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opentelemetry-api
|
@@ -239,10 +239,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
239
239
|
licenses:
|
240
240
|
- Apache-2.0
|
241
241
|
metadata:
|
242
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-sdk/v0.
|
242
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-sdk/v0.4.0/file.CHANGELOG.html
|
243
243
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/metrics_sdk
|
244
244
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
245
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-sdk/v0.
|
245
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-sdk/v0.4.0
|
246
246
|
post_install_message:
|
247
247
|
rdoc_options: []
|
248
248
|
require_paths:
|