commit | 637ba23e7daa3df844f35f6d2d85b6899f44e886 | [log] [tgz] |
---|---|---|
author | Francois Rousseau <frousseau@google.com> | Thu Oct 14 22:38:48 2021 +0000 |
committer | releases-try-builder <releases-try-builder@fuchsia-infra.iam.gserviceaccount.com> | Fri Oct 15 01:09:43 2021 +0000 |
tree | a224882bae5519bb128682994764d3c109ecea96 | |
parent | b6ed9e10cf46219aa9ababcb0f93d6e7e12c40ec [diff] |
[local_storage] new data_partition_upgrade metric * this is the F1R version of fxrev.dev/594148 given that F1R did not have the 1.1 metric defined * Sampler is sending an Occurrence so the metric type should be EVENT_COUNT – going with a new metric ID to be safer * this still requires fshost to change its Inspect field type and the Sampler config to be changed to the new metric ID * fix the report name that's redundant with the metric name Bug: 86635 Change-Id: Ia400d5aecf253f309971a721e1f5ab8544821119
This Git repo contains the registry of customers, projects, metrics and reports for the Cobalt telemetry system.
Cobalt is a system for telemetry with built-in privacy. It is a pipeline for collecting metrics data from user-owned devices in the field and producing aggregate reports. Cobalt includes a suite of features for preserving user privacy and anonymity while giving product owners the data they need to improve their products. A software or hardware developer would use Cobalt to learn about the behavior of their products in the field, in order to make them better.
In order to use Cobalt, a developer must register a project. Within the project a developer must register one or more metrics. Within a metric a developer must register one or more reports. These registrations all involve entries into .yaml files in this repository.
You will need a project, one or more metrics, and one or more reports.
If you are part of a team that is already using Cobalt you likely can use your team's existing project. Projects are grouped into Customers. A customer represents a larger organization consisting of many teams. For example, as of this writing, fuchsia is a customer representing the group of people and projects involved in developing the Fuchsia operating system. Within the Fuchsia customer there are several projects such as connectivity_wlan and local_storage.
The list of customers and projects is in projects.yaml. Add a new customer or project to that file as necessary.
Associated with each customer there is a directory in this repo and associated with each project there is a directory below the parent customer directory. For example associated with the connectivity_wlan project within the fuchsia customer is the directory fuchsia/connectivity_wlan. If you create a new project you must also create a new project directory of the same name.
Within your project's directory (see Register a project above) there must be a file named metrics.yaml
. This is where you register your metrics and reports. If you just created a new project you should now create metrics.yaml
. In this case you can copy one of the metrics.yaml
files from one of the other projects to use as a template.
Inside of metrics.yaml
there is a field called metric_definitions
that contains a list of metric definitions. You must add a new entry for your new metric. You must give your new metric a name distinct from the names of the other metrics in the file and you must assign it the next available integer ID.
The reports
field within a metric definition contains the list of registered reports associated with the metric. You do not need to register any reports in order to start logging data for the new metric. But Cobalt will not send any data to the server nor generate any reports for the metric until you do.
Under the hood, Cobalt will translate the data in metrics.yaml
into a protocol buffer message. It is useful to know this because then you can use the definition of the proto messages as the specification for the corresponding fields in the yaml file. Each metric definition entry will be translated into a MetricDefinition
proto message as defined in metric_definition.proto and each report definition entry will be translated into a ReportDefinition
proto message as defined in report_definition.proto. This translation is accomplished at build time by Cobalt's registry parser.