Add example declarative configuration doc#17854
Draft
jaydeluca wants to merge 7 commits into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a generated “kitchen sink” declarative-configuration YAML example to the docs, produced from instrumentation metadata as part of the nightly metadata update workflow.
Changes:
- Add a docs analyzer output file:
docs/declarative-configuration-example.yaml. - Add generator utilities to convert flat
otel.*property names + defaults into a nested YAML structure with inline comments. - Update the metadata update workflow to stage the newly generated YAML file.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/utils/DeclarativeConfigYamlGenerator.java | Builds a config tree from module metadata and renders it as commented YAML. |
| instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/utils/DeclarativeConfigConverter.java | Converts flat property keys into declarative YAML paths, with a small set of special mappings. |
| instrumentation-docs/src/main/java/io/opentelemetry/instrumentation/docs/DocGeneratorApplication.java | Writes the new generated declarative config example file during runAnalysis. |
| docs/declarative-configuration-example.yaml | Generated example output intended for users to reference. |
| .github/workflows/metadata-update.yml | Ensures the new generated file is included in automated commits. |
Comment on lines
+44
to
+49
| public static void generateConfigurationYaml( | ||
| List<InstrumentationModule> modules, BufferedWriter writer) throws IOException { | ||
|
|
||
| Map<String, Object> configTree = buildConfigTree(modules); | ||
|
|
||
| writeYaml(configTree, writer, 0); |
Comment on lines
+306
to
+329
| StringBuilder currentLine = new StringBuilder(); | ||
|
|
||
| for (String word : words) { | ||
| // If adding this word would exceed the limit | ||
| if (currentLine.length() + word.length() + 1 > availableWidth) { | ||
| // If current line is not empty, save it and start a new line | ||
| if (!currentLine.isEmpty()) { | ||
| lines.add(currentLine.toString()); | ||
| currentLine = new StringBuilder(word); | ||
| } else { | ||
| lines.add(word); | ||
| } | ||
| } else { | ||
| if (!currentLine.isEmpty()) { | ||
| currentLine.append(" "); | ||
| } | ||
| currentLine.append(word); | ||
| } | ||
| } | ||
|
|
||
| // Add remaining text | ||
| if (!currentLine.isEmpty()) { | ||
| lines.add(currentLine.toString()); | ||
| } |
Comment on lines
+340
to
+350
| private static String formatValue(@Nullable Object value) { | ||
| if (value == null) { | ||
| return "\"\""; | ||
| } | ||
| if (value instanceof String str) { | ||
| // Quote strings if they're empty or contain special characters | ||
| if (str.isEmpty() || str.contains(":") || str.contains("#") || str.contains("\"")) { | ||
| return "\"" + str.replace("\"", "\\\"") + "\""; | ||
| } | ||
| return str; | ||
| } |
jaydeluca
marked this pull request as draft
April 16, 2026 15:51
…mentation into example-config-doc
…mentation into example-config-doc
Pull request dashboard statusStatus last refreshed: 2026-07-22 16:37:41 UTC.
This automated status or its linked feedback items may be incorrect. If something looks wrong, please report it with the result you expected. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I thought it would be useful to have a "kitchen sink" doc of all the declarative config instrumentation properties, so I updated the nightly metadata updater to also maintain a new file using the metadata as a source.