Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 11357fb

Browse files
chuttenbadboy
authored andcommitted
Bug 1973102 - Upgrade to Glean v64.5.1 r=TravisLong,supply-chain-reviewers,mach-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D254864
1 parent e6b5d6d commit 11357fb

34 files changed

+1349
-64
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ uniffi_pipeline = "0.29.3"
7070
# Shared across multiple application-services consumers.
7171
rusqlite = "0.33.0"
7272
# Shared across multiple glean consumers.
73-
glean = "=64.4.0"
73+
glean = "=64.5.1"
7474

7575
# Explicitly specify what our profiles use. The opt-level setting here is
7676
# a total fiction; see the setup of MOZ_RUST_DEFAULT_FLAGS for what the

gfx/wr/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gfx/wr/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resolver = "2"
1010

1111
[workspace.dependencies]
1212
gleam = "0.15.1"
13-
glean = "=64.4.0"
13+
glean = "=64.5.1"
1414

1515
[profile.release]
1616
debug = true

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ spotless = "7.0.2"
8383

8484
# Mozilla versions
8585
apilint = "0.5.4"
86-
mozilla-glean = "64.4.0"
86+
mozilla-glean = "64.5.1"
8787

8888
# Testing versions
8989
androidx-test = "1.6.1"

python/sites/mach.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pth:xpcom/geckoprocesstypes_generator
5757
pth:xpcom/idl-parser
5858
# glean-sdk may not be installable if a wheel isn't available
5959
# and it has to be built from source.
60-
pypi-optional:glean-sdk==64.4.0:telemetry will not be collected
60+
pypi-optional:glean-sdk==64.5.1:telemetry will not be collected
6161
pypi-optional:orjson>=3.10.15:json operations will be slower in various tools
6262
# Mach gracefully handles the case where `psutil` is unavailable.
6363
# We aren't (yet) able to pin packages in automation, so we have to

supply-chain/imports.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,15 @@ user-login = "jrmuizel"
272272
user-name = "Jeff Muizelaar"
273273

274274
[[publisher.glean]]
275-
version = "64.4.0"
276-
when = "2025-05-30"
275+
version = "64.5.1"
276+
when = "2025-06-23"
277277
user-id = 48
278278
user-login = "badboy"
279279
user-name = "Jan-Erik Rediger"
280280

281281
[[publisher.glean-core]]
282-
version = "64.4.0"
283-
when = "2025-05-30"
282+
version = "64.5.1"
283+
when = "2025-06-23"
284284
user-id = 48
285285
user-login = "badboy"
286286
user-name = "Jan-Erik Rediger"

third_party/rust/glean-core/.cargo-checksum.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

third_party/rust/glean-core/Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
edition = "2021"
1414
rust-version = "1.82"
1515
name = "glean-core"
16-
version = "64.4.0"
16+
version = "64.5.1"
1717
authors = [
1818
"Jan-Erik Rediger <jrediger@mozilla.com>",
1919
"The Glean Team <glean-team@mozilla.com>",
@@ -40,7 +40,7 @@ license = "MPL-2.0"
4040
repository = "https://github.com/mozilla/glean"
4141

4242
[package.metadata.glean]
43-
glean-parser = "17.1.0"
43+
glean-parser = "17.2.0"
4444

4545
[lib]
4646
name = "glean_core"
@@ -66,6 +66,10 @@ path = "tests/custom_distribution.rs"
6666
name = "datetime"
6767
path = "tests/datetime.rs"
6868

69+
[[test]]
70+
name = "dual_labeled_counter"
71+
path = "tests/dual_labeled_counter.rs"
72+
6973
[[test]]
7074
name = "event"
7175
path = "tests/event.rs"

third_party/rust/glean-core/src/common_metric_data.rs

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
// License, v. 2.0. If a copy of the MPL was not distributed with this
33
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
44

5+
use std::ops::Deref;
56
use std::sync::atomic::{AtomicU8, Ordering};
67

78
use malloc_size_of_derive::MallocSizeOf;
89

910
use crate::error::{Error, ErrorKind};
11+
use crate::metrics::dual_labeled_counter::validate_dynamic_key_and_or_category;
1012
use crate::metrics::labeled::validate_dynamic_label;
1113
use crate::Glean;
1214
use serde::{Deserialize, Serialize};
@@ -72,7 +74,40 @@ pub struct CommonMetricData {
7274
/// metric to be recorded to, dynamic labels are stored in the specific
7375
/// label so that we can validate them when the Glean singleton is
7476
/// available.
75-
pub dynamic_label: Option<String>,
77+
pub dynamic_label: Option<DynamicLabelType>,
78+
}
79+
80+
/// The type of dynamic label applied to a base metric. Used to help identify
81+
/// the necessary validation to be performed.
82+
#[derive(Debug, Clone, Deserialize, Serialize, MallocSizeOf, uniffi::Enum)]
83+
pub enum DynamicLabelType {
84+
/// A dynamic label applied from a `LabeledMetric`
85+
Label(String),
86+
/// A label applied by a `DualLabeledCounter` that contains a dynamic key
87+
KeyOnly(String),
88+
/// A label applied by a `DualLabeledCounter` that contains a dynamic category
89+
CategoryOnly(String),
90+
/// A label applied by a `DualLabeledCounter` that contains a dynamic key and category
91+
KeyAndCategory(String),
92+
}
93+
94+
impl Default for DynamicLabelType {
95+
fn default() -> Self {
96+
Self::Label(String::new())
97+
}
98+
}
99+
100+
impl Deref for DynamicLabelType {
101+
type Target = str;
102+
103+
fn deref(&self) -> &Self::Target {
104+
match self {
105+
DynamicLabelType::Label(label) => label,
106+
DynamicLabelType::KeyOnly(key) => key,
107+
DynamicLabelType::CategoryOnly(category) => category,
108+
DynamicLabelType::KeyAndCategory(key_and_category) => key_and_category,
109+
}
110+
}
76111
}
77112

78113
#[derive(Default, Debug, MallocSizeOf)]
@@ -138,7 +173,17 @@ impl CommonMetricDataInternal {
138173
let base_identifier = self.base_identifier();
139174

140175
if let Some(label) = &self.inner.dynamic_label {
141-
validate_dynamic_label(glean, self, &base_identifier, label)
176+
match label {
177+
DynamicLabelType::Label(label) => {
178+
validate_dynamic_label(glean, self, &base_identifier, label)
179+
}
180+
_ => validate_dynamic_key_and_or_category(
181+
glean,
182+
self,
183+
&base_identifier,
184+
label.clone(),
185+
),
186+
}
142187
} else {
143188
base_identifier
144189
}

0 commit comments

Comments
 (0)