Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

[Full Changelog](In progress)

### Ads Client
- Add agnostic telemetry support (compatible with Glean)

# v147.0 (_2025-12-07_)

### Relay
Expand Down
1 change: 1 addition & 0 deletions automation/build_ios_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export PROJECT=MozillaRustComponentsWrapper
./tools/sdk_generator.sh \
-g Glean \
-o ./megazords/ios-rust/Sources/MozillaRustComponentsWrapper/Generated/Glean \
"${SOURCE_ROOT}"/components/ads-client/metrics.yaml \
"${SOURCE_ROOT}"/components/nimbus/metrics.yaml \
"${SOURCE_ROOT}"/components/logins/metrics.yaml \
"${SOURCE_ROOT}"/components/sync_manager/metrics.yaml \
Expand Down
36 changes: 36 additions & 0 deletions components/ads-client/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,48 @@
buildscript {
if (gradle.hasProperty("mozconfig")) {
repositories {
gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORIES.each { repository ->
maven {
url = repository
if (gradle.mozconfig.substs.ALLOW_INSECURE_GRADLE_REPOSITORIES) {
allowInsecureProtocol = true
}
}
}
}

dependencies {
classpath libs.mozilla.glean.gradle.plugin
}
}
}

plugins {
alias libs.plugins.python.envs.plugin
}

apply from: "$appServicesRootDir/build-scripts/component-common.gradle"
apply from: "$appServicesRootDir/publish.gradle"

ext {
gleanNamespace = "mozilla.telemetry.glean"
gleanYamlFiles = ["${project.projectDir}/../metrics.yaml"]
if (gradle.hasProperty("mozconfig")) {
gleanPythonEnvDir = gradle.mozconfig.substs.GRADLE_GLEAN_PARSER_VENV
}
}
apply plugin: "org.mozilla.telemetry.glean-gradle-plugin"

android {
namespace 'org.mozilla.appservices.ads_client'
}

dependencies {
api project(":httpconfig")

implementation libs.mozilla.glean

testImplementation libs.mozilla.glean.forUnitTests
}

ext.configureUniFFIBindgen("ads_client")
Expand Down
127 changes: 127 additions & 0 deletions components/ads-client/metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# 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/.


---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0


ads_client:
build_cache_error:
type: labeled_string
description: >
Errors encountered when building the HTTP cache, labeled by error type.
The string value contains the error message or error type.
labels:
- builder_error
- database_error
- empty_db_path
- invalid_max_size
- invalid_ttl
bugs:
- https://github.com/mozilla/application-services/pull/7111
data_reviews:
- https://github.com/mozilla/application-services/pull/7111
data_sensitivity:
- technical
notification_emails:
- [email protected]
- [email protected]
- [email protected]
expires: never

client_error:
type: labeled_string
description: >
Errors encountered when using the ads client, labeled by operation type.
The string value contains the error message or error type. Errors are
recorded even if they are propagated to the consumer.
labels:
- record_click
- record_impression
- report_ad
- request_ads
bugs:
- https://github.com/mozilla/application-services/pull/7111
data_reviews:
- https://github.com/mozilla/application-services/pull/7111
data_sensitivity:
- interaction
notification_emails:
- [email protected]
- [email protected]
- [email protected]
expires: never

client_operation_total:
type: labeled_counter
description: >
The total number of operations attempted by the ads client, labeled by
operation type. Used as the denominator for client_operation_success_rate.
labels:
- new
- record_click
- record_impression
- report_ad
- request_ads
bugs:
- https://github.com/mozilla/application-services/pull/7111
data_reviews:
- https://github.com/mozilla/application-services/pull/7111
data_sensitivity:
- interaction
notification_emails:
- [email protected]
- [email protected]
- [email protected]
expires: never

deserialization_error:
type: labeled_string
description: >
Deserialization errors encountered when parsing AdResponse data,
labeled by error type. The string value contains the error message or
details. Invalid ad items are skipped but these errors are tracked for
monitoring data quality issues.
labels:
- invalid_ad_item
- invalid_array
- invalid_structure
bugs:
- https://github.com/mozilla/application-services/pull/7111
data_reviews:
- https://github.com/mozilla/application-services/pull/7111
data_sensitivity:
- technical
notification_emails:
- [email protected]
- [email protected]
- [email protected]
expires: never

http_cache_outcome:
type: labeled_string
description: >
The total number of outcomes encountered during read operations on the
http cache, labeled by type. The string value contains the error message or
error type.
labels:
- cleanup_failed
- hit
- lookup_failed
- miss_not_cacheable
- miss_stored
- no_cache
- store_failed
bugs:
- https://github.com/mozilla/application-services/pull/7111
data_reviews:
- https://github.com/mozilla/application-services/pull/7111
data_sensitivity:
- technical
notification_emails:
- [email protected]
- [email protected]
- [email protected]
expires: never
Loading