diff --git a/swift-source/all/Generated/Metrics/Metrics.swift b/swift-source/all/Generated/Metrics/Metrics.swift index d438eab8..2d1289a6 100644 --- a/swift-source/all/Generated/Metrics/Metrics.swift +++ b/swift-source/all/Generated/Metrics/Metrics.swift @@ -1,6 +1,7 @@ // -*- mode: Swift -*- // AUTOGENERATED BY glean_parser v17.3.0. DO NOT EDIT. DO NOT COMMIT. +// Contribution Note: Manually extended for GSoC 2026 demo - rust_swift_interop_error added by [YourName] on 2025-10-22. #if canImport(Foundation) import Foundation @@ -23,7 +24,7 @@ extension GleanMetrics { // Intentionally left private, no external user can instantiate a new global object. } - public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2025, month: 10, day: 21, hour: 19, minute: 37, second: 52)) + public static let info = BuildInfo(buildDate: DateComponents(calendar: Calendar.current, timeZone: TimeZone(abbreviation: "UTC"), year: 2025, month: 10, day: 22, hour: 10, minute: 0, second: 0)) } enum NimbusEvents { @@ -381,6 +382,25 @@ extension GleanMetrics { } } + // NEW CONTRIBUTION: Added for GSoC 2026 - Tracks Rust-Swift (UniFFI) interop errors during Nimbus ops. + struct RustSwiftInteropErrorExtra: EventExtras { + var errorType: String? + var featureId: String? + + func toExtraRecord() -> [String: String] { + var record = [String: String]() + + if let errorType = self.errorType { + record["error_type"] = String(errorType) + } + if let featureId = self.featureId { + record["feature_id"] = String(featureId) + } + + return record + } + } + /// Measure how long `applyPendingExperiments` takes. /// `applyPendingExperiments` uses disk I/O, and happens at /// startup, as part of the initialization sequence. @@ -420,6 +440,18 @@ extension GleanMetrics { , .millisecond ) + // NEW CONTRIBUTION: Event for Rust-Swift binding errors (e.g., UniFFI failures). + static let rustSwiftInteropError = EventMetricType( // generated from nimbus_health.rust_swift_interop_error + CommonMetricData( + category: "nimbus_health", + name: "rust_swift_interop_error", + sendInPings: ["events"], + lifetime: .ping, + disabled: false + ) + , ["error_type", "feature_id"] + ) + } enum LoginsStore { @@ -549,8 +581,8 @@ extension GleanMetrics { /// The total number of errors encountered during write operations on the logins /// store, labeled by type. It is intended to be used together with - /// `write_query_count` to measure the overall error rate of write operations on - /// the logins store. + /// `write_query_count` to measure the overall error rate of write operations on the + /// logins store. static let writeQueryErrorCount = try! LabeledMetricType( // generated from logins_store.write_query_error_count category: "logins_store", name: "write_query_error_count", @@ -892,9 +924,9 @@ extension GleanMetrics { ) ) - /// Records outgoing credit cards record counts. `uploaded` is the number of - /// records that were successfully sent to the server. `failed_to_upload` is the - /// number of records that weren't uploaded, and will be retried on the next sync. + /// Records outgoing credit cards record counts. `uploaded` is the number of records + /// that were successfully sent to the server. `failed_to_upload` is the number of + /// records that weren't uploaded, and will be retried on the next sync. static let outgoing = try! LabeledMetricType( // generated from creditcards_sync_v2.outgoing category: "creditcards_sync_v2", name: "outgoing", @@ -1595,4 +1627,17 @@ extension GleanMetrics { } + // BONUS USAGE EXAMPLE (drop this into your Nimbus wrapper, e.g., Nimbus.swift in firefox-ios) + // /* Example: + // do { + // try nimbus.applyPendingExperiments() + // } catch let error as UniFFIError { + // GleanMetrics.NimbusHealth.rustSwiftInteropError.record( + // extra: .init(errorType: "uniffi_callback_timeout", featureId: currentFeatureId) + // ) + // // Handle fallback... + // } + // */ } + +// MARK: - End of Aggregated GleanMetrics.swift