Skip to content

Commit

Permalink
[chore] fix exhaustive lint for cumulativetodel processor (open-telem…
Browse files Browse the repository at this point in the history
…etry#24024)

**Description:** 
related: open-telemetry#23266

Signed-off-by: Ziqi Zhao <[email protected]>
  • Loading branch information
fatsheep9146 committed Jul 7, 2023
1 parent c1a4094 commit e221afb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,6 @@ issues:
- path: statsdreceiver
linters:
- exhaustive
- path: cumulativetodeltaprocessor
linters:
- exhaustive
- path: deltatorateprocessor
linters:
- exhaustive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func (t *MetricTracker) Convert(in MetricPoint) (out DeltaValue, valid bool) {
case pmetric.MetricTypeSum:
out.IntValue = metricPoint.IntValue
out.FloatValue = metricPoint.FloatValue
case pmetric.MetricTypeEmpty, pmetric.MetricTypeGauge, pmetric.MetricTypeExponentialHistogram, pmetric.MetricTypeSummary:
}
switch t.initialValue {
case InitialValueAuto:
Expand All @@ -133,6 +134,7 @@ func (t *MetricTracker) Convert(in MetricPoint) (out DeltaValue, valid bool) {
valid = true
case InitialValueKeep:
valid = true
case InitialValueDrop:
}
return
}
Expand Down Expand Up @@ -193,6 +195,7 @@ func (t *MetricTracker) Convert(in MetricPoint) (out DeltaValue, valid bool) {

out.IntValue = delta
}
case pmetric.MetricTypeEmpty, pmetric.MetricTypeGauge, pmetric.MetricTypeExponentialHistogram, pmetric.MetricTypeSummary:
}

state.PrevPoint = metricPoint
Expand Down
2 changes: 2 additions & 0 deletions processor/cumulativetodeltaprocessor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ func (ctdp *cumulativeToDeltaProcessor) processMetrics(_ context.Context, md pme

ms.SetAggregationTemporality(pmetric.AggregationTemporalityDelta)
return ms.DataPoints().Len() == 0
case pmetric.MetricTypeEmpty, pmetric.MetricTypeGauge, pmetric.MetricTypeExponentialHistogram, pmetric.MetricTypeSummary:
fallthrough
default:
return false
}
Expand Down

0 comments on commit e221afb

Please sign in to comment.