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

Trailing comma in label sets #251

Open
Victor-N-Suadicani opened this issue Jul 29, 2022 · 3 comments
Open

Trailing comma in label sets #251

Victor-N-Suadicani opened this issue Jul 29, 2022 · 3 comments

Comments

@Victor-N-Suadicani
Copy link

Prometheus' docs on the exposition format quite clearly allow for a trailing comma in label sets.

However, the exposition format in the spec doesn't seem to allow this.

I think trailing commas are fine and should be allowed. It makes it easier to generate the label set as you can just put a comma after each label without having to worry if there's more labels.

@brian-brazil
Copy link
Contributor

This is on purpose, to keep the grammar as small as we can.
At this point it'd be a breaking change to the format to do otherwise.

@Victor-N-Suadicani
Copy link
Author

Doesn't it just amount to doing this?

labels = "{" [label *(COMMA label) [COMMA]] "}"

That doesn't seem to make it very much bigger? Or do you mean "small" as in the implementation? I can't imagine this would make it very much more difficult.

Not sure if there's anything to do about the breaking change though.

@brian-brazil
Copy link
Contributor

brian-brazil commented Jul 29, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants