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

Send logs to Azure Monitor #719

Merged
merged 3 commits into from
Jun 23, 2022
Merged

Send logs to Azure Monitor #719

merged 3 commits into from
Jun 23, 2022

Conversation

afeld
Copy link
Contributor

@afeld afeld commented Jun 22, 2022

Closes #631. Keeps the logging otherwise the same.

Used the following instructions, to start:

Before merge

  • Set APPLICATIONINSIGHTS_CONNECTION_STRING in dev

Added tasks for each environment in #734.

@afeld afeld requested a review from a team as a code owner June 22, 2022 12:56
@github-actions github-actions bot added back-end Django views, sessions, middleware, models, migrations etc. documentation [auto] Improvements or additions to documentation deployment-dev [auto] Changes that will trigger a deploy if merged to dev infrastructure Terraform, Azure, etc. labels Jun 22, 2022
1. [Open Application Insights.](https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/microsoft.insights%2Fcomponents)
1. Click the resource corresponding to the environment.
1. In the navigation, under `Monitoring`, click `Logs`.
1. In the Query Editor, type `requests` or `traces`, and click `Run`.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems that traffic logs are sent to the former, stdout/stderr is sent to the latter.

thekaveman
thekaveman previously approved these changes Jun 22, 2022
Copy link
Member

@thekaveman thekaveman left a comment

Choose a reason for hiding this comment

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

A couple tests for the new configuration helper could be nice, but this looks good. Confirmed I still see the expected console output locally.

def test_get_config_with_azure():
config = get_config(enable_azure=True)
assert "azure" in config["handlers"]
assert "azure" in config["loggers"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure how useful they are, but added tests.

@afeld afeld requested a review from thekaveman June 23, 2022 16:21
benefits/logging.py Outdated Show resolved Hide resolved
@afeld afeld force-pushed the feat/azure-logging branch from 6932fc8 to 7e3012e Compare June 23, 2022 18:38
@thekaveman thekaveman added this to the Hosting migration milestone Jun 23, 2022
@afeld afeld merged commit 086e087 into dev Jun 23, 2022
@afeld afeld deleted the feat/azure-logging branch June 23, 2022 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end Django views, sessions, middleware, models, migrations etc. deployment-dev [auto] Changes that will trigger a deploy if merged to dev documentation [auto] Improvements or additions to documentation infrastructure Terraform, Azure, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get traffic logs to appear for Azure apps
2 participants