mozilla / glean-dictionary

Public-facing dictionary of Glean (and Glean-derived) metadata
https://dictionary.telemetry.mozilla.org
Mozilla Public License 2.0
25 stars 45 forks source link

"Code Search" queries are not precise/helpful #2009

Open Dexterp37 opened 10 months ago

Dexterp37 commented 10 months ago

I think our code search links are broken / can be improved. For example this metric's code search links to this but it only finds tests. Something like this would work instead. The main difference is that I'm also adding just the name to the search (i.e. deviceTotalRam), leaving out the category. The reason why this works is that in Kotlin allows to import full namespaces like that.

@chutten , thoughts?

chutten commented 10 months ago

That works because the unqualified name is specific enough. If it's generic, we'd see a lot of nonsense. We could filter based on the length or number of words in the metric name so we don't do it for e.g. identifier or autofilled.

Might work? Ideally we could limit this solely to metrics that might be used in Kotlin, but though we can guess that today from its presence in mozilla-mobile, that won't last for long... though we do know the application. Maybe we could have a map of app_id to known supported conjugation strategies? (and any app we haven't configured would just try them all?).

Yeah, I think there's something clever we could do here.