opentelemetry-metrics-sdk 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab6bcf236973bf3076b7ed474af0b5f6d1800109b50ea962ee30e5c26e8e2939
4
- data.tar.gz: 98b5732131f76d66d2a8aa9dec222540d46bcde1c505611838dac389c84633f2
3
+ metadata.gz: a74df1307dfb40dbdaf08d87781c35d2736916d94ae06eef45b3237b3ba38631
4
+ data.tar.gz: 3a108b46150f768890f6cef2acd49557d83331cc4a84613b8c7de38861cfebdb
5
5
  SHA512:
6
- metadata.gz: 2e67ddd388122be3e244bfb72089fc22df9c00e7f0ccbe1d7407cfa666c91e5eee65056b5430cc35ae034bf8d55073c6b24848736afcd38d06b7a4e07e757154
7
- data.tar.gz: 967900597a808f03bfc221773a5c5095fa4f8ea0f94b1cae2b4c30ed16e2e30c4e49d8bda30774a63b924cf836f50d1d3a68bdc589b9455de3588a57846859ea
6
+ metadata.gz: 2b168a69a35cee4b798cf9195b0af540d79b2b9cbb687dd98abe295a517e38683fce1976a7028ab822f8e5aec3157b53043ed9ddbb436cf5a2f25101ddc50b61
7
+ data.tar.gz: a06ace144467243b00a4d19bec891d66d55f3da2c611d4569e393b805d31979ab47eed39dbb86d4b9d508519b69ce2f827acb3281c446d83fe8201a6e84150fe
data/CHANGELOG.md CHANGED
@@ -1,26 +1,31 @@
1
1
  # Release History: opentelemetry-metrics-sdk
2
2
 
3
+ ### v0.6.0 / 2025-02-25
4
+
5
+ - ADDED: Support 3.1 Min Version
6
+ - FIXED: Add is_monotonic flag to sum
7
+
3
8
  ### v0.5.0 / 2025-01-08
4
9
 
5
- * ADDED: Add synchronous gauge
10
+ - ADDED: Add synchronous gauge
6
11
 
7
12
  ### v0.4.1 / 2024-12-04
8
13
 
9
- * FIXED: Handle float value in NumberDataPoint
14
+ - FIXED: Handle float value in NumberDataPoint
10
15
 
11
16
  ### v0.4.0 / 2024-11-20
12
17
 
13
- * ADDED: Update metrics configuration patch
18
+ - ADDED: Update metrics configuration patch
14
19
 
15
20
  ### v0.3.0 / 2024-10-22
16
21
 
17
- * ADDED: Add basic metrics view
18
- * FIXED: Coerce aggregation_temporality to symbol
19
- * FIXED: Add warning if invalid meter name given
22
+ - ADDED: Add basic metrics view
23
+ - FIXED: Coerce aggregation_temporality to symbol
24
+ - FIXED: Add warning if invalid meter name given
20
25
 
21
26
  ### v0.2.0 / 2024-08-27
22
27
 
23
- * ADDED: Add basic periodic exporting metric_reader
28
+ - ADDED: Add basic periodic exporting metric_reader
24
29
 
25
30
  ### v0.1.0 / 2024-07-31
26
31
 
data/README.md CHANGED
@@ -25,6 +25,7 @@ At this time, you should be able to:
25
25
  * observable up down counters
26
26
  * Export using a pull exporter
27
27
  * Use delta aggregation temporality
28
+ * Periodic Exporting Metric Reader
28
29
 
29
30
  We do not yet have support for:
30
31
 
@@ -32,7 +33,6 @@ We do not yet have support for:
32
33
  * Cumulative aggregation temporality
33
34
  * Metrics Views
34
35
  * Metrics Exemplars
35
- * Periodic Exporting Metric Reader
36
36
  * Push metric exporting
37
37
 
38
38
  These lists are incomplete and are intended to give a broad description of what's available.
@@ -13,9 +13,10 @@ module OpenTelemetry
13
13
  class Sum
14
14
  attr_reader :aggregation_temporality
15
15
 
16
- def initialize(aggregation_temporality: ENV.fetch('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE', :delta))
16
+ def initialize(aggregation_temporality: ENV.fetch('OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE', :delta), monotonic: false)
17
17
  # TODO: the default should be :cumulative, see issue #1555
18
18
  @aggregation_temporality = aggregation_temporality.to_sym
19
+ @monotonic = monotonic
19
20
  end
20
21
 
21
22
  def collect(start_time, end_time, data_points)
@@ -38,7 +39,13 @@ module OpenTelemetry
38
39
  end
39
40
  end
40
41
 
42
+ def monotonic?
43
+ @monotonic
44
+ end
45
+
41
46
  def update(increment, attributes, data_points)
47
+ return if @monotonic && increment < 0
48
+
42
49
  ndp = data_points[attributes] || data_points[attributes] = NumberDataPoint.new(
43
50
  attributes,
44
51
  nil,
@@ -42,7 +42,7 @@ module OpenTelemetry
42
42
  private
43
43
 
44
44
  def default_aggregation
45
- OpenTelemetry::SDK::Metrics::Aggregation::Sum.new
45
+ OpenTelemetry::SDK::Metrics::Aggregation::Sum.new(monotonic: true)
46
46
  end
47
47
  end
48
48
  end
@@ -35,7 +35,7 @@ module OpenTelemetry
35
35
  private
36
36
 
37
37
  def default_aggregation
38
- OpenTelemetry::SDK::Metrics::Aggregation::Sum.new
38
+ OpenTelemetry::SDK::Metrics::Aggregation::Sum.new(monotonic: false)
39
39
  end
40
40
  end
41
41
  end
@@ -18,7 +18,8 @@ module OpenTelemetry
18
18
  :data_points, # Hash{Hash{String => String, Numeric, Boolean, Array<String, Numeric, Boolean>} => Numeric}
19
19
  :aggregation_temporality, # Symbol
20
20
  :start_time_unix_nano, # Integer nanoseconds since Epoch
21
- :time_unix_nano) # Integer nanoseconds since Epoch
21
+ :time_unix_nano, # Integer nanoseconds since Epoch
22
+ :is_monotonic) # Boolean
22
23
  end
23
24
  end
24
25
  end
@@ -67,6 +67,8 @@ module OpenTelemetry
67
67
 
68
68
  def aggregate_metric_data(start_time, end_time, aggregation: nil)
69
69
  aggregator = aggregation || @default_aggregation
70
+ is_monotonic = aggregator.respond_to?(:monotonic?) ? aggregator.monotonic? : nil
71
+
70
72
  MetricData.new(
71
73
  @name,
72
74
  @description,
@@ -77,7 +79,8 @@ module OpenTelemetry
77
79
  aggregator.collect(start_time, end_time, @data_points),
78
80
  aggregator.aggregation_temporality,
79
81
  start_time,
80
- end_time
82
+ end_time,
83
+ is_monotonic
81
84
  )
82
85
  end
83
86
 
@@ -8,7 +8,7 @@ module OpenTelemetry
8
8
  module SDK
9
9
  module Metrics
10
10
  # Current OpenTelemetry metrics sdk version
11
- VERSION = '0.5.0'
11
+ VERSION = '0.6.0'
12
12
  end
13
13
  end
14
14
  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.5.0
4
+ version: 0.6.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: 2025-01-09 00:00:00.000000000 Z
11
+ date: 2025-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -240,10 +240,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
240
240
  licenses:
241
241
  - Apache-2.0
242
242
  metadata:
243
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-sdk/v0.5.0/file.CHANGELOG.html
243
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-sdk/v0.6.0/file.CHANGELOG.html
244
244
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/metrics_sdk
245
245
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
246
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-sdk/v0.5.0
246
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-sdk/v0.6.0
247
247
  post_install_message:
248
248
  rdoc_options: []
249
249
  require_paths:
@@ -252,14 +252,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
252
252
  requirements:
253
253
  - - ">="
254
254
  - !ruby/object:Gem::Version
255
- version: '3.0'
255
+ version: '3.1'
256
256
  required_rubygems_version: !ruby/object:Gem::Requirement
257
257
  requirements:
258
258
  - - ">="
259
259
  - !ruby/object:Gem::Version
260
260
  version: '0'
261
261
  requirements: []
262
- rubygems_version: 3.2.33
262
+ rubygems_version: 3.3.27
263
263
  signing_key:
264
264
  specification_version: 4
265
265
  summary: A stats collection and distributed tracing framework