This is a grab bag of CLI helpers for various nimbus projects.
It is currently used to generate the json schema for the otel-validator
cd nimbus-cli
npm i
npm run build
nimbus <command>
Commands:
nimbus gen-otel-json-schema Generate OpenTelemetry JSON schema
Options:
--version Show version number [boolean]
--help Show help [boolean]
This is used to generate json schema for the otel-collector via the output of cfgmetadatagen
Generate OpenTelemetry JSON schema
Options:
--version Show version number [boolean]
--help Show help [boolean]
--metadata-dir The directory where YAML metadata files are located. This is
the output of cfgmetadatagen
[string] [required]
--output-file The file where the JSON schema files should be written to
[string] [default: "schema.json"]
Example
nimbus gen-otel-json-schema --metadata-dir /path/to/cfg-metadata --output-file otel-schema.json
Output
Generating JSON schema from /Users/kevinlin/code/_ref/otel/opentelemetry-collector-contrib/cmd/configschema/cfg-metadata and saving to undefined
error parsing {"name":"traces","type":"datasetexporter.TracesSettings","kind":"struct"}
error parsing {"name":"metrics_exporter","type":"component.ID","kind":"struct","doc":"MetricsExporter specifies the name of the metrics exporter to be used when\nexporting stats metrics.\n"}
NOTE: there currently is an issue with two components:
exporter/dataset
andexporter//datadog
as they havestruct
arguments that have no childfields
defined. This causes an error when generating the schema.