Skip to content

When using the ReplayFIle option in the otlpjsonfilereceiver, we get spammy logs #39855

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

Closed
ridwanmsharif opened this issue May 5, 2025 · 2 comments · Fixed by #39861
Closed
Labels
enhancement New feature or request needs triage New item requiring triage pkg/stanza/fileconsumer

Comments

@ridwanmsharif
Copy link
Member

Component(s)

pkg/stanza/fileconsumer

Is your feature request related to a problem? Please describe.

Specifically this log:

ReplayFile bool `mapstructure:"replay_file"`

Describe the solution you'd like

I believe this is happening because when the ReplayFile option is used, the fileconsumer uses the noStateTracker file tracker:

And this results in a new reader created each time a scrape is done:

r, err := m.readerFactory.NewReader(file, fp)

To fix this, maybe we check for the tracker here before logging this log line.

Describe alternatives you've considered

Alternative 1: Remove this log line
Alternative 2: Allow the otlpjsonfilereceiver mute some errors

Additional context

No response

@ridwanmsharif ridwanmsharif added enhancement New feature or request needs triage New item requiring triage labels May 5, 2025
Copy link
Contributor

github-actions bot commented May 5, 2025

Pinging code owners:

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

@ridwanmsharif
Copy link
Member Author

I'll send a PR with my suggestion: skip this log line if the noStateTracker is being used

I'm curious if there are other ideas though - muting certain errors seems like a useful ability across many components

ridwanmsharif added a commit to ridwanmsharif/opentelemetry-collector-contrib that referenced this issue May 5, 2025
ridwanmsharif added a commit to ridwanmsharif/opentelemetry-collector-contrib that referenced this issue May 5, 2025
dragonlord93 pushed a commit to dragonlord93/opentelemetry-collector-contrib that referenced this issue May 23, 2025
…is used (open-telemetry#39861)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Add to the interface to be able to identify which tracker is being used.
Also mute the log when no state is tracked.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue

Fixes open-telemetry#39855

Signed-off-by: Ridwan Sharif <[email protected]>
Co-authored-by: Daniel Jaglowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New item requiring triage pkg/stanza/fileconsumer
Projects
None yet
1 participant