From d2d067cf5f1a99aec7fe0afb489d2fdf3080819c Mon Sep 17 00:00:00 2001 From: perrymcmanis144 <95651456+perrymcmanis144@users.noreply.github.com> Date: Thu, 20 Apr 2023 13:52:08 -0500 Subject: [PATCH 01/12] Release v52.6.0 (#2452) * Bug 1828528 - add TextMetric entry to private mod.rs * Bumped version to 52.6.0 --- .buildconfig.yml | 2 +- CHANGELOG.md | 9 +- Cargo.lock | 4 +- DEPENDENCIES.md | 408 ++++++++++++++---- glean-core/Cargo.toml | 2 +- .../android-native/dependency-licenses.xml | 27 +- glean-core/android/dependency-licenses.xml | 27 +- glean-core/python/setup.py | 2 +- glean-core/rlb/Cargo.toml | 4 +- .../GleanGradlePlugin.groovy | 2 +- 10 files changed, 358 insertions(+), 129 deletions(-) diff --git a/.buildconfig.yml b/.buildconfig.yml index fdde359563..c409b080c9 100644 --- a/.buildconfig.yml +++ b/.buildconfig.yml @@ -1,4 +1,4 @@ -libraryVersion: 52.5.0 +libraryVersion: 52.6.0 groupId: org.mozilla.telemetry projects: glean: diff --git a/CHANGELOG.md b/CHANGELOG.md index 241624b5d4..7b8115a500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ # Unreleased changes -[Full changelog](https://github.com/mozilla/glean/compare/v52.5.0...main) +[Full changelog](https://github.com/mozilla/glean/compare/v52.6.0...main) + +# v52.6.0 (2023-04-20) + +[Full changelog](https://github.com/mozilla/glean/compare/v52.5.0...v52.6.0) + +* Rust + * The Text metric type is now available in the Rust language bindings ([#2451](https://github.com/mozilla/glean/pull/2451)) # v52.5.0 (2023-04-11) diff --git a/Cargo.lock b/Cargo.lock index 276d168dc0..d7eb2a5393 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -318,7 +318,7 @@ dependencies = [ [[package]] name = "glean" -version = "52.5.0" +version = "52.6.0" dependencies = [ "chrono", "crossbeam-channel", @@ -361,7 +361,7 @@ dependencies = [ [[package]] name = "glean-core" -version = "52.5.0" +version = "52.6.0" dependencies = [ "android_logger", "bincode", diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 48fa007264..52fd64960a 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -2091,10 +2091,9 @@ The following text applies to code linked from these dependencies: * [bitflags 1.3.2]( https://github.com/bitflags/bitflags ) * [camino 1.1.4]( https://github.com/camino-rs/camino ) * [cfg-if 1.0.0]( https://github.com/alexcrichton/cfg-if ) -* [crossbeam-channel 0.5.7]( https://github.com/crossbeam-rs/crossbeam ) +* [crossbeam-channel 0.5.8]( https://github.com/crossbeam-rs/crossbeam ) * [crossbeam-utils 0.8.8]( https://github.com/crossbeam-rs/crossbeam ) * [env_logger 0.10.0]( https://github.com/rust-cli/env_logger/ ) -* [errno 0.2.8]( https://github.com/lambda-fairy/rust-errno ) * [fastrand 1.7.0]( https://github.com/smol-rs/fastrand ) * [flate2 1.0.25]( https://github.com/rust-lang/flate2-rs ) * [form_urlencoded 1.1.0]( https://github.com/servo/rust-url ) @@ -4544,163 +4543,385 @@ You may use this code under the terms of either license. The following text applies to code linked from these dependencies: -* [embedded-uniffi-bindgen 0.1.0]( https://crates.io/crates/embedded-uniffi-bindgen ) -* [glean-bundle 1.0.0]( https://github.com/mozilla/glean ) -* [glean-bundle-android 1.0.0]( https://github.com/mozilla/glean ) -* [uniffi 0.23.0]( https://github.com/mozilla/uniffi-rs ) -* [uniffi_bindgen 0.23.0]( https://github.com/mozilla/uniffi-rs ) -* [uniffi_build 0.23.0]( https://github.com/mozilla/uniffi-rs ) -* [uniffi_checksum_derive 0.23.0]( https://github.com/mozilla/uniffi-rs ) -* [uniffi_core 0.23.0]( https://github.com/mozilla/uniffi-rs ) -* [uniffi_macros 0.23.0]( https://github.com/mozilla/uniffi-rs ) -* [uniffi_meta 0.23.0]( https://github.com/mozilla/uniffi-rs ) -* [uniffi_testing 0.23.0]( https://github.com/mozilla/uniffi-rs ) +* [glean 52.6.0]( https://github.com/mozilla/glean ) +* [glean-build 7.1.0]( https://github.com/mozilla/glean ) +* [glean-core 52.6.0]( https://github.com/mozilla/glean ) +* [zeitstempel 0.1.1]( https://github.com/badboy/zeitstempel ) ``` Mozilla Public License Version 2.0 +================================== 1. Definitions +-------------- - 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. - 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. - 1.3. "Contribution" means Covered Software of a particular Contributor. +1.3. "Contribution" + means Covered Software of a particular Contributor. - 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. - 1.5. "Incompatible With Secondary Licenses" means +1.5. "Incompatible With Secondary Licenses" + means - (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or - (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. - 1.6. "Executable Form" means any form of the work other than Source Code Form. +1.6. "Executable Form" + means any form of the work other than Source Code Form. - 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. - 1.8. "License" means this document. +1.8. "License" + means this document. - 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. - 1.10. "Modifications" means any of the following: +1.10. "Modifications" + means any of the following: - (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or - (b) any new file in Source Code Form that contains any Covered Software. + (b) any new file in Source Code Form that contains any Covered + Software. - 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. - 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. - 1.13. "Source Code Form" means the form of the work preferred for making modifications. +1.13. "Source Code Form" + means the form of the work preferred for making modifications. - 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. 2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: - 2.1. Grants - Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and - (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. - (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. +2.2. Effective Date - 2.2. Effective Date - The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. - 2.3. Limitations on Grant Scope - The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: +2.3. Limitations on Grant Scope - (a) for any code that a Contributor has removed from Covered Software; or +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: - (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or +(a) for any code that a Contributor has removed from Covered Software; + or - (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). - This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. - 2.4. Subsequent Licenses - No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). +2.6. Fair Use - 2.5. Representation - Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. - 2.6. Fair Use - This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. +2.7. Conditions - 2.7. Conditions - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. 3. Responsibilities +------------------- - 3.1. Distribution of Source Form - All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. +3.1. Distribution of Source Form - 3.2. Distribution of Executable Form - If You distribute Covered Software in Executable Form then: +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. - (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). - (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. +3.4. Notices - 3.3. Distribution of a Larger Work - You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. - 3.4. Notices - You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. +3.5. Application of Additional Terms - 3.5. Application of Additional Terms - You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. 4. Inability to Comply Due to Statute or Regulation -If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. 5. Termination +-------------- - 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. - 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. - 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. -6. Disclaimer of Warranty -Covered Software is provided under this License on an "as is" basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer. +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ -7. Limitation of Liability -Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such party's negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You. +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ 8. Litigation -Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. 9. Miscellaneous -This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. 10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. - 10.1. New Versions - Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. +10.3. Modified Versions - 10.2. Effect of New Versions - You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). - 10.3. Modified Versions - If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses - 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses - If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice +------------------------------------------- - This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. -If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- - This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. ``` ## Mozilla Public License 2.0 @@ -4708,10 +4929,17 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice The following text applies to code linked from these dependencies: -* [glean 52.5.0]( https://github.com/mozilla/glean ) -* [glean-build 7.1.0]( https://github.com/mozilla/glean ) -* [glean-core 52.5.0]( https://github.com/mozilla/glean ) -* [zeitstempel 0.1.1]( https://github.com/badboy/zeitstempel ) +* [embedded-uniffi-bindgen 0.1.0]( https://crates.io/crates/embedded-uniffi-bindgen ) +* [glean-bundle 1.0.0]( https://github.com/mozilla/glean ) +* [glean-bundle-android 1.0.0]( https://github.com/mozilla/glean ) +* [uniffi 0.23.0]( https://github.com/mozilla/uniffi-rs ) +* [uniffi_bindgen 0.23.0]( https://github.com/mozilla/uniffi-rs ) +* [uniffi_build 0.23.0]( https://github.com/mozilla/uniffi-rs ) +* [uniffi_checksum_derive 0.23.0]( https://github.com/mozilla/uniffi-rs ) +* [uniffi_core 0.23.0]( https://github.com/mozilla/uniffi-rs ) +* [uniffi_macros 0.23.0]( https://github.com/mozilla/uniffi-rs ) +* [uniffi_meta 0.23.0]( https://github.com/mozilla/uniffi-rs ) +* [uniffi_testing 0.23.0]( https://github.com/mozilla/uniffi-rs ) ``` Mozilla Public License Version 2.0 @@ -4751,7 +4979,7 @@ Mozilla Public License Version 2.0 means any form of the work other than Source Code Form. 1.7. "Larger Work" - means a work that combines Covered Software with other material, in + means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" @@ -5073,7 +5301,7 @@ Exhibit A - Source Code Form License Notice This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. + file, You can obtain one at https://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE diff --git a/glean-core/Cargo.toml b/glean-core/Cargo.toml index b82573b536..d191031066 100644 --- a/glean-core/Cargo.toml +++ b/glean-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glean-core" -version = "52.5.0" +version = "52.6.0" authors = ["Jan-Erik Rediger ", "The Glean Team "] description = "A modern Telemetry library" repository = "https://github.com/mozilla/glean" diff --git a/glean-core/android-native/dependency-licenses.xml b/glean-core/android-native/dependency-licenses.xml index b8b8bcac50..b6e06c459d 100644 --- a/glean-core/android-native/dependency-licenses.xml +++ b/glean-core/android-native/dependency-licenses.xml @@ -72,9 +72,6 @@ the details of which are reproduced below. Apache License 2.0: env_logger https://github.com/rust-cli/env_logger/ - - Apache License 2.0: errno - https://github.com/lambda-fairy/rust-errno Apache License 2.0: fastrand https://github.com/smol-rs/fastrand @@ -321,6 +318,18 @@ the details of which are reproduced below. MIT License: winapi-util https://github.com/BurntSushi/winapi-util + + Mozilla Public License 2.0: glean + https://github.com/mozilla/glean + + Mozilla Public License 2.0: glean-build + https://github.com/mozilla/glean + + Mozilla Public License 2.0: glean-core + https://github.com/mozilla/glean + + Mozilla Public License 2.0: zeitstempel + https://github.com/badboy/zeitstempel Mozilla Public License 2.0: embedded-uniffi-bindgen https://crates.io/crates/embedded-uniffi-bindgen @@ -354,18 +363,6 @@ the details of which are reproduced below. Mozilla Public License 2.0: uniffi_testing https://github.com/mozilla/uniffi-rs - - Mozilla Public License 2.0: glean - https://github.com/mozilla/glean - - Mozilla Public License 2.0: glean-build - https://github.com/mozilla/glean - - Mozilla Public License 2.0: glean-core - https://github.com/mozilla/glean - - Mozilla Public License 2.0: zeitstempel - https://github.com/badboy/zeitstempel Unicode License Agreement - Data Files and Software (2016): unicode-ident https://github.com/dtolnay/unicode-ident diff --git a/glean-core/android/dependency-licenses.xml b/glean-core/android/dependency-licenses.xml index b8b8bcac50..b6e06c459d 100644 --- a/glean-core/android/dependency-licenses.xml +++ b/glean-core/android/dependency-licenses.xml @@ -72,9 +72,6 @@ the details of which are reproduced below. Apache License 2.0: env_logger https://github.com/rust-cli/env_logger/ - - Apache License 2.0: errno - https://github.com/lambda-fairy/rust-errno Apache License 2.0: fastrand https://github.com/smol-rs/fastrand @@ -321,6 +318,18 @@ the details of which are reproduced below. MIT License: winapi-util https://github.com/BurntSushi/winapi-util + + Mozilla Public License 2.0: glean + https://github.com/mozilla/glean + + Mozilla Public License 2.0: glean-build + https://github.com/mozilla/glean + + Mozilla Public License 2.0: glean-core + https://github.com/mozilla/glean + + Mozilla Public License 2.0: zeitstempel + https://github.com/badboy/zeitstempel Mozilla Public License 2.0: embedded-uniffi-bindgen https://crates.io/crates/embedded-uniffi-bindgen @@ -354,18 +363,6 @@ the details of which are reproduced below. Mozilla Public License 2.0: uniffi_testing https://github.com/mozilla/uniffi-rs - - Mozilla Public License 2.0: glean - https://github.com/mozilla/glean - - Mozilla Public License 2.0: glean-build - https://github.com/mozilla/glean - - Mozilla Public License 2.0: glean-core - https://github.com/mozilla/glean - - Mozilla Public License 2.0: zeitstempel - https://github.com/badboy/zeitstempel Unicode License Agreement - Data Files and Software (2016): unicode-ident https://github.com/dtolnay/unicode-ident diff --git a/glean-core/python/setup.py b/glean-core/python/setup.py index 634d511243..e7b7afca92 100644 --- a/glean-core/python/setup.py +++ b/glean-core/python/setup.py @@ -56,7 +56,7 @@ history = history_file.read() # glean version. Automatically updated by the bin/prepare_release.sh script -version = "52.5.0" +version = "52.6.0" requirements = [ "semver>=2.13.0", diff --git a/glean-core/rlb/Cargo.toml b/glean-core/rlb/Cargo.toml index 0c48ac4c71..9dd21932f5 100644 --- a/glean-core/rlb/Cargo.toml +++ b/glean-core/rlb/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glean" -version = "52.5.0" +version = "52.6.0" authors = ["Jan-Erik Rediger ", "The Glean Team "] description = "Glean SDK Rust language bindings" repository = "https://github.com/mozilla/glean" @@ -23,7 +23,7 @@ maintenance = { status = "actively-developed" } [dependencies.glean-core] path = ".." -version = "52.5.0" +version = "52.6.0" [dependencies] crossbeam-channel = "0.5" diff --git a/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy b/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy index 4918054707..d04903a19e 100644 --- a/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy +++ b/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy @@ -555,7 +555,7 @@ except: void apply(Project project) { isOffline = project.gradle.startParameter.offline - project.ext.glean_version = "52.5.0" + project.ext.glean_version = "52.6.0" def parserVersion = gleanParserVersion(project) // Print the required glean_parser version to the console. This is From 63680ee634c01b2624df13367d58b2076406dd0c Mon Sep 17 00:00:00 2001 From: Travis Long Date: Mon, 24 Apr 2023 15:28:02 -0500 Subject: [PATCH 02/12] Bug 1829157 - Add accumulateSamples to docs --- .../reference/metrics/timing_distribution.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/docs/user/reference/metrics/timing_distribution.md b/docs/user/reference/metrics/timing_distribution.md index ecb6eaf7ae..5635a54965 100644 --- a/docs/user/reference/metrics/timing_distribution.md +++ b/docs/user/reference/metrics/timing_distribution.md @@ -239,6 +239,101 @@ Glean.pages.pageLoad.stopAndAccumulate(timerId); {{#include ../../../shared/tab_footer.md}} +### `accumulateSamples` + +Accumulates the provided signed samples in the metric. +This is required so that the platform-specific code can provide us with +64 bit signed integers if no `u64` comparable type is available. This +will take care of filtering and reporting errors for any provided negative +sample. + +Please note that this assumes that the provided samples are already in +the "unit" declared by the instance of the metric type (e.g. if the +instance this method was called on is using `TimeUnit::Second`, then +`samples` are assumed to be in that unit). + +{{#include ../../../shared/tab_header.md}} + +
+ +```Kotlin +import org.mozilla.yourApplication.GleanMetrics.Pages + +fun onPageLoaded(e: Event) { + Pages.pageLoad.accumulateSamples(samples) +} +``` + +
+
+ +```Java +import org.mozilla.yourApplication.GleanMetrics.Pages; + +void onPageLoaded(Event e) { + Pages.INSTANCE.pageLoad().accumulateSamples(samples); +} +``` + +
+
+ +```Swift +import Glean + +func onPageLoaded() { + Pages.pageLoad.accumulateSamples(samples) +} +``` + +
+
+ +```Python +from glean import load_metrics +metrics = load_metrics("metrics.yaml") + +class PageHandler: + def on_page_loaded(self, event): + metrics.pages.page_load.accumulate_samples(samples) +``` + +
+
+ +This API is not currently exposed in Rust, see [Bug 1829745](https://bugzilla.mozilla.org/show_bug.cgi?id=1829745). + +
+
+ +```Javascript +import * as pages from "./path/to/generated/files/pages.js"; + +function onPageLoaded() { + pages.pageLoad.accumulateSamples(samples); +} +``` + +
+
+ +This API is not currently exposed in Firefox Desktop, see [Bug 1829745](https://bugzilla.mozilla.org/show_bug.cgi?id=1829745). + +
+ +#### Limits + +- Samples are limited to the maximum value for the given time unit. +- Only non-negative values may be recorded (`>= 0`). + +#### Recorded Errors + +- Negative values are discarded and an `ErrorType::InvalidValue` is generated for each instance. +- Samples that are longer than maximum sample time for the given unit generate an `ErrorType::InvalidOverflow` error for each instance. + +{{#include ../../../shared/tab_footer.md}} + + #### Recorded errors * [`invalid_value`](../../user/metrics/error-reporting.md): If recording a negative timespan. From dd5c3eb403958c6abec1f32bb7d0828b4b8947c1 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Wed, 26 Apr 2023 10:59:39 +0200 Subject: [PATCH 03/12] Apply clippy lint: Avoid potential infinite loop Detailed explanation in https://rust-lang.github.io/rust-clippy/master/index.html#lines_filter_map_ok We're unlikely to hit this, because `entry` is a file and thus continued read errors are unlikely. But better be safe than sorry. --- glean-core/src/event_database/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glean-core/src/event_database/mod.rs b/glean-core/src/event_database/mod.rs index 09a9801fe7..e4e64e04d8 100644 --- a/glean-core/src/event_database/mod.rs +++ b/glean-core/src/event_database/mod.rs @@ -238,7 +238,7 @@ impl EventDatabase { db.insert( store_name, file.lines() - .filter_map(|line| line.ok()) + .map_while(Result::ok) .filter_map(|line| serde_json::from_str::(&line).ok()) .collect(), ); From 306fb0b3d4783360768aaac852ba734945a57cd1 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Tue, 25 Apr 2023 14:27:19 -0400 Subject: [PATCH 04/12] Update Kotlin to version 1.8.20 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a8fdd6e0e4..a612c26207 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { junit: '4.12', mockito: '3.11.2', mockwebserver: '4.9.1', // This is different than a-c, but we're fine, it's only tests. - kotlin: '1.8.10', + kotlin: '1.8.20', robolectric: '4.9.2', rust_android_plugin: '0.9.3', From c852fe4c00d6339b806e01bbea57a9a8eee9f85f Mon Sep 17 00:00:00 2001 From: Bruno Rosa Date: Mon, 1 May 2023 15:20:20 -0400 Subject: [PATCH 05/12] Bug 1812738 - allow user to set Glean log level --- CHANGELOG.md | 3 +++ docs/user/reference/general/initializing.md | 1 + .../java/mozilla/telemetry/glean/Glean.kt | 3 ++- .../telemetry/glean/config/Configuration.kt | 5 +++- .../ios/Glean/Config/Configuration.swift | 6 ++++- glean-core/ios/Glean/Glean.swift | 3 ++- glean-core/python/glean/glean.py | 1 + .../python/glean/net/ping_upload_worker.py | 1 + glean-core/rlb/src/configuration.rs | 9 +++++++ glean-core/rlb/src/lib.rs | 1 + glean-core/rlb/src/test.rs | 27 +++++++++++++++++++ glean-core/src/core/mod.rs | 2 ++ glean-core/src/glean.udl | 11 ++++++++ glean-core/src/lib.rs | 8 ++++++ glean-core/tests/common/mod.rs | 1 + samples/rust/src/main.rs | 1 + 16 files changed, 79 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b8115a500..ae7377e464 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ [Full changelog](https://github.com/mozilla/glean/compare/v52.6.0...main) +* General + * Allow user to configure how verbose the internal logging is ([#2459](https://github.com/mozilla/glean/pull/2459)) + # v52.6.0 (2023-04-20) [Full changelog](https://github.com/mozilla/glean/compare/v52.5.0...v52.6.0) diff --git a/docs/user/reference/general/initializing.md b/docs/user/reference/general/initializing.md index d920954247..cb458c7a7b 100644 --- a/docs/user/reference/general/initializing.md +++ b/docs/user/reference/general/initializing.md @@ -67,6 +67,7 @@ Below are listed the configuration options available on most SDKs. - `httpUploader`: A custom HTTP uploader instance, that will overwrite Glean's provided uploader. Useful for users that wish to use specific uploader implementations. See [Custom Uploaders](#custom-uploaders) for more information on how and when the use this feature. +- `logLevel`: The level for how verbose the internal logging is. The level filter options in order from least to most verbose are: `Off`, `Error`, `Warn`, `Info`, `Debug`, `Trace`. See the [`log` crate docs](https://docs.rs/log/latest/log/) for more information. To learn about SDK specific configuration options available, refer to the [Reference](#reference) section. diff --git a/glean-core/android/src/main/java/mozilla/telemetry/glean/Glean.kt b/glean-core/android/src/main/java/mozilla/telemetry/glean/Glean.kt index e1eca4f88f..6325c02100 100644 --- a/glean-core/android/src/main/java/mozilla/telemetry/glean/Glean.kt +++ b/glean-core/android/src/main/java/mozilla/telemetry/glean/Glean.kt @@ -244,7 +244,8 @@ open class GleanInternalAPI internal constructor() { delayPingLifetimeIo = false, appBuild = "none", useCoreMps = false, - trimDataToRegisteredPings = false + trimDataToRegisteredPings = false, + logLevel = configuration.logLevel ) val clientInfo = getClientInfo(configuration, buildInfo) val callbacks = OnGleanEventsImpl(this@GleanInternalAPI) diff --git a/glean-core/android/src/main/java/mozilla/telemetry/glean/config/Configuration.kt b/glean-core/android/src/main/java/mozilla/telemetry/glean/config/Configuration.kt index 8d9c85503b..dc76b152ac 100644 --- a/glean-core/android/src/main/java/mozilla/telemetry/glean/config/Configuration.kt +++ b/glean-core/android/src/main/java/mozilla/telemetry/glean/config/Configuration.kt @@ -4,6 +4,7 @@ package mozilla.telemetry.glean.config +import mozilla.telemetry.glean.internal.LevelFilter import mozilla.telemetry.glean.net.HttpURLConnectionUploader import mozilla.telemetry.glean.net.PingUploader @@ -18,6 +19,7 @@ import mozilla.telemetry.glean.net.PingUploader * sent along with all the pings, in the `client_info` section. * @property dataPath An optional [String] that specifies where to store data locally on the device. * This should ONLY be used when setting up Glean on a non-main process. + * @property logLevel An optional [LevelFilter] that controls how verbose the internal logging is. */ data class Configuration @JvmOverloads constructor( val serverEndpoint: String = DEFAULT_TELEMETRY_ENDPOINT, @@ -27,7 +29,8 @@ data class Configuration @JvmOverloads constructor( // default values for the lines below are ever changed, they are required // to change in the public constructor below. val httpClient: PingUploader = HttpURLConnectionUploader(), - val dataPath: String? = null + val dataPath: String? = null, + val logLevel: LevelFilter? = null ) { companion object { /** diff --git a/glean-core/ios/Glean/Config/Configuration.swift b/glean-core/ios/Glean/Config/Configuration.swift index 61b159988c..060b5a994f 100644 --- a/glean-core/ios/Glean/Config/Configuration.swift +++ b/glean-core/ios/Glean/Config/Configuration.swift @@ -9,6 +9,7 @@ public struct Configuration { let maxEvents: Int32? let channel: String? let dataPath: String? + let logLevel: LevelFilter? struct Constants { static let defaultTelemetryEndpoint = "https://incoming.telemetry.mozilla.org" @@ -23,15 +24,18 @@ public struct Configuration { /// * serverEndpoint the server endpoint Glean should send data to /// * dataPath an optional String that specifies where to store data locally on the device. /// This should ONLY be used when setting up Glean on a non-main process. + /// * logLevel an optional log level that controls how verbose the internal logging is. public init( maxEvents: Int32? = nil, channel: String? = nil, serverEndpoint: String? = nil, - dataPath: String? = nil + dataPath: String? = nil, + logLevel: LevelFilter? = nil ) { self.serverEndpoint = serverEndpoint ?? Constants.defaultTelemetryEndpoint self.maxEvents = maxEvents self.channel = channel self.dataPath = dataPath + self.logLevel = logLevel } } diff --git a/glean-core/ios/Glean/Glean.swift b/glean-core/ios/Glean/Glean.swift index c2bb57e1e7..7195ce7752 100644 --- a/glean-core/ios/Glean/Glean.swift +++ b/glean-core/ios/Glean/Glean.swift @@ -190,7 +190,8 @@ public class Glean { delayPingLifetimeIo: false, appBuild: "0.0.0", useCoreMps: false, - trimDataToRegisteredPings: false + trimDataToRegisteredPings: false, + logLevel: configuration.logLevel ) let clientInfo = getClientInfo(configuration, buildInfo: buildInfo) let callbacks = OnGleanEventsImpl(glean: self) diff --git a/glean-core/python/glean/glean.py b/glean-core/python/glean/glean.py index 3912954048..5a82495a22 100644 --- a/glean-core/python/glean/glean.py +++ b/glean-core/python/glean/glean.py @@ -230,6 +230,7 @@ def initialize( use_core_mps=False, app_build=cls._application_build_id, trim_data_to_registered_pings=False, + log_level=None, ) _uniffi.glean_initialize(cfg, client_info, callbacks) diff --git a/glean-core/python/glean/net/ping_upload_worker.py b/glean-core/python/glean/net/ping_upload_worker.py index 06f7e76b3d..b843c00442 100644 --- a/glean-core/python/glean/net/ping_upload_worker.py +++ b/glean-core/python/glean/net/ping_upload_worker.py @@ -120,6 +120,7 @@ def _process(data_dir: Path, application_id: str, configuration) -> bool: use_core_mps=False, app_build="", trim_data_to_registered_pings=False, + log_level=None, ) if not glean_initialize_for_subprocess(cfg): log.error("Couldn't initialize Glean in subprocess") diff --git a/glean-core/rlb/src/configuration.rs b/glean-core/rlb/src/configuration.rs index 4a18d1acdc..145f1a5732 100644 --- a/glean-core/rlb/src/configuration.rs +++ b/glean-core/rlb/src/configuration.rs @@ -2,6 +2,8 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. +use log::LevelFilter; + use crate::net::PingUploader; use std::path::PathBuf; @@ -34,6 +36,8 @@ pub struct Configuration { /// Unless you know that all your and your libraries' pings are appropriately registered /// _before_ init, you shouldn't use this. pub trim_data_to_registered_pings: bool, + /// The internal logging level. + pub log_level: Option, } /// Configuration builder. @@ -68,6 +72,9 @@ pub struct Builder { /// _before_ init, you shouldn't use this. /// Default: `false` pub trim_data_to_registered_pings: bool, + /// Optional: The internal logging level. + /// Default: `None` + pub log_level: Option, } impl Builder { @@ -87,6 +94,7 @@ impl Builder { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, } } @@ -102,6 +110,7 @@ impl Builder { uploader: self.uploader, use_core_mps: self.use_core_mps, trim_data_to_registered_pings: self.trim_data_to_registered_pings, + log_level: self.log_level, } } diff --git a/glean-core/rlb/src/lib.rs b/glean-core/rlb/src/lib.rs index f4311a434b..d6ad16bdc1 100644 --- a/glean-core/rlb/src/lib.rs +++ b/glean-core/rlb/src/lib.rs @@ -118,6 +118,7 @@ fn initialize_internal(cfg: Configuration, client_info: ClientInfoMetrics) -> Op app_build: client_info.app_build.clone(), use_core_mps: cfg.use_core_mps, trim_data_to_registered_pings: cfg.trim_data_to_registered_pings, + log_level: cfg.log_level, }; glean_core::glean_initialize(core_cfg, client_info.into(), callbacks); diff --git a/glean-core/rlb/src/test.rs b/glean-core/rlb/src/test.rs index bad395f9cd..bca1993d0b 100644 --- a/glean-core/rlb/src/test.rs +++ b/glean-core/rlb/src/test.rs @@ -53,6 +53,7 @@ fn send_a_ping() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let _t = new_glean(Some(cfg), true); @@ -142,6 +143,7 @@ fn test_experiments_recording_before_glean_inits() { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), false, @@ -202,6 +204,7 @@ fn sending_of_foreground_background_pings() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let _t = new_glean(Some(cfg), true); @@ -284,6 +287,7 @@ fn sending_of_startup_baseline_ping() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), false, @@ -343,6 +347,7 @@ fn no_dirty_baseline_on_clean_shutdowns() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), false, @@ -373,6 +378,7 @@ fn initialize_must_not_crash_if_data_dir_is_messed_up() { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; test_reset_glean(cfg, ClientInfoMetrics::unknown(), false); @@ -419,6 +425,7 @@ fn queued_recorded_metrics_correctly_record_during_init() { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let _t = new_glean(Some(cfg), false); @@ -445,6 +452,7 @@ fn initializing_twice_is_a_noop() { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), true, @@ -465,6 +473,7 @@ fn initializing_twice_is_a_noop() { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), ); @@ -493,6 +502,7 @@ fn dont_handle_events_when_uninitialized() { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), true, @@ -557,6 +567,7 @@ fn the_app_channel_must_be_correctly_set_if_requested() { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, client_info, true, @@ -579,6 +590,7 @@ fn the_app_channel_must_be_correctly_set_if_requested() { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, client_info, true, @@ -642,6 +654,7 @@ fn ping_collection_must_happen_after_concurrently_scheduled_metrics_recordings() uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), true, @@ -723,6 +736,7 @@ fn core_metrics_should_be_cleared_and_restored_when_disabling_and_enabling_uploa uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), true, @@ -785,6 +799,7 @@ fn sending_deletion_ping_if_disabled_outside_of_run() { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let _t = new_glean(Some(cfg), true); @@ -802,6 +817,7 @@ fn sending_deletion_ping_if_disabled_outside_of_run() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), false, @@ -850,6 +866,7 @@ fn no_sending_of_deletion_ping_if_unchanged_outside_of_run() { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let _t = new_glean(Some(cfg), true); @@ -867,6 +884,7 @@ fn no_sending_of_deletion_ping_if_unchanged_outside_of_run() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), false, @@ -923,6 +941,7 @@ fn test_sending_of_startup_baseline_ping_with_application_lifetime_metric() { uploader: None, use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), true, @@ -955,6 +974,7 @@ fn test_sending_of_startup_baseline_ping_with_application_lifetime_metric() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }, ClientInfoMetrics::unknown(), false, @@ -1013,6 +1033,7 @@ fn setting_debug_view_tag_before_initialization_should_not_crash() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let _t = new_glean(Some(cfg), true); @@ -1071,6 +1092,7 @@ fn setting_source_tags_before_initialization_should_not_crash() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let _t = new_glean(Some(cfg), true); @@ -1128,6 +1150,7 @@ fn setting_source_tags_after_initialization_should_not_crash() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let _t = new_glean(Some(cfg), true); @@ -1199,6 +1222,7 @@ fn flipping_upload_enabled_respects_order_of_events() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; // We create a ping and a metric before we initialize Glean @@ -1267,6 +1291,7 @@ fn registering_pings_before_init_must_work() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let _t = new_glean(Some(cfg), true); @@ -1317,6 +1342,7 @@ fn test_a_ping_before_submission() { uploader: Some(Box::new(FakeUploader { sender: s })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let _t = new_glean(Some(cfg), true); @@ -1445,6 +1471,7 @@ fn signaling_done() { })), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let _t = new_glean(Some(cfg), true); diff --git a/glean-core/src/core/mod.rs b/glean-core/src/core/mod.rs index af7d694953..29ee1e52c7 100644 --- a/glean-core/src/core/mod.rs +++ b/glean-core/src/core/mod.rs @@ -112,6 +112,7 @@ where /// app_build: "".into(), /// use_core_mps: false, /// trim_data_to_registered_pings: false, +/// log_level: None, /// }; /// let mut glean = Glean::new(cfg).unwrap(); /// let ping = PingType::new("sample", true, false, vec![]); @@ -293,6 +294,7 @@ impl Glean { app_build: "Unknown".into(), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let mut glean = Self::new(cfg).unwrap(); diff --git a/glean-core/src/glean.udl b/glean-core/src/glean.udl index bbbe7f04f5..67466b4640 100644 --- a/glean-core/src/glean.udl +++ b/glean-core/src/glean.udl @@ -69,6 +69,17 @@ dictionary InternalConfiguration { string app_build; boolean use_core_mps; boolean trim_data_to_registered_pings; + LevelFilter? log_level; +}; + +// An enum representing the different logging levels for the `log` crate. +enum LevelFilter { + "Off", + "Error", + "Warn", + "Info", + "Debug", + "Trace", }; // Values for the `client_info` metrics. diff --git a/glean-core/src/lib.rs b/glean-core/src/lib.rs index d03d901ffa..83427762ed 100644 --- a/glean-core/src/lib.rs +++ b/glean-core/src/lib.rs @@ -25,6 +25,7 @@ use std::thread; use std::time::Duration; use crossbeam_channel::unbounded; +use log::{self, LevelFilter}; use once_cell::sync::{Lazy, OnceCell}; use uuid::Uuid; @@ -125,6 +126,8 @@ pub struct InternalConfiguration { pub use_core_mps: bool, /// Whether Glean should, on init, trim its event storage to only the registered pings. pub trim_data_to_registered_pings: bool, + /// The internal logging level. + pub log_level: Option, } /// Launches a new task on the global dispatch queue with a reference to the Glean singleton. @@ -306,6 +309,11 @@ fn initialize_inner( let upload_enabled = cfg.upload_enabled; let trim_data_to_registered_pings = cfg.trim_data_to_registered_pings; + // Set the internal logging level. + if let Some(level) = cfg.log_level { + log::set_max_level(level) + } + let glean = match Glean::new(cfg) { Ok(glean) => glean, Err(err) => { diff --git a/glean-core/tests/common/mod.rs b/glean-core/tests/common/mod.rs index 7c8c9836f1..34072b0389 100644 --- a/glean-core/tests/common/mod.rs +++ b/glean-core/tests/common/mod.rs @@ -59,6 +59,7 @@ pub fn new_glean(tempdir: Option) -> (Glean, tempfile::TempDi app_build: "Unknown".into(), use_core_mps: false, trim_data_to_registered_pings: false, + log_level: None, }; let glean = Glean::new(cfg).unwrap(); diff --git a/samples/rust/src/main.rs b/samples/rust/src/main.rs index ee5e24c65a..82412580b2 100644 --- a/samples/rust/src/main.rs +++ b/samples/rust/src/main.rs @@ -37,6 +37,7 @@ fn main() { uploader: None, use_core_mps: true, trim_data_to_registered_pings: false, + log_level: None, }; let client_info = ClientInfoMetrics { From 280e980aef669f30776e9458914d641d2ecf0c29 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Fri, 5 May 2023 08:36:11 -0400 Subject: [PATCH 06/12] Synchronize Gradle dependencies with Android Components --- CHANGELOG.md | 2 ++ build.gradle | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae7377e464..b5a2a6ce98 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ * General * Allow user to configure how verbose the internal logging is ([#2459](https://github.com/mozilla/glean/pull/2459)) +* Kotlin + * Update Kotlin to version 1.8.21 ([#2462](https://github.com/mozilla/glean/pull/2462)) # v52.6.0 (2023-04-20) diff --git a/build.gradle b/build.gradle index a612c26207..a559ecd1a1 100644 --- a/build.gradle +++ b/build.gradle @@ -11,24 +11,24 @@ buildscript { // changing them. Please note that, for using in Android-Components, the // versions below must match the ones in that repository. ext.versions = [ - android_gradle_plugin: '7.4.1', + android_gradle_plugin: '7.4.2', coroutines: '1.6.4', jna: '5.13.0', junit: '4.12', mockito: '3.11.2', mockwebserver: '4.9.1', // This is different than a-c, but we're fine, it's only tests. - kotlin: '1.8.20', - robolectric: '4.9.2', + kotlin: '1.8.21', + robolectric: '4.10.1', rust_android_plugin: '0.9.3', // Android X dependencies - androidx_annotation: '1.5.0', - androidx_appcompat: '1.3.0', - androidx_browser: '1.3.0', - androidx_core: '1.9.0', + androidx_annotation: '1.6.0', + androidx_appcompat: '1.6.1', + androidx_browser: '1.5.0', + androidx_core: '1.10.0', androidx_espresso: '3.5.1', androidx_junit: '1.1.5', - androidx_lifecycle: '2.5.1', + androidx_lifecycle: '2.6.1', androidx_test: '1.5.0', androidx_work: '2.7.1', androidx_uiautomator: '2.2.0', From 7fa05463c24b8ea0c746d3aa6fe51d6a097cd4d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 05:56:46 +0000 Subject: [PATCH 07/12] Bump flake8-bugbear from 23.3.23 to 23.5.9 in /glean-core/python Bumps [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) from 23.3.23 to 23.5.9. - [Release notes](https://github.com/PyCQA/flake8-bugbear/releases) - [Commits](https://github.com/PyCQA/flake8-bugbear/compare/23.3.23...23.5.9) --- updated-dependencies: - dependency-name: flake8-bugbear dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- glean-core/python/requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glean-core/python/requirements_dev.txt b/glean-core/python/requirements_dev.txt index d71d74a16a..959497dd85 100644 --- a/glean-core/python/requirements_dev.txt +++ b/glean-core/python/requirements_dev.txt @@ -2,7 +2,7 @@ auditwheel==5.3.0 black==23.3.0; python_version > '3.6' coverage==7.2.2; python_version > '3.6' flake8==6.0.0; python_version >= '3.8' -flake8-bugbear==23.3.23; python_version >= '3.8' +flake8-bugbear==23.5.9; python_version >= '3.8' jsonschema==3.2.0 mypy==1.2.0; python_version > '3.6' pdoc3==0.10.0 From b45cb190cec5051046d8def8ed1996a3de8f159d Mon Sep 17 00:00:00 2001 From: Travis Long Date: Mon, 8 May 2023 14:31:28 -0500 Subject: [PATCH 08/12] Bug 1830937 - Make `setLogPings` and `setDebugViewTag` public for Android --- CHANGELOG.md | 1 + .../android/src/main/java/mozilla/telemetry/glean/Glean.kt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5a2a6ce98..574a313382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ * Allow user to configure how verbose the internal logging is ([#2459](https://github.com/mozilla/glean/pull/2459)) * Kotlin * Update Kotlin to version 1.8.21 ([#2462](https://github.com/mozilla/glean/pull/2462)) + * Make debugging APIs available on Android ([Bug 1830937](https://bugzilla.mozilla.org/show_bug.cgi?id=1830937)) # v52.6.0 (2023-04-20) diff --git a/glean-core/android/src/main/java/mozilla/telemetry/glean/Glean.kt b/glean-core/android/src/main/java/mozilla/telemetry/glean/Glean.kt index 6325c02100..7198f3e5b2 100644 --- a/glean-core/android/src/main/java/mozilla/telemetry/glean/Glean.kt +++ b/glean-core/android/src/main/java/mozilla/telemetry/glean/Glean.kt @@ -422,7 +422,7 @@ open class GleanInternalAPI internal constructor() { * * @param value The value of the tag, which must be a valid HTTP header value. */ - internal fun setDebugViewTag(value: String): Boolean { + fun setDebugViewTag(value: String): Boolean { return gleanSetDebugViewTag(value) } @@ -479,7 +479,7 @@ open class GleanInternalAPI internal constructor() { * * @param value The value of the option. */ - internal fun setLogPings(value: Boolean) { + fun setLogPings(value: Boolean) { gleanSetLogPings(value) } From 5f4b8f2f9431e7b4777f65c6f678d9c8540d495e Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Wed, 3 May 2023 12:45:16 +0200 Subject: [PATCH 09/12] At shutdown block with a timeout and bail out if that fails. --- glean-core/src/dispatcher/global.rs | 7 +++++++ glean-core/src/dispatcher/mod.rs | 23 ++++++++++++++++++++++- glean-core/src/lib.rs | 14 ++++++++++++-- 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/glean-core/src/dispatcher/global.rs b/glean-core/src/dispatcher/global.rs index fec5bb6365..f90a681a5e 100644 --- a/glean-core/src/dispatcher/global.rs +++ b/glean-core/src/dispatcher/global.rs @@ -6,8 +6,10 @@ use once_cell::sync::Lazy; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::RwLock; use std::thread; +use std::time::Duration; use super::{DispatchError, DispatchGuard, Dispatcher}; +use crossbeam_channel::RecvTimeoutError; #[cfg(feature = "preinit_million_queue")] pub const GLOBAL_DISPATCHER_LIMIT: usize = 1000000; @@ -76,6 +78,11 @@ pub fn block_on_queue() { guard().block_on_queue(); } +/// Block until all tasks prior to this call are processed, with a timeout. +pub fn block_on_queue_timeout(timeout: Duration) -> Result<(), RecvTimeoutError> { + guard().block_on_queue_timeout(timeout) +} + /// Starts processing queued tasks in the global dispatch queue. /// /// This function blocks until queued tasks prior to this call are finished. diff --git a/glean-core/src/dispatcher/mod.rs b/glean-core/src/dispatcher/mod.rs index 17f7f5df0b..257695c34e 100644 --- a/glean-core/src/dispatcher/mod.rs +++ b/glean-core/src/dispatcher/mod.rs @@ -29,9 +29,10 @@ use std::{ Arc, }, thread::{self, JoinHandle}, + time::Duration, }; -use crossbeam_channel::{bounded, unbounded, SendError, Sender}; +use crossbeam_channel::{bounded, unbounded, RecvTimeoutError, SendError, Sender}; use thiserror::Error; pub use global::*; @@ -161,6 +162,26 @@ impl DispatchGuard { .expect("Failed to receive message on single-use channel"); } + /// Block on the task queue emptying, with a timeout. + fn block_on_queue_timeout(&self, timeout: Duration) -> Result<(), RecvTimeoutError> { + let (tx, rx) = crossbeam_channel::bounded(0); + + // We explicitly don't use `self.launch` here. + // We always put this task on the unbounded queue. + // The pre-init queue might be full before its flushed, in which case this would panic. + // Blocking on the queue can only work if it is eventually flushed anyway. + + let task = Command::Task(Box::new(move || { + tx.send(()) + .expect("(worker) Can't send message on single-use channel"); + })); + self.sender + .send(task) + .expect("Failed to launch the blocking task"); + + rx.recv_timeout(timeout) + } + fn kill(&mut self) -> Result<(), DispatchError> { // We immediately stop queueing in the pre-init buffer. let old_val = self.queue_preinit.swap(false, Ordering::SeqCst); diff --git a/glean-core/src/lib.rs b/glean-core/src/lib.rs index 83427762ed..dd53f107a6 100644 --- a/glean-core/src/lib.rs +++ b/glean-core/src/lib.rs @@ -565,8 +565,18 @@ pub fn shutdown() { glean.set_dirty_flag(false); }); - // We need to wait for above task to finish. - dispatcher::block_on_queue(); + // We need to wait for above task to finish, + // but we also don't wait around forever. + // + // TODO: Make the timeout configurable? + // The default hang watchdog on Firefox waits 60s, + // Glean's `uploader_shutdown` further below waits up to 30s. + if dispatcher::block_on_queue_timeout(Duration::from_secs(10)).is_err() { + log::error!( + "Timeout while blocking on the dispatcher. No further shutdown cleanup will happen." + ); + return; + } if let Err(e) = dispatcher::shutdown() { log::error!("Can't shutdown dispatcher thread: {:?}", e); From ce37542b8f7944c807a1c6e408dd27279619511e Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Thu, 4 May 2023 19:27:40 +0200 Subject: [PATCH 10/12] Instrument wait time for the dispatcher at shutdown --- glean-core/metrics.yaml | 17 +++++++++++++++++ glean-core/src/internal_metrics.rs | 15 +++++++++++++++ glean-core/src/lib.rs | 13 +++++++++++++ 3 files changed, 45 insertions(+) diff --git a/glean-core/metrics.yaml b/glean-core/metrics.yaml index e52c1704c1..bf7cb418e0 100644 --- a/glean-core/metrics.yaml +++ b/glean-core/metrics.yaml @@ -744,6 +744,23 @@ glean.validation: - jrediger@mozilla.com expires: never + shutdown_dispatcher_wait: + type: timing_distribution + time_unit: millisecond + description: | + Time waited for the dispatcher to unblock during shutdown. + Most samples are expected to be below the 10s timeout used. + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1828066 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1828066#c7 + data_sensitivity: + - technical + notification_emails: + - glean-team@mozilla.com + - jrediger@mozilla.com + expires: never + glean: restarted: type: event diff --git a/glean-core/src/internal_metrics.rs b/glean-core/src/internal_metrics.rs index 897d04437a..1a1c5576f2 100644 --- a/glean-core/src/internal_metrics.rs +++ b/glean-core/src/internal_metrics.rs @@ -24,6 +24,9 @@ pub struct AdditionalMetrics { /// Time waited for the uploader at shutdown. pub shutdown_wait: TimingDistributionMetric, + + /// Time waited for the dispatcher to unblock during shutdown. + pub shutdown_dispatcher_wait: TimingDistributionMetric, } impl CoreMetrics { @@ -97,6 +100,18 @@ impl AdditionalMetrics { }, TimeUnit::Millisecond, ), + + shutdown_dispatcher_wait: TimingDistributionMetric::new( + CommonMetricData { + name: "shutdown_dispatcher_wait".into(), + category: "glean.validation".into(), + send_in_pings: vec!["metrics".into()], + lifetime: Lifetime::Ping, + disabled: false, + dynamic_label: None, + }, + TimeUnit::Millisecond, + ), } } } diff --git a/glean-core/src/lib.rs b/glean-core/src/lib.rs index dd53f107a6..7d6ea2f179 100644 --- a/glean-core/src/lib.rs +++ b/glean-core/src/lib.rs @@ -571,12 +571,25 @@ pub fn shutdown() { // TODO: Make the timeout configurable? // The default hang watchdog on Firefox waits 60s, // Glean's `uploader_shutdown` further below waits up to 30s. + let timer_id = core::with_glean(|glean| { + glean + .additional_metrics + .shutdown_dispatcher_wait + .start_sync() + }); if dispatcher::block_on_queue_timeout(Duration::from_secs(10)).is_err() { log::error!( "Timeout while blocking on the dispatcher. No further shutdown cleanup will happen." ); return; } + let stop_time = time::precise_time_ns(); + core::with_glean(|glean| { + glean + .additional_metrics + .shutdown_dispatcher_wait + .set_stop_and_accumulate(glean, timer_id, stop_time); + }); if let Err(e) = dispatcher::shutdown() { log::error!("Can't shutdown dispatcher thread: {:?}", e); From 9118a0e321a75270bebaa9bb99b6e96bfeb09b14 Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Wed, 10 May 2023 10:53:27 +0200 Subject: [PATCH 11/12] Document new timeout-at-shutdown feature --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 574a313382..18897c7666 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ * General * Allow user to configure how verbose the internal logging is ([#2459](https://github.com/mozilla/glean/pull/2459)) + * Added a timeout waiting for the dispatcher at shutdown ([#2461](https://github.com/mozilla/glean/pull/2461)) + * Added a new Glean metric `glean.validation.shutdown_dispatcher_wait` measuring the wait time at shutdown ([#2461](https://github.com/mozilla/glean/pull/2461)) * Kotlin * Update Kotlin to version 1.8.21 ([#2462](https://github.com/mozilla/glean/pull/2462)) * Make debugging APIs available on Android ([Bug 1830937](https://bugzilla.mozilla.org/show_bug.cgi?id=1830937)) From e30297bd3fc7ff6c6bdd46bf660d40637ee5f44c Mon Sep 17 00:00:00 2001 From: Jan-Erik Rediger Date: Wed, 10 May 2023 11:02:29 +0200 Subject: [PATCH 12/12] Bumped version to 52.7.0 --- .buildconfig.yml | 2 +- CHANGELOG.md | 6 +++++- Cargo.lock | 4 ++-- DEPENDENCIES.md | 4 ++-- glean-core/Cargo.toml | 2 +- glean-core/python/setup.py | 2 +- glean-core/rlb/Cargo.toml | 4 ++-- .../telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy | 2 +- 8 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.buildconfig.yml b/.buildconfig.yml index c409b080c9..4a79ee0ca4 100644 --- a/.buildconfig.yml +++ b/.buildconfig.yml @@ -1,4 +1,4 @@ -libraryVersion: 52.6.0 +libraryVersion: 52.7.0 groupId: org.mozilla.telemetry projects: glean: diff --git a/CHANGELOG.md b/CHANGELOG.md index 18897c7666..b6b9b98f32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ # Unreleased changes -[Full changelog](https://github.com/mozilla/glean/compare/v52.6.0...main) +[Full changelog](https://github.com/mozilla/glean/compare/v52.7.0...main) + +# v52.7.0 (2023-05-10) + +[Full changelog](https://github.com/mozilla/glean/compare/v52.6.0...v52.7.0) * General * Allow user to configure how verbose the internal logging is ([#2459](https://github.com/mozilla/glean/pull/2459)) diff --git a/Cargo.lock b/Cargo.lock index d7eb2a5393..be776e4ab7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -318,7 +318,7 @@ dependencies = [ [[package]] name = "glean" -version = "52.6.0" +version = "52.7.0" dependencies = [ "chrono", "crossbeam-channel", @@ -361,7 +361,7 @@ dependencies = [ [[package]] name = "glean-core" -version = "52.6.0" +version = "52.7.0" dependencies = [ "android_logger", "bincode", diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 52fd64960a..d8a198ac46 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -4543,9 +4543,9 @@ You may use this code under the terms of either license. The following text applies to code linked from these dependencies: -* [glean 52.6.0]( https://github.com/mozilla/glean ) +* [glean 52.7.0]( https://github.com/mozilla/glean ) * [glean-build 7.1.0]( https://github.com/mozilla/glean ) -* [glean-core 52.6.0]( https://github.com/mozilla/glean ) +* [glean-core 52.7.0]( https://github.com/mozilla/glean ) * [zeitstempel 0.1.1]( https://github.com/badboy/zeitstempel ) ``` diff --git a/glean-core/Cargo.toml b/glean-core/Cargo.toml index d191031066..575680085f 100644 --- a/glean-core/Cargo.toml +++ b/glean-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glean-core" -version = "52.6.0" +version = "52.7.0" authors = ["Jan-Erik Rediger ", "The Glean Team "] description = "A modern Telemetry library" repository = "https://github.com/mozilla/glean" diff --git a/glean-core/python/setup.py b/glean-core/python/setup.py index e7b7afca92..475dc89a57 100644 --- a/glean-core/python/setup.py +++ b/glean-core/python/setup.py @@ -56,7 +56,7 @@ history = history_file.read() # glean version. Automatically updated by the bin/prepare_release.sh script -version = "52.6.0" +version = "52.7.0" requirements = [ "semver>=2.13.0", diff --git a/glean-core/rlb/Cargo.toml b/glean-core/rlb/Cargo.toml index 9dd21932f5..08670ce5fe 100644 --- a/glean-core/rlb/Cargo.toml +++ b/glean-core/rlb/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "glean" -version = "52.6.0" +version = "52.7.0" authors = ["Jan-Erik Rediger ", "The Glean Team "] description = "Glean SDK Rust language bindings" repository = "https://github.com/mozilla/glean" @@ -23,7 +23,7 @@ maintenance = { status = "actively-developed" } [dependencies.glean-core] path = ".." -version = "52.6.0" +version = "52.7.0" [dependencies] crossbeam-channel = "0.5" diff --git a/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy b/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy index d04903a19e..ff7166c985 100644 --- a/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy +++ b/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy @@ -555,7 +555,7 @@ except: void apply(Project project) { isOffline = project.gradle.startParameter.offline - project.ext.glean_version = "52.6.0" + project.ext.glean_version = "52.7.0" def parserVersion = gleanParserVersion(project) // Print the required glean_parser version to the console. This is