Measure the operation with a monotonic clock and ingest the final duration. This avoids clock changes affecting the result.
Configure a Sum meter whose filter matches job.completed and whose aggregation property is metadata.duration_ms.
This example records successful jobs. If failed work is billable, catch the error, record a separate event name, and then rethrow it.