Includes annotations with statsd reports.

It's tricky to determine the source of the metrics on a device
currently since we can take the union of multiple configs and send
only one giant statsd_config into statsd. We will use the int64 field
to track the sub config id's and the int32 field to track the version
for each sub config, but the fields are named more generically as
annotations.

The annotations are available in both the reports and metadata.

Test: Check that all unit-tests pass on marlin-eng
Bug: 77327261
Change-Id: Ic37c549c8b2991676f69948c515156765c9f5108
diff --git a/cmds/statsd/src/guardrail/StatsdStats.h b/cmds/statsd/src/guardrail/StatsdStats.h
index bd395c4..a1b0ee2 100644
--- a/cmds/statsd/src/guardrail/StatsdStats.h
+++ b/cmds/statsd/src/guardrail/StatsdStats.h
@@ -66,6 +66,9 @@
     // Stores the number of times an anomaly detection alert has been declared.
     // The map size is capped by kMaxConfigCount.
     std::map<const int64_t, int> alert_stats;
+
+    // Stores the config ID for each sub-config used.
+    std::list<std::pair<const int64_t, const int32_t>> annotations;
 };
 
 struct UidMapStats {
@@ -142,7 +145,9 @@
      * If the config is not valid, this config stats will be put into icebox immediately.
      */
     void noteConfigReceived(const ConfigKey& key, int metricsCount, int conditionsCount,
-                            int matchersCount, int alertCount, bool isValid);
+                            int matchersCount, int alertCount,
+                            const std::list<std::pair<const int64_t, const int32_t>>& annotations,
+                            bool isValid);
     /**
      * Report a config has been removed.
      */