opentelemetry-metrics-api 0.1.0 → 0.1.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +6 -2
- data/lib/opentelemetry/metrics/instrument/counter.rb +1 -1
- data/lib/opentelemetry/metrics/instrument/histogram.rb +1 -1
- data/lib/opentelemetry/metrics/instrument/up_down_counter.rb +1 -1
- data/lib/opentelemetry/metrics/meter.rb +0 -13
- data/lib/opentelemetry/metrics/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6232b4090e467e0d9f7933342d5a1a9634a41186222306214d889b5c211af55c
|
|
4
|
+
data.tar.gz: 6e52fe54891237e36ef39fcd29ef035772051f1a54e18b67270369af8a06f352
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cf96e7239ee84437c1b4389b763b3f80f7882c8d9e29b2db94f7bd0bb9c1cfbd8475a0cb75712e8c916833a3cc184c4028f95996905dd3d2fddec13a8999d9a3
|
|
7
|
+
data.tar.gz: 6d048b7a1622e36a791cf5e64f104f8a75faa3a9248495bd528ad7089fa6f2d685aa5f9f52026e92366b11aa4faefabe5f18cde5262d35df39fbc7f98092c5ca
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -12,7 +12,11 @@ OpenTelemetry provides a single set of APIs, libraries, agents, and collector se
|
|
|
12
12
|
|
|
13
13
|
The `opentelemetry-metrics-api` gem defines the core OpenTelemetry interfaces in the form of abstract classes and no-op implementations. That is, it defines interfaces and data types sufficient for a library or application to code against to produce telemetry data, but does not actually collect, analyze, or export the data.
|
|
14
14
|
|
|
15
|
-
To collect and analyze telemetry data, _applications_ should also
|
|
15
|
+
To collect and analyze telemetry data, _applications_ should also
|
|
16
|
+
install a concrete implementation of the API, such as the
|
|
17
|
+
`opentelemetry-metrics-sdk` gem. However, _libraries_ that produce
|
|
18
|
+
telemetry data should depend only on `opentelemetry-metrics-api`,
|
|
19
|
+
deferring the choice of concrete implementation to the application developer.
|
|
16
20
|
|
|
17
21
|
This code is still under development and is not a complete implementation of the Metrics API. Until the code becomes stable, Metrics API functionality will live outside the `opentelemetry-api` library.
|
|
18
22
|
|
|
@@ -20,7 +24,7 @@ This code is still under development and is not a complete implementation of the
|
|
|
20
24
|
|
|
21
25
|
Install the gem using:
|
|
22
26
|
|
|
23
|
-
```
|
|
27
|
+
```sh
|
|
24
28
|
gem install opentelemetry-metrics-api
|
|
25
29
|
```
|
|
26
30
|
|
|
@@ -16,7 +16,7 @@ module OpenTelemetry
|
|
|
16
16
|
# Values must be non-nil and (array of) string, boolean or numeric type.
|
|
17
17
|
# Array values must not contain nil elements and all elements must be of
|
|
18
18
|
# the same basic type (string, numeric, boolean).
|
|
19
|
-
def add(increment, attributes:
|
|
19
|
+
def add(increment, attributes: {}); end
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
end
|
|
@@ -16,7 +16,7 @@ module OpenTelemetry
|
|
|
16
16
|
# Values must be non-nil and (array of) string, boolean or numeric type.
|
|
17
17
|
# Array values must not contain nil elements and all elements must be of
|
|
18
18
|
# the same basic type (string, numeric, boolean).
|
|
19
|
-
def record(amount, attributes:
|
|
19
|
+
def record(amount, attributes: {}); end
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
end
|
|
@@ -16,7 +16,7 @@ module OpenTelemetry
|
|
|
16
16
|
# Values must be non-nil and (array of) string, boolean or numeric type.
|
|
17
17
|
# Array values must not contain nil elements and all elements must be of
|
|
18
18
|
# the same basic type (string, numeric, boolean).
|
|
19
|
-
def add(amount, attributes:
|
|
19
|
+
def add(amount, attributes: {}); end
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
end
|
|
@@ -15,8 +15,6 @@ module OpenTelemetry
|
|
|
15
15
|
UP_DOWN_COUNTER = Instrument::UpDownCounter.new
|
|
16
16
|
OBSERVABLE_UP_DOWN_COUNTER = Instrument::ObservableUpDownCounter.new
|
|
17
17
|
|
|
18
|
-
NAME_REGEX = /\A[a-zA-Z][-.\w]{0,62}\z/
|
|
19
|
-
|
|
20
18
|
private_constant(:COUNTER, :OBSERVABLE_COUNTER, :HISTOGRAM, :OBSERVABLE_GAUGE, :UP_DOWN_COUNTER, :OBSERVABLE_UP_DOWN_COUNTER)
|
|
21
19
|
|
|
22
20
|
DuplicateInstrumentError = Class.new(OpenTelemetry::Error)
|
|
@@ -56,23 +54,12 @@ module OpenTelemetry
|
|
|
56
54
|
private
|
|
57
55
|
|
|
58
56
|
def create_instrument(kind, name, unit, description, callback)
|
|
59
|
-
raise InstrumentNameError if name.nil?
|
|
60
|
-
raise InstrumentNameError if name.empty?
|
|
61
|
-
raise InstrumentNameError unless NAME_REGEX.match?(name)
|
|
62
|
-
raise InstrumentUnitError if unit && (!unit.ascii_only? || unit.size > 63)
|
|
63
|
-
raise InstrumentDescriptionError if description && (description.size > 1023 || !utf8mb3_encoding?(description.dup))
|
|
64
|
-
|
|
65
57
|
@mutex.synchronize do
|
|
66
58
|
OpenTelemetry.logger.warn("duplicate instrument registration occurred for instrument #{name}") if @instrument_registry.include? name
|
|
67
59
|
|
|
68
60
|
@instrument_registry[name] = yield
|
|
69
61
|
end
|
|
70
62
|
end
|
|
71
|
-
|
|
72
|
-
def utf8mb3_encoding?(string)
|
|
73
|
-
string.force_encoding('UTF-8').valid_encoding? &&
|
|
74
|
-
string.each_char { |c| return false if c.bytesize >= 4 }
|
|
75
|
-
end
|
|
76
63
|
end
|
|
77
64
|
end
|
|
78
65
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opentelemetry-metrics-api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.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-10-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: opentelemetry-api
|
|
@@ -114,14 +114,14 @@ dependencies:
|
|
|
114
114
|
requirements:
|
|
115
115
|
- - "~>"
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: 1.
|
|
117
|
+
version: '1.65'
|
|
118
118
|
type: :development
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
122
|
- - "~>"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: 1.
|
|
124
|
+
version: '1.65'
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
126
|
name: simplecov
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -195,10 +195,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
|
|
|
195
195
|
licenses:
|
|
196
196
|
- Apache-2.0
|
|
197
197
|
metadata:
|
|
198
|
-
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-api/v0.1.
|
|
198
|
+
changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-api/v0.1.1/file.CHANGELOG.html
|
|
199
199
|
source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/metrics_api
|
|
200
200
|
bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
|
|
201
|
-
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-api/v0.1.
|
|
201
|
+
documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-metrics-api/v0.1.1
|
|
202
202
|
post_install_message:
|
|
203
203
|
rdoc_options: []
|
|
204
204
|
require_paths:
|