title: Latency SLO from logs on GCP Cloud Logging
body: <p>I need to calculate a Latency SLO based on two timestamps logged by two separate containers (one on Cloud Run and one on GKE).</p>
  <pre><code>YYYYMMDD-HHMMSS1: This event/1234567890 is event1 (start) for which we have easy regex1 on Cloud Run
  YYYYMMDD-HHMMSS2: [event/1234567890] This is event2 (end) with different regex for same event on GKE
  </code></pre>
  <p>I have multiple events which luckily appear in both logs with slightly different regexes so I can easily find START and END by event_id and that is unique. Now what I need is to inject this delta into Cloud Logging so here are my questions:</p>
  <ol>
  <li>Is there a way to do this natively on former Stackdriver (GCP Cloud Monitoring) via Log 2 metrics?</li>
  <li>If not, what's the cheapest way (I presume a Cloud Function or a naive GKE pod/service in perennial while(1){parse_logs()} to implement this?</li>
  <li>Is there any boilerplate code you can point me at?</li>
  </ol>
  <p>Thanks everyone in advance.</p>