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

chore(derived_code_mappings): Report errors with warning level #76212

Merged
merged 4 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/sentry/integrations/github/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ def _populate_trees_process_error(self, error: ApiError, extra: dict[str, str])
else:
# We do not raise the exception so we can keep iterating through the repos.
# Nevertheless, investigate the error to determine if we should abort the processing
logger.error("Continuing execution. Investigate: %s", error_message, extra=extra)
logger.error(
"Continuing execution. Investigate: %s", error_message, extra=extra, level="info"
)

return should_count_error

Expand All @@ -448,7 +450,9 @@ def _populate_trees(self, repositories: list[dict[str, str]]) -> dict[str, RepoT
except ApiError:
only_use_cache = True
# Report so we can investigate
logger.exception("Loading trees from cache. Execution will continue. Check logs.")
logger.exception(
"Loading trees from cache. Execution will continue. Check logs.", level="info"
)

for index, repo_info in enumerate(repositories):
repo_full_name = repo_info["full_name"]
Expand Down Expand Up @@ -476,7 +480,9 @@ def _populate_trees(self, repositories: list[dict[str, str]]) -> dict[str, RepoT
except Exception:
# Report for investigation but do not stop processing
logger.exception(
"Failed to populate_tree. Investigate. Contining execution.", extra=extra
"Failed to populate_tree. Investigate. Contining execution.",
extra=extra,
level="info",
)

if connection_error_count >= MAX_CONNECTION_ERRORS:
Expand Down
7 changes: 5 additions & 2 deletions src/sentry/tasks/derive_code_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def process_error(error: ApiError, extra: dict[str, str]) -> None:
logger.error(
"Unhandled ApiError occurred. Nothing is broken. Investigate. Multiple issues grouped.",
extra=extra,
level="info",
)


Expand Down Expand Up @@ -127,7 +128,9 @@ def derive_code_mappings(
logger.warning("derive_code_mappings.getting_lock_failed", extra=extra)
return
except Exception:
logger.exception("Unexpected error type while calling `get_trees_for_org()`.", extra=extra)
logger.exception(
"Unexpected error type while calling `get_trees_for_org()`.", extra=extra, level="info"
)
return

if not trees:
Expand Down Expand Up @@ -155,7 +158,7 @@ def identify_stacktrace_paths(data: NodeData) -> list[str]:
}
stacktrace_paths.update(paths)
except Exception:
logger.exception("Error getting filenames for project.")
logger.exception("Error getting filenames for project.", level="info")
return list(stacktrace_paths)


Expand Down
Loading