opentelemetry-metrics-sdk 0.3.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/opentelemetry/sdk/metrics/aggregation/explicit_bucket_histogram.rb +0 -1
- data/lib/opentelemetry/sdk/metrics/aggregation/histogram_data_point.rb +1 -1
- data/lib/opentelemetry/sdk/metrics/aggregation/number_data_point.rb +1 -1
- data/lib/opentelemetry/sdk/metrics/configuration_patch.rb +37 -2
- data/lib/opentelemetry/sdk/metrics/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: 65d8c5195153d2f5a5935ada32ad8045eec7d2aa867876fe98dedf48ccc42a6a
|
4
|
+
data.tar.gz: 2108b549a5eab96b9185eb45293074db155bd64554623c6d49921cb11ed0bea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc5a6f9d822abc4ddb9e77d558ed21391fa68823248db02452436a53d4e82294c7f7dba04887c782d7f9e01e12514db70cde8b2bd73ef85ddc6b6753fa8bca52
|
7
|
+
data.tar.gz: 17ac61e347fca948a49637d9699899ed16217a7bb06854f7451fbfc303fa8c553b43134c02a489cad06d0a4229694ecb8618080250c916297ec98ab5a7e2db2d
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Release History: opentelemetry-metrics-sdk
|
2
2
|
|
3
|
+
### v0.4.1 / 2024-12-04
|
4
|
+
|
5
|
+
* FIXED: Handle float value in NumberDataPoint
|
6
|
+
|
7
|
+
### v0.4.0 / 2024-11-20
|
8
|
+
|
9
|
+
* ADDED: Update metrics configuration patch
|
10
|
+
|
3
11
|
### v0.3.0 / 2024-10-22
|
4
12
|
|
5
13
|
* ADDED: Add basic metrics view
|
@@ -14,7 +14,7 @@ module OpenTelemetry
|
|
14
14
|
:start_time_unix_nano, # Integer nanoseconds since Epoch
|
15
15
|
:time_unix_nano, # Integer nanoseconds since Epoch
|
16
16
|
:count, # Integer count is the number of values in the population. Must be non-negative.
|
17
|
-
:sum, #
|
17
|
+
:sum, # Float sum of the values in the population. If count is zero then this field must be zero.
|
18
18
|
:bucket_counts, # optional Array[Integer] field contains the count values of histogram for each bucket.
|
19
19
|
:explicit_bounds, # Array[Float] specifies buckets with explicitly defined bounds for values.
|
20
20
|
:exemplars, # optional List of exemplars collected from measurements that were used to form the data point
|
@@ -11,7 +11,7 @@ module OpenTelemetry
|
|
11
11
|
NumberDataPoint = Struct.new(:attributes, # Hash{String => String, Numeric, Boolean, Array<String, Numeric, Boolean>}
|
12
12
|
:start_time_unix_nano, # Integer nanoseconds since Epoch
|
13
13
|
:time_unix_nano, # Integer nanoseconds since Epoch
|
14
|
-
:value, #
|
14
|
+
:value, # Numeric
|
15
15
|
:exemplars) # optional List of exemplars collected from measurements that were used to form the data point
|
16
16
|
end
|
17
17
|
end
|
@@ -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.1
|
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-12-05 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.1/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.1
|
246
246
|
post_install_message:
|
247
247
|
rdoc_options: []
|
248
248
|
require_paths:
|