Skip to content

Commit

Permalink
Merge branch 'release-v52.7.0' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
badboy committed May 10, 2023
2 parents a20b278 + e30297b commit a7bad39
Show file tree
Hide file tree
Showing 31 changed files with 292 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .buildconfig.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libraryVersion: 52.6.0
libraryVersion: 52.7.0
groupId: org.mozilla.telemetry
projects:
glean:
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# 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))
* 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))

# v52.6.0 (2023-04-20)

Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4331,9 +4331,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 )

```
Expand Down
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.10',
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',
Expand Down
1 change: 1 addition & 0 deletions docs/user/reference/general/initializing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
95 changes: 95 additions & 0 deletions docs/user/reference/metrics/timing_distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

<div data-lang="Kotlin" class="tab">

```Kotlin
import org.mozilla.yourApplication.GleanMetrics.Pages

fun onPageLoaded(e: Event) {
Pages.pageLoad.accumulateSamples(samples)
}
```

</div>
<div data-lang="Java" class="tab">

```Java
import org.mozilla.yourApplication.GleanMetrics.Pages;

void onPageLoaded(Event e) {
Pages.INSTANCE.pageLoad().accumulateSamples(samples);
}
```

</div>
<div data-lang="Swift" class="tab">

```Swift
import Glean

func onPageLoaded() {
Pages.pageLoad.accumulateSamples(samples)
}
```

</div>
<div data-lang="Python" class="tab">

```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)
```

</div>
<div data-lang="Rust" class="tab">

This API is not currently exposed in Rust, see [Bug 1829745](https://bugzilla.mozilla.org/show_bug.cgi?id=1829745).

</div>
<div data-lang="JavaScript" class="tab">

```Javascript
import * as pages from "./path/to/generated/files/pages.js";

function onPageLoaded() {
pages.pageLoad.accumulateSamples(samples);
}
```

</div>
<div data-lang="Firefox Desktop" class="tab">

This API is not currently exposed in Firefox Desktop, see [Bug 1829745](https://bugzilla.mozilla.org/show_bug.cgi?id=1829745).

</div>

#### 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.
Expand Down
2 changes: 1 addition & 1 deletion glean-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "glean-core"
version = "52.6.0"
version = "52.7.0"
authors = ["Jan-Erik Rediger <jrediger@mozilla.com>", "The Glean Team <glean-team@mozilla.com>"]
description = "A modern Telemetry library"
repository = "https://github.com/mozilla/glean"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -421,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)
}

Expand Down Expand Up @@ -478,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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
Expand All @@ -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 {
/**
Expand Down
6 changes: 5 additions & 1 deletion glean-core/ios/Glean/Config/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}
}
3 changes: 2 additions & 1 deletion glean-core/ios/Glean/Glean.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 17 additions & 0 deletions glean-core/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions glean-core/python/glean/glean.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions glean-core/python/glean/net/ping_upload_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion glean-core/python/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion glean-core/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions glean-core/rlb/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "glean"
version = "52.6.0"
version = "52.7.0"
authors = ["Jan-Erik Rediger <jrediger@mozilla.com>", "The Glean Team <glean-team@mozilla.com>"]
description = "Glean SDK Rust language bindings"
repository = "https://github.com/mozilla/glean"
Expand All @@ -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"
Expand Down
Loading

0 comments on commit a7bad39

Please sign in to comment.