Skip to content
This repository was archived by the owner on Jul 28, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Main (unreleased)

- [BUGFIX] spanmetric `traces_spanmetrics_calls_total_total` renamed to `traces_spanmetrics_calls_total`

- [BUGFIX] `const_labels` in `traces_config` is now correctly parsed in the remote writer exporter (@fredr)

- [ENHANCEMENT] opentelemetry trace exporters can now be configured to support Oauth utilizing
Expand Down
33 changes: 12 additions & 21 deletions pkg/traces/remotewriteexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ import (
)

const (
nameLabelKey = "__name__"
sumSuffix = "sum"
countSuffix = "count"
bucketSuffix = "bucket"
leStr = "le"
infBucket = "+Inf"
counterSuffix = "total"
noSuffix = ""
nameLabelKey = "__name__"
sumSuffix = "sum"
countSuffix = "count"
bucketSuffix = "bucket"
leStr = "le"
infBucket = "+Inf"
noSuffix = ""
)

type dataPoint interface {
Expand Down Expand Up @@ -161,25 +160,17 @@ func (e *remoteWriteExporter) handleHistogramIntDataPoints(app storage.Appender,
}

func (e *remoteWriteExporter) processScalarMetric(app storage.Appender, m pdata.Metric) error {
switch m.DataType() {
case pdata.MetricDataTypeSum:
dataPoints := m.Sum().DataPoints()
if err := e.handleScalarIntDataPoints(app, m.Name(), counterSuffix, dataPoints); err != nil {
return err
}
case pdata.MetricDataTypeGauge:
dataPoints := m.Gauge().DataPoints()
if err := e.handleScalarIntDataPoints(app, m.Name(), noSuffix, dataPoints); err != nil {
return err
}
dataPoints := m.Gauge().DataPoints()
Comment thread
fredr marked this conversation as resolved.
Outdated
if err := e.handleScalarIntDataPoints(app, m.Name(), dataPoints); err != nil {
return err
}
return nil
}

func (e *remoteWriteExporter) handleScalarIntDataPoints(app storage.Appender, name, suffix string, dataPoints pdata.NumberDataPointSlice) error {
func (e *remoteWriteExporter) handleScalarIntDataPoints(app storage.Appender, name string, dataPoints pdata.NumberDataPointSlice) error {
for ix := 0; ix < dataPoints.Len(); ix++ {
dataPoint := dataPoints.At(ix)
if err := e.appendDataPoint(app, name, suffix, dataPoint, float64(dataPoint.IntVal())); err != nil {
if err := e.appendDataPoint(app, name, noSuffix, dataPoint, float64(dataPoint.IntVal())); err != nil {
return err
}
}
Expand Down