Skip to content
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

Allow multiple semconv in --only flag #157

Merged
merged 8 commits into from
Mar 15, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions semantic-conventions/src/opentelemetry/semconv/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ def exclude_file_list(folder: str, pattern: str) -> List[str]:
return file_names


def filter_semconv(semconv, type_filter):
if type_filter:
def filter_semconv(semconv, types_filter):
if types_filter:
semconv.models = {
id: model
for id, model in semconv.models.items()
if model.GROUP_TYPE_NAME == type_filter
if model.GROUP_TYPE_NAME in types_filter
}


Expand Down Expand Up @@ -211,7 +211,9 @@ def setup_parser():
parser.add_argument(
"--only",
choices=list(CONVENTION_CLS_BY_GROUP_TYPE.keys()),
help="Process only semantic conventions of the specified type.",
type=str,
nargs="+",
lmolkova marked this conversation as resolved.
Show resolved Hide resolved
help="Process only semantic conventions of the specified types.",
)
parser.add_argument(
"--yaml-root",
Expand Down