Skip to content

[sc-58664] Add temp logging when response is not 200#155

Open
dhanya-sgnl wants to merge 3 commits intomainfrom
sc-58664-add-temp-adapter-logging-azuread
Open

[sc-58664] Add temp logging when response is not 200#155
dhanya-sgnl wants to merge 3 commits intomainfrom
sc-58664-add-temp-adapter-logging-azuread

Conversation

@dhanya-sgnl
Copy link
Copy Markdown
Contributor

Description of changes

Added temp debugging for AzureAD

sc-58664

API References

Pull request intention

  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Code improvement (improve test coverage or code readability)

Pull request checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated documentation (if applicable)
  • I have registered the new adapter (if applicable)
  • I have added a smoke test for the new adapter (if applicable)
  • Any secrets are redacted from smoke test fixtures and no PII is present (if applicable)

@dhanya-sgnl dhanya-sgnl requested a review from a team as a code owner September 19, 2025 19:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds temporary debugging logging to capture response bodies from Azure AD API calls when they return non-200 status codes. This is intended to help diagnose production issues related to OOM errors during Entra group entity ingestion.

  • Adds structured logging for failed Azure AD API responses to aid in debugging production issues
  • Logs both the status code and response body content when API calls fail

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread pkg/azuread/datasource.go
slog.Error(
"Failed to read error response body",
slog.String("endpoint", endpoint),
"error", readErr,
Copy link

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

The logging call is inconsistent with structured logging patterns. Use slog.Any("error", readErr) instead of the bare string and value pair to maintain consistency with other slog attributes.

Suggested change
"error", readErr,
slog.Any("error", readErr),

Copilot uses AI. Check for mistakes.
Comment thread pkg/azuread/datasource.go
Comment thread pkg/azuread/datasource.go
Comment thread pkg/azuread/datasource.go
Copy link
Copy Markdown
Contributor

@richardxgao richardxgao left a comment

Choose a reason for hiding this comment

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

LGTM.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants