Fix oneof getters, avoid returning new objects. (#1717)
Fix oneof getters, avoid returning new objects. (#1717)

Avoid returning new objects which are not connected with the parent metric, this way if calling InitEmpty or changing anything we change the right metric.

Signed-off-by: Bogdan Drutu <3f8e17047c2434e5c82a61403e56b9ef3e226d99@gmail.com>
open-telemetry/opentelemetry-collector-contrib,open-telemetry/opentelemetry-collector-contrib,open-telemetry/opentelemetry-collector,open-telemetry/opentelemetry-collector,open-telemetry/opentelemetry-collector