The scripts in this folder validate the definition files for entities and composite metrics. These validations are executed automatically in each pull request.
The following validations are applied to the entity definition files:
- Schema validation: Checks for structural errors in the files, like missing required properties or invalid values.
- Uniqueness: Checks that the same attribute name and conditions are not used for the identifier of entity definitions with a different domain and type.
For the summary and golden metrics definitions only the schema validation applies.
If you want to validate definition files manually, for example before opening a pull request, just put the file in a folder under definitions
and run the validation locally as explained here.
- Install Docker
- Execute the following command:
docker-compose run validate-definitions
If you added or modified a dashboard and its validation is failing you can try to fix it by running the following:
docker-compose run sanitize-dashboards
You can run it using npm
:
- Install NodeJS we use nvm to keep nodejs versions up to date.
- Clone this repository.
- If you are using nvm:
nvm install && nvm use
- Ensure you have the latest npm version
npm install -g npm@latest
- Run
npm --prefix validator install
. - Run
npm --prefix validator run check
.
You can also run each of the validation tools independently:
npm --prefix validator run validate-schemas
npm --prefix validator run validate-rules
npm --prefix validator run validate-folders
The tool expects all definition files to be in a subfolder under the definitions
folder.
If you added or modified a dashboard and its validation is failing you can try to fix it with:
npm --prefix validator run sanitize-dashboards