Skip to content

probabilisticsamplerprocessor logs error events with log level info #39887

Open
@svenmueller

Description

@svenmueller

Component(s)

processor/probabilisticsampler

What happened?

Description

The probabilisticsamplerprocessor component in the opentelemetry-collector-contrib repository is emitting log events that represent errors (i.e., they include an "error" field with error details) but are logged at the info level instead of the expected error level. This can lead to confusion for operators and makes it more difficult to monitor and alert on actual error conditions, as these events do not appear in error-level log queries (or are hidden when using level: WARN as default log level in production envs).

Steps to Reproduce

  • Deploy the OpenTelemetry Collector with the probabilisticsamplerprocessor enabled in a pipeline.
  • Trigger a scenario that causes the processor to encounter an error (e.g., misconfiguration or invalid input).
  • Observe the logs produced by the collector.

Expected Result

Error events (i.e., log entries that include an "error" field or indicate a failure condition) should be logged at the warn/error level (not as info).

Actual Result

Error events are logged at the info level, even though they represent error conditions. This results in important error information being less visible and not following standard logging practices.

Collector version

0.121.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

Service:
  Telemetry:
    Logs:
      Encoding:  json
      Level:     WARN

Log output

{"level":"info","ts":"2025-05-06T07:17:21.894Z","caller":"[email protected]/sampler_mode.go:491","msg":"traces sampler","otelcol.component.id":"probabilistic_sampler","otelcol.component.kind":"Processor","otelcol.pipeline.id":"traces","otelcol.signal":"traces","error":"invalid syntax"}

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions