-
Notifications
You must be signed in to change notification settings - Fork 0
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
DM-40605: Improve Algolia audit job's reliability #144
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There can be all sorts of issues when queueing an ingest, so we'll just log their exceptions and continue so we can get a sense of why these documents are failing.
This was baseURL in the Pydantic model, but should be baseUrl to match the existing Algolia schema.
Rather than use logging.exception, which places the stack trace outside the structured log, using logging.error instead and log the exception within the JSON structured log message.
- Format the kafka key/value data as a dict for natural JSON representation; the json() method was creating a string. - Bind this context to the logger so that all log messages share it.
- Add the number of records and the surrogate key of those records so they can be searched later.
Configure the logger when running ook audit and other CLI apps to get structured logging. This is useful since the CLI is primarily used for Kubernetes Jobs.
See if this exception is now nicely formatted by structlog for us.
Turns out structlog does format the exception trace in the structured log after all, so this is fine.
jonathansick
force-pushed
the
tickets/DM-40605
branch
from
September 5, 2023 17:05
37fa1a5
to
b4d3225
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
base_url
attribute's JSON alias for the Algolia DocumentRecord model. WasbaseURL
and is now restored tobaseUrl
.source_update_time
andsource_update_timestamp
fields).