Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Increased error rate for metrics.search_count and browser.search.in_content metrics due to invalid label #25602

Closed
badboy opened this issue Jun 13, 2022 · 4 comments · Fixed by #26436 or nathanmkaya/fenix#108
Assignees
Labels
eng:qa:verified QA Verified
Milestone

Comments

@badboy
Copy link
Member

badboy commented Jun 13, 2022

We see a spike in errors for the metrics.search_count metric (Our monitoring dashboard, see the "Invalid Label" graph on the top right).

Channel: release.
The relevant code:

Metrics.searchCount["$identifier.$source"].add()

Labels are restricted to lowercase alphanumerics, underscores, dashes and dots (see also our docs).
Maybe the identifier or source contains other characters? or the identifier is not always lowercased?

┆Issue is synchronized with this Jira Task

@github-actions github-actions bot added the needs:triage Issue needs triage label Jun 13, 2022
@cpeterso
Copy link

cpeterso commented Aug 8, 2022

Looks like we're still seeing "Invalid Label" errors for the metrics.search_count and browser.search.in_content metrics, about 400 and 300 errors per day, respectively:

https://mozilla.cloud.looker.com/explore/fenix/metrics?qid=y2mXoHm29rnZSzSbpnfiPi&origin_space=746&toggle=vis

image

@cpeterso cpeterso changed the title Increased error rate for metrics.search_count due to invalid label Increased error rate for metrics.search_count and browser.search.in_content metrics due to invalid label Aug 8, 2022
@Mugurell
Copy link
Contributor

The source can only take some values and it is always lowercased:

enum class Source {
ACTION, SHORTCUT, SUGGESTION, TOPSITE, WIDGET, NONE
}
/**
* Records the appropriate metric for performed searches.
* @engine the engine used for searching.
* @isDefault whether te engine is the default engine or not.
* @searchAccessPoint the source of the search. Can be one of the values of [Source].
*/
fun recordSearchMetrics(
engine: SearchEngine,
isDefault: Boolean,
searchAccessPoint: Source
) {
val identifier = if (engine.type == SearchEngine.Type.CUSTOM) "custom" else engine.id
val source = searchAccessPoint.name.lowercase()

 

The identifier of bundled search engines is not lowercased before recording the telemetry and seems like we have some search engines which do use uppercase letters, eg: wikipedia-zh-CN.

Seems like lowercasing the search engine ids in Fenix/Focus before recording the telemetry is the best approach which would also ensure no newer search engines could cause this issue even if they are set to use uppercase letters.

@Mugurell Mugurell self-assigned this Aug 11, 2022
Mugurell added a commit to Mugurell/fenix that referenced this issue Aug 11, 2022
@mergify mergify bot closed this as completed in #26436 Aug 12, 2022
@github-actions github-actions bot added this to the 105 milestone Aug 12, 2022
Alexandru2909 pushed a commit to Alexandru2909/fenix that referenced this issue Aug 12, 2022
@github-actions github-actions bot added the eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged label Aug 12, 2022
@gabrielluong gabrielluong reopened this Aug 12, 2022
@gabrielluong gabrielluong added eng:qa:needed QA Needed and removed eng:reopen-for-qa Reopens and tags the issue for QA needed when the issue is merged labels Aug 12, 2022
@Mugurell
Copy link
Contributor

Looking in Nightly it seems like the occurences went down a bit but might be too early to tell.
https://mozilla.cloud.looker.com/dashboards/382?Channel=mozdata.org%5E_mozilla%5E_fenix.metrics&Submission+Date=14+day+ago+for+14+day

@SoftVision-LorandJanos
Copy link

For the past 14 days:
On Nightly metrics.search_count was between 0 and 4.
image
On Nightly browser.search.in_content was between 0 and 7.
image

On Beta metrics.search_count was between 0 and 2.
image
On Beta browser.search.in_content was between 2 and 28.
image

Closing the ticket as verified.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
eng:qa:verified QA Verified
Projects
None yet
5 participants