Skip to content

Commit

Permalink
Merge branch 'release-v5.0.1' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
rosahbruno committed Apr 30, 2024
2 parents 0a487ca + b5a41b5 commit 2d546f2
Show file tree
Hide file tree
Showing 15 changed files with 1,531 additions and 1,043 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Unreleased changes

[Full changelog](https://github.com/mozilla/glean.js/compare/v5.0.0...main)
[Full changelog](https://github.com/mozilla/glean.js/compare/v5.0.1...main)

# v5.0.1 (2024-04-30)

[Full changelog](https://github.com/mozilla/glean.js/compare/v5.0.0...v5.0.1)

* [#1923](https://github.com/mozilla/glean.js/pull/1923): Bumped `glean_parser` version to `14.0.1`.
* [#1921](https://github.com/mozilla/glean.js/pull/1921): BUGFIX: Fix issue causing `glean.client.annotation.experimentation_id` metric to not get added in certain pings.
* [#1919](https://github.com/mozilla/glean.js/pull/1919): Add `glean.page_id` to Glean automatic events.

# v5.0.0 (2024-03-25)

Expand Down
860 changes: 514 additions & 346 deletions automation/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions automation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"browserstack-local": "^1.5.5",
"geckodriver": "^4.3.3",
"patch-package": "^8.0.0",
"selenium-webdriver": "^4.18.1",
"webpack": "^5.90.3",
"selenium-webdriver": "^4.19.0",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.3"
"webpack-dev-server": "^5.0.4"
}
}
5 changes: 3 additions & 2 deletions docs/reference/metrics.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!-- AUTOGENERATED BY glean_parser v10.0.3. DO NOT EDIT. -->
<!-- AUTOGENERATED BY glean_parser v14.0.1. DO NOT EDIT. -->

# Metrics

Expand Down Expand Up @@ -102,9 +102,10 @@ In addition to those built-in metrics, the following metrics are added to the pi
| Name | Type | Description | Data reviews | Extras | Expiration | [Data Sensitivity](https://wiki.mozilla.org/Firefox/Data_Collection) |
| --- | --- | --- | --- | --- | --- | --- |
| glean.element_click |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A event triggered whenever an html element is clicked on a page. **Clicks are recorded only for those html elements that have at least one of the `data-glean-*` data attributes. By default, this event is not collected automatically. Collection can be turned on by clients via Glean configuration object (`enableAutoElementClickEvents`). Glean also provides a separate API for clients to record element clicks manually.** |[Bug 1867294](https://bugzilla.mozilla.org/show_bug.cgi?id=1867294#c29)|<ul><li>id: An identifier of the element clicked. For automatic collection, its value is the element's `data-glean-id` data attribute value.</li><li>label: The label of the element clicked. For automatic collection, its value is the element's `data-glean-label` data attribute value.</li><li>type: The type of the element clicked. For automatic collection, its value is the element's `data-glean-type` data attribute value.</li></ul>|never |2 |
| glean.page_id |[uuid](https://mozilla.github.io/glean/book/user/metrics/uuid.html) |Uniquely identifies a page_load, not the page itself, for the purpose of associating other events with the specific page load event. This gets rotated with each page load and is sent along with each event ping. |[Bug 1888430](https://bugzilla.mozilla.org/show_bug.cgi?id=1888430)||never |1 |
| glean.page_load |[event](https://mozilla.github.io/glean/book/user/metrics/event.html) |A event triggered whenever a page is loaded. **This event by default is not collected automatically. This can be turned on by the client in the Glean configuration object (`enableAutoPageLoadEvents`). Glean provides a separate API for collecting the same page load data if the client wants to collect page loads manually.** |[Bug 1867126](https://bugzilla.mozilla.org/show_bug.cgi?id=1867126#c8)|<ul><li>referrer: The page referrer.</li><li>title: The page title.</li><li>url: The page URL.</li></ul>|never |2 |

Data categories are [defined here](https://wiki.mozilla.org/Firefox/Data_Collection).

<!-- AUTOGENERATED BY glean_parser v10.0.3. DO NOT EDIT. -->
<!-- AUTOGENERATED BY glean_parser v14.0.1. DO NOT EDIT. -->

788 changes: 429 additions & 359 deletions glean/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion glean/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mozilla/glean",
"version": "5.0.0",
"version": "5.0.1",
"description": "An implementation of the Glean SDK, a modern cross-platform telemetry client, for JavaScript environments.",
"type": "module",
"sideEffects": false,
Expand Down
2 changes: 1 addition & 1 deletion glean/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const LOG_TAG = "CLI";
const VIRTUAL_ENVIRONMENT_DIR = process.env.VIRTUAL_ENV || path.join(process.cwd(), ".venv");

// The version of glean_parser to install from PyPI.
const GLEAN_PARSER_VERSION = "10.0.3";
const GLEAN_PARSER_VERSION = "14.0.1";

// This script runs a given Python module as a "main" module, like
// `python -m module`. However, it first checks that the installed
Expand Down
2 changes: 1 addition & 1 deletion glean/src/core/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const GLEAN_SCHEMA_VERSION = 1;
//
// PACKAGE_VERSION is defined as a global by webpack,
// we need a default here for testing when the app is not build with webpack.
export const GLEAN_VERSION = "5.0.0";
export const GLEAN_VERSION = "5.0.1";

// The name of a "ping" that will include Glean ping_info metrics,
// such as ping sequence numbers.
Expand Down
13 changes: 13 additions & 0 deletions glean/src/core/glean_metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import { Context } from "./context.js";
import UUIDMetric from "./metrics/types/uuid.js";
import EventMetricType from "./metrics/types/event.js";
import { EVENTS_PING_NAME } from "./constants.js";
import { Lifetime } from "./metrics/lifetime.js";
Expand Down Expand Up @@ -51,6 +52,15 @@ namespace GleanMetrics {
},
// extras defined in `src/metrics.yaml`.
["id", "type", "label"]
),
pageId: new UUIDMetric(
{
category: "glean",
name: "page_id",
sendInPings: [EVENTS_PING_NAME],
lifetime: Lifetime.Application,
disabled: false,
}
)
};

Expand All @@ -72,6 +82,9 @@ namespace GleanMetrics {
return;
}

// Rotate the page_id for each page_load event.
metrics.pageId.generateAndSet();

// Each key defaults to the override. If no override is provided, we fall
// back to the default value IF the `window` or the `document` objects
// are available.
Expand Down
3 changes: 3 additions & 0 deletions glean/src/core/pings/common_ping_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ export default interface CommonPingData {

// Currently NOT IMPLEMENTED.
readonly preciseTimestamps?: boolean;
readonly includeInfoSections?: boolean;
readonly enabled?: boolean;
readonly schedulesPings?: string[];
}
10 changes: 8 additions & 2 deletions glean/src/core/pings/maker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,14 @@ export function collectPing(ping: CommonPingData, reason?: string): PingPayload

// Insert the experimentation id if the metrics aren't empty
if (ping.includeClientId && Context.config.experimentationId) {
if (metricsData != undefined) {
metricsData["string"]["glean.client.annotation.experimentation_id"] = Context.config.experimentationId;
if (metricsData !== undefined) {
metricsData = {
...metricsData,
string: {
...metricsData?.string || undefined,
"glean.client.annotation.experimentation_id": Context.config.experimentationId
}
};
} else {
metricsData = {
"string": {
Expand Down
17 changes: 17 additions & 0 deletions glean/src/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -539,3 +539,20 @@ glean:
label:
description: The label of the element clicked. For automatic collection, its value is the element's `data-glean-label` data attribute value.
type: string
page_id:
type: uuid
description: |
Uniquely identifies a page_load, not the page itself, for the purpose of associating other events with the specific page load event. This gets
rotated with each page load and is sent along with each event ping.
send_in_pings:
- events
lifetime: application
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1888430
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1888430
data_sensitivity:
- technical
notification_emails:
- [email protected]
expires: never
64 changes: 32 additions & 32 deletions samples/browser/react-sample/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2d546f2

Please sign in to comment.