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

Comments using // no longer work #683

Closed
stapelberg opened this Issue May 8, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@stapelberg
Copy link

stapelberg commented May 8, 2015

I think commit 3ca11bc broke comment parsing. The following example from http://prometheus.io/docs/querying/rules/ doesn’t pass a rule_checker run anymore:

// Saving the per-job HTTP in-progress request count as a new set of time series:
job:http_inprogress_requests:sum = sum(http_inprogress_requests) by (job)

// Drop or rewrite labels in the result time series:
new_time series{label_to_change="new_value",label_to_drop=""} = old_time series
$ rule_checker docs                      
docs: error checking rules: Parse error at line 1, char 1: no valid statement detected

Using # instead of // works, but I’m confused which syntax should work. Looking at the old lexer.l, it seems to have been // or /* */ for multi-line comments. Why did you switch to # if you did, breaking rules files? :(

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented May 8, 2015

Yes, we switched to # intentionally. The decision was made some time ago, afaik, and this implemented it.

Breaking changes are annoying but squashing them into one release (this and the config changes) will hopefully make it less painful.
Everything required to upgrade will of course be documented with the next release.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented May 8, 2015

FWIW, I think we never documented comments anywhere - so they were a hidden feature up until now. Seems like hidden features are discovered anyways... The decision to change the comment format came mainly from a consensus on IRC that this is the more common comment format for config files.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented May 8, 2015

I have to correct myself: I just noticed we did mention comments indirectly in examples in this one page, although they were never explicitly documented otherwise: http://prometheus.io/docs/querying/rules/. Sorry about that.

@beorn7 beorn7 closed this May 11, 2015

simonpasquier pushed a commit to simonpasquier/prometheus that referenced this issue Oct 12, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.