Currently CDAP application/programs can emit metrics using Metrics API (https://github.com/cdapio/cdap/blob/develop/cdap-api/src/main/java/io/cdap/cdap/api/metrics/Metrics.java#L23) However current Metrics API does not allow programs to add additional tags to the metrics context.
For CDC type applications, it would be useful to have table names as a part of metric context so that application can emit metrics such as number of inserts, deletes operations as well as these metrics can be aggregated across all tables.
Proposal for adding following new methods to the Metrics interface.
While MetricsTag is simple POJO holding following information
We don't necessarily need to maintain ordering of tags in the metrics context. So updated the API after discussing with as follows: