Skip to content

Gather data for fetch metrics (but do not transmit) V2#2391

Open
cjreynol wants to merge 9 commits intogoogle:mainfrom
cjreynol:fetch_metrics_plumbing_v2
Open

Gather data for fetch metrics (but do not transmit) V2#2391
cjreynol wants to merge 9 commits intogoogle:mainfrom
cjreynol:fetch_metrics_plumbing_v2

Conversation

@cjreynol
Copy link
Copy Markdown
Collaborator

(Updated version of #2290 after #2387)

Gather the data for fetch metrics and make it available in metrics_conversion.cc, ready to be added to the transmitted proto AFTER the new fields are approved.

Also, includes some changes to the existing device metrics gathering to account for a the new fetch metrics logic paths.

Bug: 491965176

Comment thread base/cvd/cuttlefish/host/libs/metrics/fetch_metrics_orchestration.h
@cjreynol cjreynol requested a review from Databean April 14, 2026 20:38
Comment thread base/cvd/cuttlefish/host/libs/metrics/fetch_metrics.cc Outdated
Comment thread base/cvd/cuttlefish/host/libs/metrics/fetch_metrics.cc Outdated
Comment thread base/cvd/cuttlefish/host/libs/metrics/fetch_metrics.h
Comment thread base/cvd/cuttlefish/host/libs/metrics/fetch_metrics_orchestration.h
Comment thread base/cvd/cuttlefish/host/libs/metrics/fetch_metrics_orchestration.cc Outdated
@cjreynol cjreynol force-pushed the fetch_metrics_plumbing_v2 branch 3 times, most recently from 6f9bd1b to a3e334d Compare April 17, 2026 00:55
@cjreynol cjreynol requested a review from Databean April 17, 2026 00:55
@cjreynol cjreynol added kokoro:force-run Trigger a presubmit build unconditionally. kokoro:run Run e2e tests. labels Apr 17, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Apr 17, 2026
Comment thread base/cvd/cuttlefish/host/libs/metrics/metrics_orchestration.h Outdated
@cjreynol cjreynol force-pushed the fetch_metrics_plumbing_v2 branch from a3e334d to 9f0aa6a Compare April 17, 2026 21:18
@cjreynol cjreynol added kokoro:force-run Trigger a presubmit build unconditionally. kokoro:run Run e2e tests. labels Apr 17, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Apr 17, 2026
@cjreynol cjreynol force-pushed the fetch_metrics_plumbing_v2 branch from 9f0aa6a to 32332d1 Compare April 20, 2026 19:05
@cjreynol cjreynol added kokoro:force-run Trigger a presubmit build unconditionally. kokoro:run Run e2e tests. labels Apr 20, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Apr 20, 2026
@cjreynol cjreynol force-pushed the fetch_metrics_plumbing_v2 branch from 32332d1 to 908096a Compare April 23, 2026 01:06
@cjreynol cjreynol added kokoro:force-run Trigger a presubmit build unconditionally. kokoro:run Run e2e tests. labels Apr 23, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Apr 23, 2026
@cjreynol cjreynol added kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Apr 23, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Apr 23, 2026
@cjreynol cjreynol force-pushed the fetch_metrics_plumbing_v2 branch from 7e26614 to 0b07356 Compare April 23, 2026 02:27
@cjreynol cjreynol added kokoro:force-run Trigger a presubmit build unconditionally. kokoro:run Run e2e tests. labels Apr 23, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Apr 23, 2026
When fetch metrics are added, the `DeviceEventType` enum will not be the
only set of possible values used for creating the filenames.

Bug: 491965176
Move that to a `DeviceMetricsInput` and have it own the base data (which
is only one field, but will expand as the base metrics gathering
expands).

This will be mirrored with a `FetchMetricsInput` in an upcoming commit,
so that each `*Input` class has only the data it contains and the shared
`metrics_orchestration.h/cc` logic does not need to know about the
divergent implementations.

Bug: 491965176
To also be used by fetch metrics gathering.

Bug: 491965176
To be used in `MetricsData` to hold for conversion.

Bug: 491965176
To be used in `CvdFetchCommandHandler`.

Bug: 491965176
Note, this is only completing the data gathering steps, not
transmission.  The new fetch fields do not yet exist in the proto and
are not being populated in `metrics_conversion.cc`.

Bug: 491965176
@cjreynol cjreynol force-pushed the fetch_metrics_plumbing_v2 branch from 0b07356 to 9b49ead Compare April 24, 2026 22:12
@cjreynol cjreynol added kokoro:force-run Trigger a presubmit build unconditionally. kokoro:run Run e2e tests. labels Apr 24, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Apr 24, 2026
To help with debugging.

Bug: 506233124
For debugging errors in the metrics tests.  Particularly to make the V2
`metrics.log` available for review.

Bug: 506233124
Specifically for device metrics generation.  Now that fetch operations
can generate metrics events, by the time `cvd create` is run a
session_id file may already exist.  In particular, this was occuring in
Kokoro test runs, where the fetch target directory and the `cvd create`
home directory were identical.  That caused the `metrics` directory
created to hold these V2 metrics files to be the same, and `cvd create`
events (device instantiation) were failing trying to create a
`metrics_session_id.txt` file when one already existed.

Bug: 491965176
@cjreynol cjreynol force-pushed the fetch_metrics_plumbing_v2 branch from 9b49ead to 3c2df9a Compare April 24, 2026 23:58
@cjreynol cjreynol added kokoro:force-run Trigger a presubmit build unconditionally. kokoro:run Run e2e tests. labels Apr 24, 2026
@GoogleCuttlefishTesterBot GoogleCuttlefishTesterBot removed kokoro:run Run e2e tests. kokoro:force-run Trigger a presubmit build unconditionally. labels Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants