In the current Metrics API & SDK design, ALL bound instruments that have active references are made into records to be exported. This includes those instruments that have received no updates in the current collection cycle. This can clutter the exporter output and should be changed to only export instruments that have been recently updated (in the current collection cycle).
Candidate Solution
A solution would be to add a bool variable called updated_ to the base Aggregator class. Each time the function aggregator.update() is called, set that variable equal to true. When aggregator.checkpoint() is called set the variable equal to false. Then, in the GetRecords() functions in the SDK instrument classes, check to see if aggregator.updated_ == true before checkpointing and making a record from an instrument. If this check evaluates to false, simply skip the instrument in the for loop.
In the current Metrics API & SDK design, ALL bound instruments that have active references are made into records to be exported. This includes those instruments that have received no updates in the current collection cycle. This can clutter the exporter output and should be changed to only export instruments that have been recently updated (in the current collection cycle).
Candidate Solution
A solution would be to add a bool variable called updated_ to the base Aggregator class. Each time the function aggregator.update() is called, set that variable equal to true. When aggregator.checkpoint() is called set the variable equal to false. Then, in the GetRecords() functions in the SDK instrument classes, check to see if aggregator.updated_ == true before checkpointing and making a record from an instrument. If this check evaluates to false, simply skip the instrument in the for loop.