Skip to content

Commit

Permalink
removed redundant definition of metricsProcessed metric
Browse files Browse the repository at this point in the history
  • Loading branch information
KalmanMeth committed Nov 20, 2023
1 parent 4a75737 commit 8eea719
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 37 deletions.
16 changes: 0 additions & 16 deletions docs/operational-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,6 @@ Each table below provides documentation for an exported flowlogs-pipeline operat
| **Labels** | stage |


### metrics_dropped
| **Name** | metrics_dropped |
|:---|:---|
| **Description** | Number of metrics dropped |
| **Type** | counter |
| **Labels** | stage |


### metrics_processed
| **Name** | metrics_processed |
|:---|:---|
| **Description** | Number of metrics processed |
| **Type** | counter |
| **Labels** | stage |


### metrics_processed
| **Name** | metrics_processed |
|:---|:---|
Expand Down
8 changes: 4 additions & 4 deletions pkg/pipeline/encode/encode_prom.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ type EncodeProm struct {
}

var (
metricsProcessed = operational.DefineMetric(
MetricsProcessed = operational.DefineMetric(
"metrics_processed",
"Number of metrics processed",
operational.TypeCounter,
"stage",
)
metricsDropped = operational.DefineMetric(
MetricsDropped = operational.DefineMetric(
"metrics_dropped",
"Number of metrics dropped",
operational.TypeCounter,
Expand Down Expand Up @@ -350,8 +350,8 @@ func NewEncodeProm(opMetrics *operational.Metrics, params config.StageParam) (En
mCache: putils.NewTimedCache(cfg.MaxMetrics, mChacheLenMetric),
mChacheLenMetric: mChacheLenMetric,
exitChan: putils.ExitChannel(),
metricsProcessed: opMetrics.NewCounter(&metricsProcessed, params.Name),
metricsDropped: opMetrics.NewCounter(&metricsDropped, params.Name),
metricsProcessed: opMetrics.NewCounter(&MetricsProcessed, params.Name),
metricsDropped: opMetrics.NewCounter(&MetricsDropped, params.Name),
errorsCounter: opMetrics.NewCounterVec(&encodePromErrors),
}
go w.cleanupExpiredEntriesLoop()
Expand Down
19 changes: 2 additions & 17 deletions pkg/pipeline/encode/opentelemetry/encode_otlpmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,21 +81,6 @@ type EncodeOtlpMetrics struct {
metricsDropped prometheus.Counter
}

var (
metricsProcessed = operational.DefineMetric(
"metrics_processed",
"Number of metrics processed",
operational.TypeCounter,
"stage",
)
metricsDropped = operational.DefineMetric(
"metrics_dropped",
"Number of metrics dropped",
operational.TypeCounter,
"stage",
)
)

// Encode encodes a metric to be exported
func (e *EncodeOtlpMetrics) Encode(metricRecord config.GenericMap) {
log.Tracef("entering EncodeOtlpMetrics. entry = %v", metricRecord)
Expand Down Expand Up @@ -260,8 +245,8 @@ func NewEncodeOtlpMetrics(opMetrics *operational.Metrics, params config.StagePar
expiryTime: expiryTime.Duration,
mCache: putils.NewTimedCache(0, nil),
exitChan: putils.ExitChannel(),
metricsProcessed: opMetrics.NewCounter(&metricsProcessed, params.Name),
metricsDropped: opMetrics.NewCounter(&metricsDropped, params.Name),
metricsProcessed: opMetrics.NewCounter(&encode.MetricsProcessed, params.Name),
metricsDropped: opMetrics.NewCounter(&encode.MetricsDropped, params.Name),
}
go w.cleanupExpiredEntriesLoop()
return w, nil
Expand Down

0 comments on commit 8eea719

Please sign in to comment.