Refactor example to add metric data