init: log a metric when service startup fails

Today, if daisydog fails to start up properly, it gets logged as respawn
too fast failure by upstart, and that's it.  Add a metric to track this
better over all devices so we can see if we need to add more logic here
in the future.

TEST=start up logged the metric

Change-Id: I5f317c408581b4892a1c3d61a58f2d79f66fa97a
Commit-Ready: Mike Frysinger <>
Tested-by: Mike Frysinger <>
Reviewed-by: Luigi Semenzato <>
diff --git a/daisydog.conf b/daisydog.conf
index df1640c..70d712c 100644
--- a/daisydog.conf
+++ b/daisydog.conf
@@ -28,6 +28,8 @@
     # exist as in a VM), and exit (which halts the init script entirely).
     logger -t "${UPSTART_JOB}" -p daemon.error \
       "error: watchdog startup failed: ${output}"
+    # Log a metric so we can keep tabs on when this happens in real life.
+    metrics_client -v Watchdog.StartupFailed
     exit 1