Skip to content

TextParser: HELP line optional? #425

@eaglerainbow

Description

@eaglerainbow

Hi Brian,

This is in reference to promregator/promregator#73, where a tricky situation with HELP lines happens. Here is the situation in a nutshell:

I also stumbled over the check at

if (b.help.isEmpty()) throw new IllegalStateException("Help hasn't been set.");
which prevents that any "java-natively" generated metrics comes without a "help" string. I used blame and that line dates back to the very first commits in the repository. The commit's description does not give me any indication why a help string must be enforced. I also could not find any indication in the javadocs that this is enforced at all (or why this is the case).

In general, I am quite in favor that metrics should have a help. However, the TextFormat class currently only implements a subset of the specification and for my case this causes compatibility issues.

What do you think about the situation?

  • Is it possible to relax (only) the TextFormat class in that sense? (a PR would not be rocket science - only the unit tests would be a little tricky).
  • Was there a special intention behind the idea to enforce help strings even though the protocol is more generous?

Thanks for your insights!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions