This project creates JSON schema library for the OpenTelemetry collector.
Each collector component has its own JSON schema. The schemas are also versioned.
This library uses the OpenTelemetry collector builder (OCB). OCB generates Golang code from the supplied manifest.yaml and this library creates a JSON schema for all collector components. Alongside the JSON schema there is also a readme file for each component.
collectorschema "github.com/pavolloffay/opentelemetry-collector-config-schema"
schemaManager := collectorschema.NewSchemaManager()
readme, err := schemaManager.GetComponentReadme(collectorschema.ComponentType(componentType), componentName, version)
schemaJSON, err := schemaManager.GetComponentSchemaJSON(collectorschema.ComponentType(componentType), componentName, version)
validationResult, err := schemaManager.ValidateComponentJSON(collectorschema.ComponentType(componentType), componentName, version, []byte(config))