-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[processor/probabilisticsampler] panics when non-Bytes log attribute chosen #18222
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
facing same issue. any solutions? |
When doing a probabilistic sampling for logs, the probabilistic sampler currently requires the source attribute to be of bytes value. This PR changes that to allow any value type to be used. Fixes #18222 Signed-off-by: Juraci Paixão Kröhling <[email protected]>
I submitted a PR to get this fixed. |
When doing a probabilistic sampling for logs, the probabilistic sampler currently requires the source attribute to be of bytes value. This PR changes that to allow any value type to be used. Fixes #18222 Signed-off-by: Juraci Paixão Kröhling <[email protected]> --------- Signed-off-by: Juraci Paixão Kröhling <[email protected]>
…emetry#26564) When doing a probabilistic sampling for logs, the probabilistic sampler currently requires the source attribute to be of bytes value. This PR changes that to allow any value type to be used. Fixes open-telemetry#18222 Signed-off-by: Juraci Paixão Kröhling <[email protected]> --------- Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Component(s)
processor/probabilisticsampler
What happened?
Description
It is possible to configure the processor to sample based upon an arbitrary attribute of each log record. Currently, if you provide an attribute that is not a
Bytes
typed attribute, then the collector will panic with something similar to the following:Effectively, when
Bytes()
is called on any attribute value that is not of typeAnyValue_BytesValue
here:opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor/logsprocessor.go
Lines 75 to 80 in b2f0015
The returned
BytesSlice
will be zero-initialised, resulting in theAsRaw()
call panicking.Steps to Reproduce
Configure the processor to sample based on an attribute of each log record, where the attribute is not of type
Bytes
e.g.,Expected Result
Either the attribute value is used for a sampling decision, or the log record is skipped and not sampled.
Actual Result
The collector panics.
Collector version
latest
Environment information
Environment
All
OpenTelemetry Collector configuration
No response
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: