@@ -152,7 +152,7 @@ func NewEncodeOtlpMetrics(opMetrics *operational.Metrics, params config.StagePar
152152 mInfo := metrics .Preprocess (mCfg )
153153 switch mCfg .Type {
154154 case api .MetricCounter :
155- counter , err := meter .Float64Counter (fullMetricName )
155+ counter , err := meter .Float64Counter (fullMetricName , metric . WithDescription ( mCfg . Help ) )
156156 if err != nil {
157157 log .Errorf ("error during counter creation: %v" , err )
158158 return nil , err
@@ -163,6 +163,7 @@ func NewEncodeOtlpMetrics(opMetrics *operational.Metrics, params config.StagePar
163163 obs := Float64Gauge {observations : make (map [string ]Float64GaugeEntry )}
164164 gauge , err := meterFactory .Float64ObservableGauge (
165165 fullMetricName ,
166+ metric .WithDescription (mCfg .Help ),
166167 metric .WithFloat64Callback (obs .Callback ),
167168 )
168169 if err != nil {
@@ -173,12 +174,12 @@ func NewEncodeOtlpMetrics(opMetrics *operational.Metrics, params config.StagePar
173174 case api .MetricHistogram :
174175 var histo metric.Float64Histogram
175176 if len (mCfg .Buckets ) == 0 {
176- histo , err = meter .Float64Histogram (fullMetricName )
177+ histo , err = meter .Float64Histogram (fullMetricName , metric . WithDescription ( mCfg . Help ) )
177178 } else {
178179 histo , err = meter .Float64Histogram (fullMetricName ,
180+ metric .WithDescription (mCfg .Help ),
179181 metric .WithExplicitBucketBoundaries (mCfg .Buckets ... ),
180182 )
181-
182183 }
183184 if err != nil {
184185 log .Errorf ("error during histogram creation: %v" , err )
0 commit comments