-
Notifications
You must be signed in to change notification settings - Fork 352
Detect yaml groups that are not used in md files, deprecate otel.scope entity
#2310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
lmolkova
merged 5 commits into
open-telemetry:main
from
lmolkova:detect-yaml-groups-that-are-not-used-in-md
Jun 19, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
447b694
Detect yaml groups that are not used in md files
cbc0ad3
permissions
d787ecd
deprecate otel.scope enitity
03b1537
Merge branch 'main' into detect-yaml-groups-that-are-not-used-in-md
a131483
prepare for auto-generated entities registry
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| change_type: bug_fix | ||
| component: otel | ||
| note: Removes `otel.scope` entity. | ||
| issues: [2310] |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Description: This script checks if all signal groups declared in a YAML file are present in the markdown files under a specified directory. | ||
| # Usage: ./check_lines.sh <groups_list> <md_directory_path> | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| groups="$1" | ||
| docs_folder="$2" | ||
|
|
||
| if [[ ! -f "$groups" ]]; then | ||
| echo "File with groups does not exist: $groups" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ ! -d "$docs_folder" ]]; then | ||
| echo "Docs folder does not exist: $docs_folder" | ||
| exit 1 | ||
| fi | ||
|
|
||
| declare -A semconv_snippets | ||
| # Extract only lines of the form <!-- semconv ... --> from .md files | ||
| echo "Indexing semconv lines in .md files under: $docs_folder ..." | ||
| while IFS= read -r LINE; do | ||
| semconv_snippets["$LINE"]=1 | ||
| done < <( | ||
| grep -rhoP '<!--\s*semconv\s+\K[a-z0-9._]+(?=\s*-->)' "$docs_folder" --include="*.md" | ||
| ) | ||
|
|
||
| not_found_groups=() | ||
|
|
||
| while IFS= read -r LINE || [[ -n "$LINE" ]]; do | ||
| if [[ -z "${semconv_snippets[$LINE]+_}" ]]; then | ||
| not_found_groups+=("$LINE") | ||
| fi | ||
| done < "$groups" | ||
|
|
||
| echo | ||
|
|
||
| if [[ ${#not_found_groups[@]} -gt 0 ]]; then | ||
| echo "❌ The following signals were declared in yaml and NOT found in markdown:" | ||
| for line in "${not_found_groups[@]}"; do | ||
| echo " - $line" | ||
| done | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "All groups were found." | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| templates: | ||
| - pattern: signal-groups.j2 | ||
| # attribute groups and entities are auto-generated and don't need manual code | ||
| # snippets, let's filter them out from the check. | ||
| filter: > | ||
| .groups | ||
| | map(select(.type != "attribute_group" and .type != "entity")) | ||
| | map(select(has("deprecated") | not)) | ||
| | .[].id | ||
| application_mode: single | ||
| whitespace_control: | ||
| trim_blocks: true | ||
| lstrip_blocks: true | ||
| keep_trailing_newline: true |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| {{- template.set_file_name("signal-groups.txt") -}} | ||
|
|
||
| {% for item in ctx | sort %} | ||
| {{ item }} | ||
| {% endfor %} |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.