-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
New Resource: azurerm_log_analytics_datasource_windows_performance_counter #6274
New Resource: azurerm_log_analytics_datasource_windows_performance_counter #6274
Conversation
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 @magodo, this is definitely a weird resource to craft from what we're given on the api/sdk side but I think you've nailed it. It is weird that we have to do each counter separately but I don't think there is a way to do it in bulk that doesn't feel hacky so let's stick with the way you've done it here.
My main issue is just how we're presenting the attributes to the user which I've pointed out in more detail below.
If this model is also universal across other datasources, it might be worthwhile to tease this out into it's own separate package but that work can be done once more start coming in.
Thanks for the effort here!
website/docs/r/log_analytics_datasource_windows_performance_counter.html.markdown
Outdated
Show resolved
Hide resolved
...loganalytics/tests/resource_arm_log_analytics_datasource_windows_performance_counter_test.go
Outdated
Show resolved
Hide resolved
Review [link](hashicorp#6274 (review))
@mbfrahry Thank you for review, I have made the change accordingly, please have a check. Regarding to:
That is exactly what I was thinking about at first. While after a closely looking into the property definition of each DS(s), I find they has slightly difference among others. I listed some points which will affect code structure below which might hint we may have to implement each DS separately with different schema definitions and undertaking code redundency in some degree:
|
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.
LGTM!
Ahhh, that make sense. Thanks for pulling that table together. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
This is one of the datasource requested by #3182.
There is a trade-off of interface design, is that for this specific ds, it has several different counters, and user specify one by setting the object_name. So it means user can only set one counter each time. While there are acutally kinds of counters out there.
So maybe we can give user a list to specify them at once. But later I feel it has several problems:
Another point is that currently the
name
,object_name
,counter_name
,instance_name
allow arbitrary string, hence I'm using theStringIsNotEmpty
validation for them.Test Result: