Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying an Exponential Histogram results in nil pointer dereference #27409

Closed
mfranklin opened this issue Oct 3, 2023 · 2 comments · Fixed by #27410
Closed

Copying an Exponential Histogram results in nil pointer dereference #27409

mfranklin opened this issue Oct 3, 2023 · 2 comments · Fixed by #27410
Assignees
Labels
bug Something isn't working processor/metricstransform Metrics Transform processor

Comments

@mfranklin
Copy link
Contributor

Component(s)

processor/metricstransform

What happened?

Description

Attempting to perform any operation that copies an exponential histogram will result in a nil pointer dereference error as the code currently calls the incorrect method on the metric.

Steps to Reproduce

Have a config that attempts an operation on an exponential histogram metric that results in a copy, such as combine

Expected Result

The metric is correctly processed and exported.

Actual Result

A nil pointer dereference error is printed to the logs.

Collector version

v0.86.0

Environment information

Environment

All

OpenTelemetry Collector configuration

processors:
  metricstransform:
    transforms:
      - include: ^<regex_for_exponential_histogram_metric>\.(?P<new_label>.+)$
        match_type: regexp
        action: combine
        new_name: new_metric

Log output

service/service.go:161	Everything is ready. Begin running and processing data.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x2287efb]

goroutine 51 [running]:
go.opentelemetry.io/collector/pdata/pmetric.Histogram.AggregationTemporality(...)
	/go/pkg/mod/go.opentelemetry.io/collector/[email protected]/pmetric/generated_histogram.go:45

Additional context

No response

@mfranklin mfranklin added bug Something isn't working needs triage New item requiring triage labels Oct 3, 2023
@github-actions github-actions bot added the processor/metricstransform Metrics Transform processor label Oct 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member

crobert-1 commented Oct 3, 2023

I'm not super familiar with this component, but removing needs triage as the PR shows the bug pretty clearly. Thanks for filing and fixing @mfranklin!

@crobert-1 crobert-1 removed the needs triage New item requiring triage label Oct 3, 2023
codeboten pushed a commit that referenced this issue Oct 6, 2023
…27410)

Fixes a bug where the wrong function was called for the exponential
histogram type during the copy operation.

Fixes #27409

Added a test for `combine` that covers the failing code path.
jmsnll pushed a commit to jmsnll/opentelemetry-collector-contrib that referenced this issue Nov 12, 2023
…pen-telemetry#27410)

Fixes a bug where the wrong function was called for the exponential
histogram type during the copy operation.

Fixes open-telemetry#27409

Added a test for `combine` that covers the failing code path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working processor/metricstransform Metrics Transform processor
Projects
None yet
2 participants