Skip to content

makenotion/opentelemetry-collector-config-schema

 
 

Repository files navigation

OpenTelemetry collector config schema

This project creates JSON schema library for the OpenTelemetry collector.

Each collector component has its own JSON schema. The schemas are also versioned.

How does it work?

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.

How to use it?

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))

About

OpenTelemetry collector config schema in JSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 87.2%
  • Shell 8.0%
  • Makefile 4.8%