Skip to content

Commit

Permalink
[otelarrow/netstats] prefix metrics with otelcol_
Browse files Browse the repository at this point in the history
This used to be automatically added previously via the prometheus exporter's WithNamespace configuration. That has been removed in open-telemetry/opentelemetry-collector#9759

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
  • Loading branch information
codeboten committed Jul 22, 2024
1 parent 12d41f4 commit 7b0db89
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/otelarrow/netstats/netstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,17 @@ func NewExporterNetworkReporter(settings exporter.Settings) (*NetworkReporter, e

var errors, err error
if level > configtelemetry.LevelNormal {
rep.compSizeHisto, err = meter.Int64Histogram(ExporterKey+"_"+CompSize, metric.WithDescription(compSizeDescription), metric.WithUnit(bytesUnit))
rep.compSizeHisto, err = meter.Int64Histogram("otelcol_"+ExporterKey+"_"+CompSize, metric.WithDescription(compSizeDescription), metric.WithUnit(bytesUnit))
errors = multierr.Append(errors, err)
}

rep.sentBytes, rep.sentWireBytes, err = makeSentMetrics(ExporterKey, meter, true)
rep.sentBytes, rep.sentWireBytes, err = makeSentMetrics("otelcol_"+ExporterKey, meter, true)
errors = multierr.Append(errors, err)

// Normally, an exporter counts sent bytes, and skips received
// bytes. LevelDetailed will reveal exporter-received bytes.
if level > configtelemetry.LevelNormal {
rep.recvBytes, rep.recvWireBytes, err = makeRecvMetrics(ExporterKey, meter, false)
rep.recvBytes, rep.recvWireBytes, err = makeRecvMetrics("otelcol_"+ExporterKey, meter, false)
errors = multierr.Append(errors, err)
}

Expand All @@ -179,17 +179,17 @@ func NewReceiverNetworkReporter(settings receiver.Settings) (*NetworkReporter, e

var errors, err error
if level > configtelemetry.LevelNormal {
rep.compSizeHisto, err = meter.Int64Histogram(ReceiverKey+"_"+CompSize, metric.WithDescription(compSizeDescription), metric.WithUnit(bytesUnit))
rep.compSizeHisto, err = meter.Int64Histogram("otelcol_"+ReceiverKey+"_"+CompSize, metric.WithDescription(compSizeDescription), metric.WithUnit(bytesUnit))
errors = multierr.Append(errors, err)
}

rep.recvBytes, rep.recvWireBytes, err = makeRecvMetrics(ReceiverKey, meter, true)
rep.recvBytes, rep.recvWireBytes, err = makeRecvMetrics("otelcol_"+ReceiverKey, meter, true)
errors = multierr.Append(errors, err)

// Normally, a receiver counts received bytes, and skips sent
// bytes. LevelDetailed will reveal receiver-sent bytes.
if level > configtelemetry.LevelNormal {
rep.sentBytes, rep.sentWireBytes, err = makeSentMetrics(ReceiverKey, meter, false)
rep.sentBytes, rep.sentWireBytes, err = makeSentMetrics("otelcol_"+ReceiverKey, meter, false)
errors = multierr.Append(errors, err)
}

Expand Down

0 comments on commit 7b0db89

Please sign in to comment.