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

Extending deferred logger to forward logs to AppInsights from webhost. #10771

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

RohitRanjanMS
Copy link
Member

@RohitRanjanMS RohitRanjanMS commented Jan 27, 2025

As the AppInsights and OTel logger providers are integrated into the script host, logs emitted by the outer scope (e.g., Microsoft.Azure.WebJobs.Script.WebHost.Middleware.ExceptionMiddleware) are available in Kusto but are not forwarded to these logger providers. In the last PR, we addressed this issue for initialization logs, and now we are extending this functionality to forward logs beyond initialization as well. This enhancement will enable customers to better troubleshoot issues, as these logs will now be sent to AppInsights/OTel alongside Kusto.

Feature flag DisableWebHostLogForwarding can be used to disable log forwarding.

"AzureWebJobsFeatureFlags": "DisableWebHostLogForwarding"

Pull request checklist

IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.

  • Backporting to the in-proc branch is not required
    • Otherwise: Link to backporting PR
  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • [] My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

@RohitRanjanMS RohitRanjanMS requested a review from a team as a code owner January 27, 2025 18:34
Copy link
Member

@fabiocav fabiocav left a comment

Choose a reason for hiding this comment

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

Have not reviewed the changes yet, but wanted to leave an early request based on a quick look.

Given the potential for this to increase customer facing logs, can we introduce a configuration/feature flag to disable the new behavior if this ends up being too much for some customers? Given the behavior, this wouldn't need to be a hosting config, but it would be good to have a customer controlled flag.

@RohitRanjanMS RohitRanjanMS requested a review from jviau January 29, 2025 09:21
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.

3 participants