Closed
Bug 1134727
Opened 11 years ago
Closed 11 years ago
Add a URL parameter to the Telemetry Submission URL to indicate payload version
Categories
(Toolkit :: Telemetry, defect)
Toolkit
Telemetry
Tracking
()
RESOLVED
FIXED
mozilla39
| Tracking | Status | |
|---|---|---|
| firefox39 | --- | fixed |
People
(Reporter: mreid, Assigned: Dexter)
References
Details
(Whiteboard: [ready])
Attachments
(1 file, 2 obsolete files)
|
5.44 KB,
patch
|
Dexter
:
review+
|
Details | Diff | Splinter Review |
In order to be able to differentiate between old- and new-style Telemetry pings without having to uncompress and parse the JSON document, we would like to introduce a URL parameter for the payload version.
Something as simple as appending "?v=<ping.version>" would work.
This will greatly simplify the routing of data to the current telemetry backend and the new data pipeline.
I have verified that the current backend will not be impacted by this change (URL parameters are not passed through - only the URL Path).
Updated•11 years ago
|
Version: 37 Branch → unspecified
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → alessio.placitelli
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•11 years ago
|
||
As discussed over IRC, we're sending our data using a POST request. With this kind of requests, parameters are sent along with the body and encoded with it (in our case, gzipped): the server would have to uncompress the body to get the version.
An alternative approach could be to use HTTP headers to convey the version information: does it create any problem server side?
Flags: needinfo?(mreid)
| Reporter | ||
Comment 2•11 years ago
|
||
Similar to the URL parameter, the current Telemetry backend will ignore extra request headers, so that side of things will continue to work fine.
It should work with the new routing + backend, but I defer to :whd on that.
Wes, can we do the required matching using an HTTP header instead of a URL param?
Flags: needinfo?(mreid) → needinfo?(whd)
Comment 3•11 years ago
|
||
I don't understand why we can't do this with a URL parameter on the client. Alessio, doesn't the client know the payload version when it submits, and can just change the URL accordingly?
Flags: needinfo?(alessio.placitelli)
| Assignee | ||
Comment 4•11 years ago
|
||
Sorry, my bad. As Benjamin mentioned the URL can be changed without and parameters can be added without having them encoded in the body.
Flags: needinfo?(whd)
Flags: needinfo?(alessio.placitelli)
| Reporter | ||
Comment 5•11 years ago
|
||
Are there other pros/cons to consider here? Would it make more sense to have this piece of information as a URL parameter or a HTTP Header?
| Assignee | ||
Comment 6•11 years ago
|
||
This patch adds the "v=VERSION" query parameter when submitting Telemetry pings. Also adds test coverage for both the new and the old ping format.
Attachment #8568009 -
Flags: review?(gfritzsche)
Comment 7•11 years ago
|
||
Comment on attachment 8568009 [details] [diff] [review]
Adds the "v=" parameter and test coverage.
Review of attachment 8568009 [details] [diff] [review]:
-----------------------------------------------------------------
Cancelling for the open question in test_TelemetryPing.js
::: toolkit/components/telemetry/TelemetryPing.jsm
@@ +554,5 @@
> doPing: function doPing(ping, isPersisted) {
> this._log.trace("doPing - Server " + this._server + ", Persisted " + isPersisted);
> let deferred = Promise.defer();
> + let isNewPing = isNewPingFormat(ping);
> + let versionString = isNewPing ? PING_FORMAT_VERSION : 1;
That doesn't look like a string, should be |version|?
::: toolkit/components/telemetry/tests/unit/test_TelemetryPing.js
@@ +225,5 @@
> + Assert.ok(!!request.queryString);
> +
> + // Make sure the version in the query string matches the new ping format version.
> + let params = request.queryString.split("&");
> + Assert.ok(params.find(p => p == ("v=" + PING_FORMAT_VERSION)));
How does that actually work?
Shouldn't we split by '?' and '&'?
::: toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js
@@ +393,5 @@
> + Assert.ok(!!request.queryString);
> +
> + // Make sure the version in the query string matches the old ping format version.
> + let params = request.queryString.split("&");
> + Assert.ok(params.find(p => p == "v=1"));
Are the other query parts covered by other tests? Would be nice to add here if not.
Attachment #8568009 -
Flags: review?(gfritzsche)
Comment 8•11 years ago
|
||
Comment on attachment 8568009 [details] [diff] [review]
Adds the "v=" parameter and test coverage.
Review of attachment 8568009 [details] [diff] [review]:
-----------------------------------------------------------------
Cleared things up on IRC.
This looks good with the comments here and other ones above fixed or cleared up.
::: toolkit/components/telemetry/TelemetryPing.jsm
@@ +554,5 @@
> doPing: function doPing(ping, isPersisted) {
> this._log.trace("doPing - Server " + this._server + ", Persisted " + isPersisted);
> let deferred = Promise.defer();
> + let isNewPing = isNewPingFormat(ping);
> + let versionString = isNewPing ? PING_FORMAT_VERSION : 1;
That doesn't look like a string, should be |version|?
::: toolkit/components/telemetry/tests/unit/test_TelemetryPing.js
@@ +221,5 @@
> yield sendPing(false, false);
> let request = yield gRequestIterator.next();
> +
> + // Check that we have a version query parameter in the URL.
> + Assert.ok(!!request.queryString);
This is "" if no query string was present.
Change the check to notEqual("") or .length>1.
@@ +225,5 @@
> + Assert.ok(!!request.queryString);
> +
> + // Make sure the version in the query string matches the new ping format version.
> + let params = request.queryString.split("&");
> + Assert.ok(params.find(p => p == ("v=" + PING_FORMAT_VERSION)));
Ok, cleared the issue here up on IRC - i missed that queryString is just the part after the "?".
::: toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js
@@ +393,5 @@
> + Assert.ok(!!request.queryString);
> +
> + // Make sure the version in the query string matches the old ping format version.
> + let params = request.queryString.split("&");
> + Assert.ok(params.find(p => p == "v=1"));
Are the other query parts covered by other tests? Would be nice to add here if not.
Attachment #8568009 -
Flags: review+
Comment 9•11 years ago
|
||
Ok, strange, that also submitted the previous review comments.
| Assignee | ||
Comment 10•11 years ago
|
||
Attachment #8568009 -
Attachment is obsolete: true
Attachment #8568057 -
Flags: review+
| Assignee | ||
Comment 11•11 years ago
|
||
Forgot to refresh the patch :-/
Attachment #8568057 -
Attachment is obsolete: true
Attachment #8568058 -
Flags: review+
Updated•11 years ago
|
Whiteboard: [ready]
Comment 12•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in
before you can comment on or make changes to this bug.
Description
•