@@ -46,21 +46,13 @@ static OpenTelemetryConfigurationModel extractModel(ConfigurableEnvironment envi
4646 private static OpenTelemetryConfigurationModel getModel (
4747 ConfigurableEnvironment environment , OriginTrackedMapPropertySource source )
4848 throws IOException {
49- String name = source .getName ();
50- System .out .println ("Property Source: " + name ); // todo remove
51- Matcher matcher = PATTERN .matcher (name );
49+ Matcher matcher = PATTERN .matcher (source .getName ());
5250 if (matcher .matches ()) {
5351 String file = matcher .group (1 );
54- System .out .println ("Found application.yaml: " + file );
5552
5653 try (InputStream resourceAsStream =
5754 environment .getClass ().getClassLoader ().getResourceAsStream (file )) {
58- // Print the contents of the application.yaml file
5955 if (resourceAsStream != null ) {
60- // String content = new String(resourceAsStream.readAllBytes());
61- // System.out.println("Contents of " + file + ":"); // todo remove
62- // System.out.println(content); // todo remove
63-
6456 return extractOtelConfigFile (resourceAsStream );
6557 } else {
6658 throw new IllegalStateException ("Unable to load " + file + " in the classpath." );
@@ -88,21 +80,11 @@ private static String parseOtelNode(InputStream in) {
8880 }
8981
9082 private static OpenTelemetryConfigurationModel extractOtelConfigFile (InputStream content ) {
91- //
92- // https://github.com/open-telemetry/opentelemetry-configuration/blob/c205770a956713e512eddb056570a99737e3383a/examples/kitchen-sink.yaml#L11
93-
94- // 1. read to yaml tree in jackson
95- // ObjectMapper yamlMapper = new ObjectMapper(new YAMLFactory());
96- // JsonNode rootNode = yamlMapper.readTree(content);
97-
9883 String node = parseOtelNode (content );
9984 if (node == null || node .isEmpty ()) {
10085 throw new IllegalStateException ("otel node is empty or null in the YAML file." );
10186 }
10287
103- System .out .println ("OpenTelemetry configuration file content:" ); // todo remove
104- System .out .println (node ); // todo remove
105-
10688 return DeclarativeConfiguration .parse (
10789 new ByteArrayInputStream (node .getBytes (StandardCharsets .UTF_8 )));
10890 }
0 commit comments