Closed Bug 1811253 Opened 2 years ago Closed 2 years ago

Server Knobs: Invert the `disabled` parameter in the Server Knobs API to reduce confusion

Categories

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

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: travis_, Assigned: travis_)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Since the Glean metrics property is actually disabled defaulting to false rather than enabled with a default of true, this creates Server Knobs feature configurations that look like "category.name": true in order to disable a metric.

If this were inverted in the API so that instead we were passing in the enabled state of the metric, it would be much less confusing

The part of me that completed that part of that Software Engineer program I started in University is telling me that, instead of inverting it, we should make it an enum like

{
  "category.name": Disabled,
}

Then if we want to expand the expressiveness of the system, we have an obvious path forward.

Of course, this is JSON so we're stuck with its inexpressiveness (no enums). So maybe complicating things isn't warranted:

{
  "category.name": {
    "disabled": false,
    "sample": 0.1
  }
}

But I do kinda like the look of it.

Priority: P2 → P1

I'm going to take :chutten's idea and refile it as an enhancement. I do like that as an improvement but I'm doing a simple change now to flip this and will look at improvements to the feature surface in a future iteration.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Blocks: 1826971
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: