We don't want to return authed metrics if you can't select
them (because you're not authed). We now selectively show
metrics based on whether you're authed or not, and never
return blacklisted metrics.
To enable release data, there are two options:
1. Add the probes you wish to display to PUBLIC_RELEASE_METRICS
2. Set the $SHOW_RELEASE_METRICS env var to "True" (and all
probes will be displayed, with no restrictions)
bug 1412382
Use counters in the database are wrong, and have been since bug 1204994 changed
_extract_main_histograms. It only counted "False" values in pings that had at
least one "True" value (because if there were only "False" values, we didn't
send a use counter in that ping).
This fixes this by subbing in the False value from
(TOP_LEVEL_)CONTENT_DOCUMENTS_DESTROYED, which has the correct number.
This results in an interesting side-effect that use counters that don't exist
will get valid responses from the service. This is because the service can't
tell the difference between a use counter that doesn't exist and one that just
didn't happen to have a single 'True' value in that row in that table.
This is beneficial for testing, so that I don't have to manipulate
histograms_template or generate_payload in dataset.py to be able to support
probes that aren't in every ping. The math for expected_count in test_db
would only get worse.
Instead I can ask for a use counter that doesn't exist and ensure that it
reports the correct number of False values and the correct count.
This change implements both cache control and ETag headers.
For Cache-Control:
For all requests but submission-date aggregates, the max-age
is set until the data is kicked from the local cache
(we know the response won't change until then).
For submission-date aggregates, max-age is always set to 24h.
ETags:
Etags are not set on any requests but submission-date aggregates.
The ETags are the same for all values, since submission-date
aggregates will never change, unless we do a backfill.
Thus, the single ETag value can be updated, invalidating all
previous ETags. This should only be done after a backfill.