diff --git a/prototypes/python/src/opentelemetry/configuration/_internal/configurator.py b/prototypes/python/src/opentelemetry/configuration/_internal/configurator.py index b123d34..0c92650 100644 --- a/prototypes/python/src/opentelemetry/configuration/_internal/configurator.py +++ b/prototypes/python/src/opentelemetry/configuration/_internal/configurator.py @@ -393,9 +393,13 @@ def write_schema_paths_functions( ) -def create_configuration_objects(configuration_dictionary): +def create_configuration_objects(configuration_dictionary, schema_paths): - def traverse(dictionary, path): + set_trace() + + def traverse(dictionary, path, schema_paths): + + print(path) for dictionary_key, dictionary_value in dictionary.items(): @@ -403,22 +407,29 @@ def traverse(dictionary, path): path.append(dictionary_key.lower()) - if "/".join(path) in path_function.keys(): + schema_path = "/".join(path) + + if "processors" in path: set_trace() + if schema_path in path_function.keys(): + set_trace + traverse( dictionary_value, - path + path, + schema_paths ) path.pop() - elif isinstance(dictionary, list): + elif isinstance(dictionary_value, list): path.append(dictionary_key.lower()) - for element in dictionary: - traverse(element, path) + for element in dictionary_value: + if isinstance(element, dict): + traverse(element, path, schema_paths) path.pop() - traverse(configuration_dictionary, []) + traverse(configuration_dictionary, [], schema_paths) diff --git a/prototypes/python/tests/test_configuration.py b/prototypes/python/tests/test_configuration.py index b1ff09c..59a00c3 100644 --- a/prototypes/python/tests/test_configuration.py +++ b/prototypes/python/tests/test_configuration.py @@ -134,7 +134,12 @@ def test_create_configuration_objects(): configuration = YAMLParser().parse(data_path.joinpath("kitchen-sink.yaml")) - create_configuration_objects(configuration) + result = resolve_schema( + data_path.joinpath("opentelemetry_configuration.json") + ) + + result = get_schema_paths(result) + create_configuration_objects(configuration, result) def test_bad_attribute_limits():