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

Proposal: adapting yaml syntax for splitting attribute definition from usage #191

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 15 additions & 4 deletions semantic-conventions/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ here in `syntax.md` should be considered more authoritative though. Please keep
All attributes are lower case.

```ebnf
groups ::= semconv
| semconv groups
groups ::= group
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's group(s) many times here and it makes me very confused 😅. Not sure what but I think it would be best if we name it differently. Maybe convention? And also couldn't namespace be attribute_registry? Something like:

groups ::= convention
       | convention groups

convention::= semconv
      | attribute_registry

attribute_registry ::= id brief [note] prefix [stability] [deprecated] attribute_definitions

| group groups

semconv ::= id [convtype] brief [note] [prefix] [extends] [stability] [deprecated] attributes [constraints] [specificfields]
group ::= semconv
| namespace

namespace ::= id brief [note] prefix [stability] [deprecated] attribute_definitions

semconv ::= id [convtype] brief [note] [extends] [stability] [deprecated] attributes [constraints] [specificfields]

id ::= string

Expand All @@ -68,7 +73,13 @@ stability ::= "deprecated"

deprecated ::= <description>

attributes ::= (id type brief examples | ref [brief] [examples]) [tag] [stability] [deprecated] [required] [sampling_relevant] [note]
attribute_definitions ::= attribute_definition {attribute_definition}

attribute_definition ::= id type brief examples [tag] [stability] [deprecated] [sampling_relevant] [note]

attributes ::= attribute {attribute}

attribute ::= ref [brief] [examples] [tag] [stability] [deprecated] [requirement_level] [sampling_relevant] [note]

# ref MUST point to an existing attribute id
ref ::= id
Expand Down