Class DelegatingMetricData

java.lang.Object
io.opentelemetry.sdk.metrics.data.DelegatingMetricData
All Implemented Interfaces:
MetricData

public abstract class DelegatingMetricData extends Object implements MetricData
A MetricData which delegates all methods to another MetricData. Extend this class to modify the MetricData that will be exported, for example by creating a delegating MetricExporter which wraps MetricData with a custom implementation.

Example usage:


 // class MetricDataWithCustomDescription extends DelegatingMetricData {
 //
 //   private final String description;
 //
 //   MetricDataWithCustomDescription(MetricData delegate) {
 //     super(delegate);
 //     this.description = delegate.getDescription() + " (custom)";
 //   }
 //
 //   @Override
 //   public String getDescription() {
 //     return description;
 //   }
 // }
 
Since:
1.50.0