Skip to content

Conversation

@michaelsafyan
Copy link

@michaelsafyan michaelsafyan commented Nov 11, 2025

Log partial success based on $OTEL_LOG_LEVEL

When $OTEL_LOG_LEVEL is verbose or debug, partially succeeding responses will be logged.

Fixes #4803

Type of change

  • New feature (non-breaking change which adds functionality)
  • [?] This change requires a documentation update

How Has This Been Tested?

Added new unit tests covering the relevant cases.

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • [] Documentation has been updated - unsure what to update

@michaelsafyan michaelsafyan marked this pull request as ready for review November 11, 2025 20:55
@michaelsafyan michaelsafyan requested a review from a team as a code owner November 11, 2025 20:55
@michaelsafyan michaelsafyan changed the title [DRAFT] Implement partial success logging to tackle issue 4803 Implement partial success logging in OTLP exporters Nov 11, 2025
…levels to avoid changing default behaviors. Apply test and formatting fixes.
This appears to cause an issue with "tox -e docs".
Copy link
Contributor

@DylanRussell DylanRussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why put this log behind an env var ? Why not just always log when the field is set -- I'm assuming it's only set when there was a partial success -- it doesn't sound too noisy to me.

@michaelsafyan
Copy link
Author

Why put this log behind an env var ? Why not just always log when the field is set -- I'm assuming it's only set when there was a partial success -- it doesn't sound too noisy to me.

I'm uncertain as to the level of noisiness, and so I wanted to minimize disruption to existing users. I could imagine it being somewhat annoying if every batch included one persistently malformed span that just ended up creating log spam.

A more sophisticated approach might be to opt-in to recording every partial success, while elevating the verbosity and logging the partial success unconditionally if every record was a failure (if num_rejected_{type} matches the number of items in the batch). But I wanted to keep things relatively simple.

@DylanRussell
Copy link
Contributor

We already have the DuplicateFilter on this logger, maybe we should tweak that to de-dupe based on line no and module instead of message which can be unique so that it filters stuff out better.

I think it's a bit weird to put just 1 log message behind this env var

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it possible to opt-in to logging partial errors

2 participants