dsccommunity / dsccommunity/SqlServerDsc

SqlAg/SqlAGReplica: AlwaysOn_Health XE session

Open
#1,209 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
PowerShell
Stars
385
Forks
224
PR merge metrics
No merged PRs in 30d

Description

Details of the scenario you tried and the problem that is occurring

SqlAg is the resource that will create an availability group on a given instance. Then you have SqlAgReplica that will add a replica.

A big step that is missing in the process is enabling the AlwaysOn_health extended event session. This is something the SQLPS or sqlserver modules commands do not handle directly either in an automatic fashion; meaning that creating an AG with either module will not automatically enable that XE session either.

If the wizard is used it does indeed enable that XE session automatically for the user. So as I see it we could do this one of two ways:

  1. Update the SqlAg and SqlAgReplica resources to have an option to enable that XE session, something like EnableAlwaysOnHealth maybe.
  2. Create a new resource (i.e. SqlAgAlwaysOnHealth).

I would favor it being added to the SqlAg and AgReplica resources because I would also say the property should be set to true by default. There are not generally any situation where I have seen that XE session should be disabled, but in the rare case it does having the property would benefit.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the SqlAg and SqlAgReplica resources and how they configure an availability group. Decide how the AlwaysOn_health extended event session should be exposed, with the favored approach adding an option enabled by default. Done means creating an AG or replica can enable that session while still allowing it to be disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, sql
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.