Skip to content

Commit

Permalink
[processor/transform] Fix panic on gauge type (#13907)
Browse files Browse the repository at this point in the history
* fix panic for gauge data types in transformprocessor

* add changelog entry
  • Loading branch information
schmikei committed Sep 6, 2022
1 parent 676a326 commit 4281e84
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion processor/transformprocessor/internal/metrics/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (p *Processor) ProcessMetrics(_ context.Context, td pmetric.Metrics) (pmetr
case pmetric.MetricDataTypeSum:
p.handleNumberDataPoints(metric.Sum().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource())
case pmetric.MetricDataTypeGauge:
p.handleNumberDataPoints(metric.Sum().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource())
p.handleNumberDataPoints(metric.Gauge().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource())
case pmetric.MetricDataTypeHistogram:
p.handleHistogramDataPoints(metric.Histogram().DataPoints(), metrics.At(k), metrics, smetrics.Scope(), rmetrics.Resource())
case pmetric.MetricDataTypeExponentialHistogram:
Expand Down
16 changes: 16 additions & 0 deletions unreleased/transform-fix-panic-gauge-type.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: transformprocessor

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Fixes panic of transformprocessor handling Gauge types

# One or more tracking issues related to the change
issues: [13905]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

0 comments on commit 4281e84

Please sign in to comment.