Configure observability for Azure MySQL Flexible Server (mysql module) - #614
Merged
Roger Doherty (MSFT) (doherty100) merged 1 commit intoAug 10, 2026
Merged
Conversation
Wire the observability framework (diagnostic settings to the shared Log Analytics workspace) into the mysql module, mirroring the mssql module. - Add azurerm_monitor_diagnostic_setting on the flexible server emitting the MySqlSlowLogs and MySqlAuditLogs log categories and AllMetrics to the shared Log Analytics workspace. - Enable the required server parameters via azurerm_mysql_flexible_server_configuration (slow_query_log, audit_log_enabled, audit_log_events) so the diagnostic categories produce data. - Add log_analytics_workspace_id input to the mysql module and wire it from the vnet-shared module in the root. - Add a unit test verifying the diagnostic setting streams the expected logs and metrics to Log Analytics. - Update module and root README documentation. Fixes #607 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
✅ Validated against a live deploymentDeployed a fresh sandbox with only the impacted modules — Deployment
Tests —
|
Roger Doherty (MSFT) (doherty100)
deleted the
feature/607-mysql-observability
branch
August 10, 2026 17:02
5 tasks
This file contains hidden or 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
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.
Fixes #607.
Wires the observability framework (diagnostic settings → shared Log Analytics workspace owned by
vnet-shared) into themysqlmodule, mirroring themssqlintegration from #606.Changes
modules/mysql/main.tfazurerm_monitor_diagnostic_setting.thison the flexible server, emitting theMySqlSlowLogsandMySqlAuditLogslog categories andAllMetricsto the shared Log Analytics workspace.azurerm_mysql_flexible_server_configuration(slow_query_log = ON,audit_log_enabled = ON,audit_log_events = CONNECTION,DML,DDL,DCL) so the diagnostic categories actually produce data. The diagnostic settingdepends_onthese so parameters are applied first.modules/mysql/variables.tf— add validatedlog_analytics_workspace_idinput.main.tf(root) — wirelog_analytics_workspace_id = module.vnet_shared.resource_ids["log_analytics_workspace"], mirroringmssql.modules/mysql/scripts/Test-Mysql.ps1— add Test 6 verifying the diagnostic setting targets a Log Analytics workspace and enables the expected log/metric categories.modules/mysql/README.md(input variables + resources tables) and rootREADME.md.Diagnostic settings are control-plane, so no public-access data-plane barrier wiring is required (confirmed — consistent with the
mssqlprecedent).Acceptance criteria
log_analytics_workspace_idvariable added and wired from root.Test-Mssql.ps1).modules/mysql/README.mdand rootREADME.mdupdated../scripts/Invoke-CIChecks.sh terraform markdownpasses (also ranpowershell).terraform init+validatesucceed.