-
Notifications
You must be signed in to change notification settings - Fork 445
feat: Add diagnostics parameter #4929
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
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree company="Waternet" |
Hey @SanderNugteren, |
Hi @AlexanderSehr! I resolved the conflicts. Thanks for the help in getting this merged! |
diagnostics: !empty(diagnostics) | ||
? { | ||
logAnalytics: diagnostics.?logAnalytics | ||
} | ||
: null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it make sense that logAnalytics
is optional?
E.g., because just setting an empty diagnostics
object already configures something.
If not, it may make sense to either make it mandatory, or even remove one level of nesting by changin it to
diagnostics: !empty(diagnostics) ? {
logAnalytics: {
logType: diagnostics!.logType
workspaceId: diagnostics!.workspaceId
workspaceKey: diagnostics!.workspaceKey
workspaceResourceId: diagnostics!.?workspaceResourceId
metadata: diagnostics!.?metadata
}
} : null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also thinking that, but I thought that in the future the diagnostics might contain more fields than just the logAnalytics field (e.g. having different diagnostics implementations). In that case it might change which diagnostics field you choose to use and they should allbe optional.
But perhaps this is over-engineering for a possible future situation 😉. If you think it's not necessary to account for this, then I think implementing your suggestion of removing the nesting would be best. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either is fine for me, and ultimately it might be best if the module owner @JPEasier makes this decision.
You input is much appreciated and I share your concern. 💪
That being said, there's also a best practice in engineering to not plan for possible future scenarios that may never happen 😄 I guess if it does happen it could still be changed alongside a major version change to tell users as much - and transitioning from one model to the other would be as easy as to adding this intermediate level. Either way - it's not outrageous.
One element would help the decision though - and that is to find out if even a deployment like diagnostics: {}
(which you can currenlty do as logAnalytics
is optional does any thing. A good example for this are networkAcls which usually, even if empty, enable a service's firewall.
If this is the case here to, I'd strongly recommend to keep your current implementation. If not - then it remains up for debate an personally I'd lean towards my suggestion. But I'm biased, so ... 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @AlexanderSehr ! I don't see an answer from @JPEasier yet. How should we proceed with this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @SanderNugteren, I just reached out to the owner internally. The notification via GitHub may have gotten lost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @SanderNugteren,
I understand it like this, diagnostics: {}
has only one parameter: logAnalytic
. in this case i would suggest to set logAnalytic
as mendetory, then the conversion is quite simple if more parameters are added.
So exactly what @AlexanderSehr wrote in his code suggestion :)
Co-authored-by: Alexander Sehr <ASehr@hotmail.de>
Co-authored-by: Alexander Sehr <ASehr@hotmail.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your contribution!
I see some conflicts, please review and update your branch.
|
||
@description('Optional. Metadata for log analytics.') | ||
metadata: object? | ||
}? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as disscussed, lets make the logAnalytics
mandatory. :)
Description
I added the diagnostics parameter for Log Analytics. However, I was unable to fully test the changes due to issues with the local setup. I would appreciate it if someone with a working environment could verify and complete the testing.
Fixes #3519
-->
Pipeline Reference
Type of Change
version.json
:version.json
.version.json
.Checklist
Set-AVMModule
locally to generate the supporting module files.