Skip to content

Commit

Permalink
Fix/sinker break again (#2032)
Browse files Browse the repository at this point in the history
* fix(agent): fix metric types in switch

Signed-off-by: Luiz Pegoraro <luiz.pegoraro@encora.com>

* fix(sinker): fix inject

Signed-off-by: Luiz Pegoraro <luiz.pegoraro@encora.com>

Signed-off-by: Luiz Pegoraro <luiz.pegoraro@encora.com>
  • Loading branch information
lpegoraro authored Nov 18, 2022
1 parent cdfce3d commit f397266
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sinker/otel/orbreceiver/otlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ func (r *OrbReceiver) injectAttribute(metricsRequest pmetricotlp.Request, attrib
}
case pmetric.MetricTypeHistogram:
for i := 0; i < metricItem.Histogram().DataPoints().Len(); i++ {
metricItem.Gauge().DataPoints().At(i).Attributes().PutStr(attribute, value)
metricItem.Histogram().DataPoints().At(i).Attributes().PutStr(attribute, value)
}
case pmetric.MetricTypeSum:
for i := 0; i < metricItem.Sum().DataPoints().Len(); i++ {
metricItem.Gauge().DataPoints().At(i).Attributes().PutStr(attribute, value)
metricItem.Sum().DataPoints().At(i).Attributes().PutStr(attribute, value)
}
case pmetric.MetricTypeSummary:
for i := 0; i < metricItem.Summary().DataPoints().Len(); i++ {
metricItem.Gauge().DataPoints().At(i).Attributes().PutStr(attribute, value)
metricItem.Summary().DataPoints().At(i).Attributes().PutStr(attribute, value)
}
default:
r.cfg.Logger.Error("Unknown metric type: " + metricItem.Type().String())
Expand Down

0 comments on commit f397266

Please sign in to comment.