Closed Bug 1580812 Opened 6 years ago Closed 6 years ago

Add a "linter" for Glean metrics

Categories

(Data Platform and Tools :: Glean: SDK, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mdroettboom, Assigned: mdroettboom)

Details

(Whiteboard: [telemetry:glean-rs:m10])

It would be nice to have an automated way to fail when suggestions about Glean metrics aren't being followed.

Example of some checks:

  • if the name of the metric starts with the category name
  • if the name contains a unit

It is unlikely we'll be able to create something "perfect". I would prefer make these violations hard fail -- if they are just warnings, they will just be lost in a sea of build output. Therefore, we will need some way to opt-out on a case-by-case basis.

I would propose adding a new metric parameter "no_lint", which is an object mapping metric parameter names to lists of linting checks to skip for that parameter. For example:

performance:
   performance_frame_load:
      no_lint:
         name:
            - REDUNDANT_CATEGORY

The error message when lints fail would describe how to do this to make it easy for the user.

Note: 'glinter' and 'glint' are good tool names (from IRC :D)

Assignee: nobody → mdroettboom
Priority: P3 → P1
Whiteboard: [telemetry:glean-rs:m?] → [telemetry:glean-rs:m10]
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.