datadog-statsd-schema 0.1.1 → 0.1.2
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/.envrc +2 -0
- data/.rspec +2 -1
- data/.rubocop.yml +6 -0
- data/.rubocop_todo.yml +10 -30
- data/FUTURE_DIRECTION.md +32 -0
- data/README.md +529 -250
- data/Rakefile +7 -7
- data/examples/shared.rb +1 -1
- data/lib/datadog/statsd/emitter.rb +102 -21
- data/lib/datadog/statsd/schema/errors.rb +54 -1
- data/lib/datadog/statsd/schema/metric_definition.rb +86 -3
- data/lib/datadog/statsd/schema/namespace.rb +91 -5
- data/lib/datadog/statsd/schema/schema_builder.rb +162 -4
- data/lib/datadog/statsd/schema/tag_definition.rb +66 -6
- data/lib/datadog/statsd/schema/version.rb +6 -1
- data/lib/datadog/statsd/schema.rb +89 -13
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b0549f4e32e19fdb57a4f521695605ab926c4e3c1ce12c4fe24da3e70c1ff38
|
4
|
+
data.tar.gz: 22ed9111a81191c6cd9a831425da0d188fbf4275aaf34d1e9aaae66950a78b52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27884f768e8c96d997a8fd75a536fb4832c70e589d098ae34338d06b5fa74f8a299c3f289434e053f0b0f5897c0fbb4d996beeb4462a37ec5d2f828ddccc1c8a
|
7
|
+
data.tar.gz: 8be4946e617d0b3a3a10da1d70b87184d16649257eb78e98337295fe1e6f7a37d58e04276fadaf917eeb3d5c368f82182aaf645dde15fb71b9f8b137032f2010
|
data/.envrc
ADDED
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2025-
|
3
|
+
# on 2025-06-06 05:09:15 UTC using RuboCop version 1.75.8.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -24,20 +24,20 @@ Lint/FloatComparison:
|
|
24
24
|
Exclude:
|
25
25
|
- 'lib/datadog/statsd/emitter.rb'
|
26
26
|
|
27
|
-
# Offense count:
|
27
|
+
# Offense count: 9
|
28
28
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
29
29
|
Metrics/AbcSize:
|
30
|
-
Max:
|
30
|
+
Max: 54
|
31
31
|
|
32
32
|
# Offense count: 4
|
33
33
|
# Configuration parameters: CountComments, CountAsOne.
|
34
34
|
Metrics/ClassLength:
|
35
|
-
Max:
|
35
|
+
Max: 369
|
36
36
|
|
37
37
|
# Offense count: 6
|
38
38
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
39
39
|
Metrics/CyclomaticComplexity:
|
40
|
-
Max:
|
40
|
+
Max: 20
|
41
41
|
|
42
42
|
# Offense count: 5
|
43
43
|
# Configuration parameters: CountComments, CountAsOne.
|
@@ -47,12 +47,12 @@ Metrics/ModuleLength:
|
|
47
47
|
# Offense count: 2
|
48
48
|
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
|
49
49
|
Metrics/ParameterLists:
|
50
|
-
Max:
|
50
|
+
Max: 8
|
51
51
|
|
52
52
|
# Offense count: 5
|
53
53
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
54
54
|
Metrics/PerceivedComplexity:
|
55
|
-
Max:
|
55
|
+
Max: 19
|
56
56
|
|
57
57
|
# Offense count: 3
|
58
58
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
@@ -91,7 +91,7 @@ RSpec/ContextWording:
|
|
91
91
|
# Offense count: 15
|
92
92
|
# Configuration parameters: CountAsOne.
|
93
93
|
RSpec/ExampleLength:
|
94
|
-
Max:
|
94
|
+
Max: 20
|
95
95
|
|
96
96
|
# Offense count: 4
|
97
97
|
# Configuration parameters: Max, AllowedIdentifiers, AllowedPatterns.
|
@@ -134,20 +134,6 @@ RSpec/VerifiedDoubles:
|
|
134
134
|
- 'spec/datadog/statsd/schema/metric_definition_spec.rb'
|
135
135
|
- 'spec/datadog/statsd/schema_spec.rb'
|
136
136
|
|
137
|
-
# Offense count: 8
|
138
|
-
# Configuration parameters: AllowedConstants.
|
139
|
-
Style/Documentation:
|
140
|
-
Exclude:
|
141
|
-
- 'spec/**/*'
|
142
|
-
- 'test/**/*'
|
143
|
-
- 'lib/datadog/statsd/emitter.rb'
|
144
|
-
- 'lib/datadog/statsd/schema.rb'
|
145
|
-
- 'lib/datadog/statsd/schema/errors.rb'
|
146
|
-
- 'lib/datadog/statsd/schema/metric_definition.rb'
|
147
|
-
- 'lib/datadog/statsd/schema/namespace.rb'
|
148
|
-
- 'lib/datadog/statsd/schema/schema_builder.rb'
|
149
|
-
- 'lib/datadog/statsd/schema/tag_definition.rb'
|
150
|
-
|
151
137
|
# Offense count: 1
|
152
138
|
# This cop supports unsafe autocorrection (--autocorrect-all).
|
153
139
|
# Configuration parameters: EnforcedStyle.
|
@@ -171,10 +157,11 @@ Style/HashLikeCase:
|
|
171
157
|
Exclude:
|
172
158
|
- 'spec/datadog/statsd/schema/schema_builder_spec.rb'
|
173
159
|
|
174
|
-
# Offense count:
|
160
|
+
# Offense count: 4
|
175
161
|
# This cop supports safe autocorrection (--autocorrect).
|
176
162
|
Style/IfUnlessModifier:
|
177
163
|
Exclude:
|
164
|
+
- 'examples/shared.rb'
|
178
165
|
- 'lib/datadog/statsd/emitter.rb'
|
179
166
|
|
180
167
|
# Offense count: 1
|
@@ -218,10 +205,3 @@ Style/SymbolProc:
|
|
218
205
|
Exclude:
|
219
206
|
- 'spec/datadog/statsd/schema/schema_builder_spec.rb'
|
220
207
|
- 'spec/datadog/statsd/schema_spec.rb'
|
221
|
-
|
222
|
-
# Offense count: 4
|
223
|
-
# This cop supports safe autocorrection (--autocorrect).
|
224
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
225
|
-
# URISchemes: http, https
|
226
|
-
Layout/LineLength:
|
227
|
-
Max: 140
|
data/FUTURE_DIRECTION.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Future Direction
|
2
|
+
|
3
|
+
## Small Features & Improvements
|
4
|
+
|
5
|
+
* Validation mode: raise or log the error, but send the non-compliant metric anyway (good for migrations from raw statsd to `emitter`)
|
6
|
+
|
7
|
+
## Large Features / Stories
|
8
|
+
|
9
|
+
<dt>"The Service Registry" gem — <code>datadog-statsd-registry</code></dt>
|
10
|
+
<dd>The gem would use <code>self.inherited</code> hook to auto-register each emitter and each schema in the global registry, to be recallable and searchable anywhere in the application code. This would encourage possible pre-declaration of most key emitters in a single initializer file, while still allowing ad-hoc creation, that does not get attached to the registry and will be garbage collected. Emitters are largely just a pre-determined combination of tags and a metric prefix, with a schema of allowable metrics and tags. It could be beneficial to reuse say <code>@email_stats_emitter</code> among multiple mailers in the system, but how to you get then to share an instance without some sort of a registry or IoC? Have schema and emmitter instances register by name in the global application space.<br/><br />
|
11
|
+
|
12
|
+
Example:
|
13
|
+
<pre>
|
14
|
+
emitter = Datadog::Statsd.registry[:email_emitter]
|
15
|
+
emitter.increment('total')
|
16
|
+
</pre>
|
17
|
+
</dd>
|
18
|
+
|
19
|
+
<dt>Ensure Thread Safety for Emitter</dt>
|
20
|
+
<dd>If emitters are to be shared, they necessarily must be thread safe, as should be the underlying <code>Datadog::Statsd</code></dd>
|
21
|
+
|
22
|
+
### Multi-Gem Design
|
23
|
+
|
24
|
+
* Split `Datadog::Statsd::Emitter` class into its own gem, eg `datadog-statsd-emitter` without the schema. Allow emitter to receive a validator proc for extensions.
|
25
|
+
* Make this schema gem a validation extension to the emitter gem.
|
26
|
+
|
27
|
+
Allow in the end a mix-match of:
|
28
|
+
* `datadog-statsd-emitter`
|
29
|
+
* `datadog-statsd-registry`
|
30
|
+
* `datadog-statsd-schema`
|
31
|
+
|
32
|
+
|