-
Notifications
You must be signed in to change notification settings - Fork 896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metric configuration and alternative metric attributes #26762
Conversation
} | ||
|
||
if (include_refcode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we always include the refcode now?
In what cases would we omit the refcode before this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, we had a small allowlist of a few metrics that included the refcode. In this PR, we only include the refcode is the kRef
attribute is provided in the attribute list in the metric config. By default, it's not included.
@@ -88,6 +88,9 @@ class MessageManager : public MetricLogStore::Delegate { | |||
std::string_view histogram_name, | |||
std::optional<bool> only_update_for_constellation = std::nullopt); | |||
|
|||
const std::optional<MetricConfig>* GetMetricConfig( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not return a reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The std::optional<MetricConfig>
may not exist i.e. in the case of dynamic metrics, which do not have metric configs in metric_names.h.
619bd06
to
e947c6e
Compare
7a3dd4b
to
fccf72d
Compare
fccf72d
to
e0b4897
Compare
e0b4897
to
5f508b6
Compare
[puLL-Merge] - brave/brave-core@26762 DescriptionThis PR introduces significant changes to the P3A (Privacy-Preserving Product Analytics) system in Brave Core. It adds more granular control over metric configurations, introduces new region and subregion identifiers, and refactors the way metrics are collected and processed. Possible Issues
Security Hotspots
ChangesChanges
sequenceDiagram
participant Client
participant MessageManager
participant P3AService
participant MetricConfig
participant RegionIdentifier
Client->>P3AService: Report metric
P3AService->>MessageManager: Handle metric change
MessageManager->>MetricConfig: Get metric configuration
MessageManager->>RegionIdentifier: Get region identifiers
MessageManager->>MessageManager: Generate constellation message
MessageManager->>Client: Prepare metric for upload
|
Released in v1.75.117 |
Resolves brave/brave-browser#42541
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
See #20264. Ignore step 1.