Skip to content

Commit 7b5cd45

Browse files
authored
Command to validate metadata (DataDog#2269)
* added metadata validation command * changed command from validate to metadata, more validations * added metadata verify to travis * refactor, fix unicode handling * refactor, reflect errors in exit code * add validation for unit names too * address metric_prefix comments * short_name is optional * fixed metadata validations * changed description field to recommended optional field * fixed new lines at end of file
1 parent 8c9c8c8 commit 7b5cd45

File tree

16 files changed

+382
-16
lines changed

16 files changed

+382
-16
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ jobs:
4545
script:
4646
- ddev dep verify
4747
- ddev manifest verify --include-extras
48+
- ddev metadata verify
4849
- ddev test --cov
4950
- ddev test --bench || true
5051
- stage: test
5152
env: CHECK=datadog_checks_base PYTHON3=true
5253
script:
5354
- ddev dep verify
5455
- ddev manifest verify --include-extras
56+
- ddev metadata verify
5557
- travis_retry ddev test --cov ${CHECK}
5658
- ddev test ${CHECK} --bench || true
5759
- stage: test

consul/metadata.csv

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ consul.runtime.heap_objects,gauge,10,object,,Number of objects allocated on the
2323
consul.runtime.sys_bytes,gauge,10,byte,,Total size of the virtual address space reserved by the Go runtime,0,consul,
2424
consul.runtime.malloc_count,gauge,10,object,,Cumulative count of heap objects allocated,0,consul,
2525
consul.runtime.free_count,gauge,10,object,,Cumulative count of heap objects freed,0,consul,
26-
consul.runtime.heap_objects,gauge,10,byte,,Bytes of allocated heap objects,0,consul,heap alloc
2726
consul.runtime.total_gc_pause_ns,gauge,10,nanosecond,,Cumulative nanoseconds in GC stop-the-world pauses since Consul started,0,consul,
2827
consul.runtime.total_gc_runs,gauge,10,,,Number of completed GC cycles,0,consul,
2928
consul.raft.state.leader,rate,10,event,,Number of completed leader elections,-1,consul,leader elecs

coredns/manifest.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"maintainer": "[email protected]",
33
"manifest_version": "1.0.0",
44
"name": "coredns",
5+
"metric_prefix": "coredns.",
56
"display_name": "CoreDNS",
67
"short_description": "CoreDNS collects DNS metrics in Kubernetes.",
78
"support": "core",

couch/metadata.csv

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ couchdb.couchdb.query_server.vdu_process_time.geometric_mean,gauge,,millisecond,
162162
couchdb.couchdb.query_server.vdu_process_time.harmonic_mean,gauge,,millisecond,,Harmonic_mean of the duration of validate_doc_update function calls,-1,couchdb2,
163163
couchdb.couchdb.query_server.vdu_process_time.median,gauge,,millisecond,,Median of the duration of validate_doc_update function calls,-1,couchdb2,
164164
couchdb.couchdb.query_server.vdu_process_time.variance,gauge,,millisecond,,Variance of the duration of validate_doc_update function calls,-1,couchdb2,
165-
couchdb.couchdb.query_server.vdu_process_time.standard_deviation,gaugemillisecond,,,,Standard_deviation of the duration of validate_doc_update function calls,-1,couchdb2,
165+
couchdb.couchdb.query_server.vdu_process_time.standard_deviation,gauge,,millisecond,,Standard_deviation of the duration of validate_doc_update function calls,-1,couchdb2,
166166
couchdb.couchdb.query_server.vdu_process_time.skewness,gauge,,millisecond,,Skewness of the duration of validate_doc_update function calls,-1,couchdb2,
167167
couchdb.couchdb.query_server.vdu_process_time.kurtosis,gauge,,millisecond,,Kurtosis of the duration of validate_doc_update function calls,-1,couchdb2,
168168
couchdb.couchdb.query_server.vdu_process_time.percentile.50,gauge,,millisecond,,Percentile 50 of the duration of validate_doc_update function calls,-1,couchdb2,

datadog_checks_dev/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ Commands:
9494
create Create scaffolding for a new integration
9595
dep Manage dependencies
9696
manifest Manage manifest files
97+
metadata Manage metadata files
9798
release Manage the release of checks
9899
test Run tests
99100
```
@@ -354,6 +355,34 @@ Options:
354355
-h, --help Show this message and exit.
355356
```
356357

358+
#### Metadata
359+
360+
```console
361+
$ ddev metadata -h
362+
Usage: ddev metadata [OPTIONS] COMMAND [ARGS]...
363+
364+
Options:
365+
-h, --help Show this message and exit.
366+
367+
Commands:
368+
verify Validate `metadata.csv` files, takes optional `check` argument
369+
```
370+
371+
##### Verify
372+
373+
```console
374+
$ ddev metadata verify -h
375+
Usage: ddev metadata verify [OPTIONS] [CHECK]
376+
377+
Validates metadata.csv files
378+
379+
If `check` is specified, only the check will be validated, otherwise all
380+
matching files in directory.
381+
382+
Options:
383+
-h, --help Show this message and exit.
384+
```
385+
357386
#### Release
358387

359388
```console

datadog_checks_dev/datadog_checks/dev/tooling/commands/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .meta import meta
1010
from .release import release
1111
from .test import test
12+
from .metadata import metadata
1213

1314
ALL_COMMANDS = (
1415
clean,
@@ -17,6 +18,7 @@
1718
dep,
1819
manifest,
1920
meta,
21+
metadata,
2022
release,
2123
test,
2224
)

0 commit comments

Comments
 (0)