MrAlias / otel-schema

Playground to prototype and investigate configuration schema proposals for OpenTelemetry
Apache License 2.0
2 stars 7 forks source link

jsonschema validation in python #38

Closed codeboten closed 1 year ago

codeboten commented 1 year ago

Updated the schema (schema.json) with a version generated from the "ideal" config. Updated the kitchen-sink to use the same config, and wrote a bit of code to validate the yaml using a jsonschema library available forPython.

The following error showed up when I input an invalid field type:

jsonschema.exceptions.ValidationError: 'none' is not of type 'integer'

Failed validating 'type' in schema['properties']['sdk']['properties']['tracer_provider']['properties']['exporters']['properties']['jaeger']['properties']['timeout']:
    {'type': 'integer'}

On instance['sdk']['tracer_provider']['exporters']['jaeger']['timeout']:
    'none'

Signed-off-by: Alex Boten aboten@lightstep.com

codeboten commented 1 year ago

Thanks for the suggestions @pellared!