Contents11 of 15
Download the PDF (892 KB)Before You Blame the ModelPart IV · The Truth: knowing if anything worked
Chapter 10Telemetry
Is it plugged in?
I spent a full day building on top of features that were switched off. Their own settings said they were on.
One setting, inherited from a parent process I'd forgotten about, forced a whole family of mechanisms off in every run. Each mechanism's own flag still read ON. Every log line I looked at agreed with what I expected. I measured, tuned and drew conclusions about code that never executed.
A month later, on a different agent, I audited a batch of experiment features. They were things I'd added, each with its own switch, each with a theory of why it would help:
Twelve of thirty-four ever ran. Half of those changed nothing the model could see. Some of my early comparisons in that batch were invalid for the simplest possible reason: the treatment never reached the request.
#The lab-to-live gap
The features that did run had another trap waiting. They looked great in the lab and faded in real runs.
- A new code index found the right place to edit 36 times out of 37 in a lab test, against 10 out of 37 for plain text search. On real runs it was 9 out of 20, against 8 out of 20.
- A planning check fired correctly on 12 out of 12 scripted cases. On 59 real runs, it added useful information 0 times.
A lab result is a hypothesis about a real run. It isn't the result.
#Three receipts
Now no feature counts until it has all three:
- It fired. An event in the log, every time it acts.
- It changed the wire. The request the model received is different with it on than off.
- It changed the outcome. A paired comparison on real runs, with a control (next chapter).
And every run starts by printing its effective configuration, meaning the values the code actually resolved after defaults, environment variables and overrides, not the values you think you set.
log.info("effective_config", **resolved_settings()) # first line of every run
def apply(feature, request):
before = sha(request)
request = feature.apply(request)
emit("feature_fired", name=feature.name,
changed_wire=sha(request) != before)
return request