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

Proposed logging and debug enhancements #1847

Open
bretg opened this issue May 11, 2021 · 5 comments
Open

Proposed logging and debug enhancements #1847

bretg opened this issue May 11, 2021 · 5 comments

Comments

@bretg
Copy link
Contributor

bretg commented May 11, 2021

During the review of the Modularity PRD, we spent some time discussing logging. As someone who sometimes has to dig into support issues for pubs or bidders, logging and debug output is pretty important. Here's an initial take at requirements.

System error - unexpected code problem, missing database, filesystem full, etc.
Application error - account config, bid response validation, etc.

  1. PBS should not log very much by default. Logs can be expensive. Only major system errors should be in the logs in an unsampled way.
  2. Stack traces should be present only when absolutely necessary. (e.g. untrapped exceptions) They take a lot of space.
  3. As a user of PBS log files, I want to be able to turn up the log level dynamically in a controlled way:
    • By account ID. Generally I know which account is having the trouble. Default to all accounts.
    • By endpoint. Generally I know whether I need to trace /auction, /amp, etc. Default to all endpoints.
    • By bidder. Sometimes the issue is with requests that contain a specific and rare bidder.
    • By string within the raw request. Sometimes we want to be able to filter for a specific subset like an app bundle name, a site url, etc.
    • Set log level. We should support at least 2 log levels: basic and verbose. Verbose should include the entire ortb request. If bidder was specified, verbose mode should include the raw response from their endpoint.
    • For a certain number of log entries. Default to 100 log entries.
  4. It should be possible to log major application errors but throttle them with a configurable sample rate. Application scenarios can be transient, so dynamic log control doesn't always help. So the system should have a configurable "log sampling rate" that allows major application errors to appear sampled in the logs.

PBS-Java has some of this dynamic logging capability already as described at https://docs.prebid.org/troubleshooting/pbs-troubleshooting.html#request-logging

It might be reasonable to consider a separate logging server that can satisfy all of these requirements. I'm not familiar with that space. Happy to take suggestions from the community.

There's never been a real description for how PBS should do debug logging. Here's an initial cut:

  • response.ext.debug.httpcalls - triggered by request.test:1 or request.ext.prebid.debug:true
  • response.ext.errors.{bidderName} - triggered by (request.test:1 or request.ext.prebid.debug:true) and the existence of an error
  • response.ext.warnings.{bidderName} - triggered by (request.test:1 or request.ext.prebid.debug:true) and the existence of a warning
  • response.ext.prebid.modules.trace - triggered by request.ext.prebid.trace:true and the calling of modules
  • response.ext.prebid.pg.trace - triggered by request.ext.prebid.trace existing and the existence of programmatic guaranteed line items

Response Debug and Error output

We'd also like to propose making debug output consistent across all response protocols. This would mean changing the location of debug and errors in AMP and /video endpoints output to be the same as in web: ext.debug and ext.errors.

@bretg
Copy link
Contributor Author

bretg commented Jun 3, 2021

Added proposal on Response Debug and Error output

@bretg bretg changed the title PBJ: proposed logging enhancements PBJ: proposed logging and debug enhancements Jun 11, 2021
@bretg bretg changed the title PBJ: proposed logging and debug enhancements Proposed logging and debug enhancements Oct 6, 2021
@stale
Copy link

stale bot commented Jan 8, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@bretg
Copy link
Contributor Author

bretg commented Sep 23, 2022

Flagging this as "needs reqs" to get community approval on this proposal.

@GLStephen
Copy link
Contributor

@bretg has there been any progress here? still looking for community approval? +1 here

@bretg
Copy link
Contributor Author

bretg commented Apr 17, 2023

No progress. Good to know there's interest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Requirements
Development

No branches or pull requests

2 participants