@@ -190,8 +190,8 @@ func (c *CachedTGatherer) InsertInPlace(entry Metric) error {
190
190
if ! ok {
191
191
mf = & family {
192
192
MetricFamily : & dto.MetricFamily {
193
- Name : proto . String ( "" ),
194
- Help : proto . String ( "" ),
193
+ Name : new ( string ),
194
+ Help : new ( string ),
195
195
},
196
196
metricsByHash : map [uint64 ]* metric {},
197
197
}
@@ -215,8 +215,8 @@ func (c *CachedTGatherer) InsertInPlace(entry Metric) error {
215
215
}
216
216
for j := range entry .LabelNames {
217
217
p := & dto.LabelPair {
218
- Name : proto . String ( "" ),
219
- Value : proto . String ( "" ),
218
+ Name : new ( string ),
219
+ Value : new ( string ),
220
220
}
221
221
* p .Name = entry .LabelNames [j ]
222
222
* p .Value = entry .LabelValues [j ]
@@ -234,7 +234,7 @@ func (c *CachedTGatherer) InsertInPlace(entry Metric) error {
234
234
case prometheus .CounterValue :
235
235
v := m .Counter
236
236
if v == nil {
237
- v = & dto.Counter {Value : proto . Float64 ( 0 )}
237
+ v = & dto.Counter {Value : new ( float64 )}
238
238
}
239
239
* v .Value = entry .Value
240
240
m .Counter = v
@@ -243,7 +243,7 @@ func (c *CachedTGatherer) InsertInPlace(entry Metric) error {
243
243
case prometheus .GaugeValue :
244
244
v := m .Gauge
245
245
if v == nil {
246
- v = & dto.Gauge {Value : proto . Float64 ( 0 )}
246
+ v = & dto.Gauge {Value : new ( float64 )}
247
247
}
248
248
* v .Value = entry .Value
249
249
m .Counter = nil
@@ -252,7 +252,7 @@ func (c *CachedTGatherer) InsertInPlace(entry Metric) error {
252
252
case prometheus .UntypedValue :
253
253
v := m .Untyped
254
254
if v == nil {
255
- v = & dto.Untyped {Value : proto . Float64 ( 0 )}
255
+ v = & dto.Untyped {Value : new ( float64 )}
256
256
}
257
257
* v .Value = entry .Value
258
258
m .Counter = nil
0 commit comments