-
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 resources for Log analytics datasources #8589
Conversation
…rces to log analytics
Hi @katbyte / @tombuildsstuff , Is there any way to review and merge this PR? I understand that there is no official documentation for log analytics data sources properties from Microsoft. However, we have taken reference from the equivalent PowerShell cmdlets for each of these data sources and implemented accordingly. The community can use this meanwhile until official documentation and supporting go SDK is available. There is already implementation for windows event and windows performance counter data sources. I dont see why this PR would be an issue if everything is implemented properly. |
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.
@PriyankaRanganath, thank you so much for opening this PR, this mostly LGTM, however I left a few comments to address. Once those are taken care of we can get this merged! 🚀
azurerm/internal/services/loganalytics/log_analytics_datasource_iis_logs_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/loganalytics/log_analytics_datasource_iis_logs_resource.go
Outdated
Show resolved
Hide resolved
...rnal/services/loganalytics/log_analytics_datasource_linux_performance_collection_resource.go
Outdated
Show resolved
Hide resolved
.../internal/services/loganalytics/log_analytics_datasource_linux_syslog_collection_resource.go
Outdated
Show resolved
Hide resolved
azurerm/internal/services/loganalytics/log_analytics_datasource_linux_syslog_resource.go
Outdated
Show resolved
Hide resolved
website/docs/r/log_analytics_datasource_linux_performance_collection.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/r/log_analytics_datasource_linux_performance_collection.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/r/log_analytics_datasource_linux_syslog_collection.html.markdown
Outdated
Show resolved
Hide resolved
Hi @WodansSon , Thank you for reviewing the PR! Resolved comments as requested |
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.
Thanks for the PR @PriyankaRanganath, while overall this looks great it appears the SDK/swagger is incomplete and needs to be updated and unfortunately we need the SDK to define these types else they can change on Azure's side without correctly handling semantic versioning - as such these types need to be present in the Azure SDK/Swagger. There is an open issue here and until this is fixed i'm not sure we can merge this
type dataSourceIISLogsProperty struct { | ||
State string `json:"state"` | ||
} |
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.
this looks like an SDK/swagger bug? could we get an issue opened and this fixed there?
|
||
if v, ok := d.GetOk("on_premise_enabled"); ok { | ||
if onPremiseEnabled := v.(bool); onPremiseEnabled { | ||
onPremiseState = "OnPremiseEnabled" |
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.
This should be exposed by the SDK as a constant? which probably ties in to the swagger bug for the missing dataSourceIISLogsProperty struct?
azurerm/internal/services/loganalytics/log_analytics_datasource_iis_logs_resource.go
Outdated
Show resolved
Hide resolved
type dataSourceLinuxPerformanceCollectionProperty struct { | ||
State string `json:"state"` | ||
} |
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.
same comment above: could we get this fixed in the swagger and SDK?
perfCollectionState := "Disabled" | ||
|
||
if v, ok := d.GetOk("enabled"); ok { | ||
if enabled := v.(bool); enabled { | ||
perfCollectionState = "Enabled" | ||
} | ||
} |
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.
same here
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 @katbyte , there is no support for SDK or even official documentation from Microsoft yet. Is it ok to still merge this PR ?
I am trying to get hold of Microsoft prod team but as mentioned there is no ETA on it yet
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.
Please see the linked issue below for more details, but we typically refrain from merging anything that is not currently supported by the SDK as it can become problematic down the line.
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.
Thanks @katbyte ! will wait for SDK and official documentation release
type dataSourceLinuxPerformanceObjectProperty struct { | ||
ObjectName string `json:"objectName"` | ||
InstanceName string `json:"instanceName"` | ||
IntervalSeconds int `json:"intervalSeconds"` | ||
PerformanceCounters []dataSourceLinuxPerformanceObjectCounterName `json:"performanceCounters"` | ||
} | ||
|
||
type dataSourceLinuxPerformanceObjectCounterName struct { | ||
CounterName string `json:"counterName"` | ||
} |
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.
this should also be in the swagger & sdk
type dataSourceLinuxSysLogCollectionProperty struct { | ||
State string `json:"state"` | ||
} |
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.
and this?
azurerm/internal/services/loganalytics/log_analytics_datasource_linux_syslog_resource.go
Show resolved
Hide resolved
azurerm/internal/services/loganalytics/log_analytics_datasource_linux_syslog_resource.go
Show resolved
Hide resolved
type dataSourceLinuxSysLogProperty struct { | ||
SysLogName string `json:"syslogName"` | ||
SysLogSeverities []dataSourceLinuxSysLogSeverity `json:"syslogSeverities"` | ||
} | ||
|
||
type dataSourceLinuxSysLogSeverity struct { | ||
Severity string `json:"severity"` | ||
} |
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.
this should also be added to the SDK/swagger
linked issue: Azure/azure-rest-api-specs#9072 |
@PriyankaRanganath - given this is blocked on the swagger issue, i am going to close it. Once the service team has addressed the missing swagger & SDK supports these properties we can reopen this PR and move it forward. |
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 👉 [email protected]. Thanks! |
Add support for Log analytics workspace data source resources:
azurerm_log_analytics_datasource_iis_logs
azurerm_log_analytics_datasource_linux_performance_collection
azurerm_log_analytics_datasource_linux_performance_object
azurerm_log_analytics_datasource_linux_syslog_collection
azurerm_log_analytics_datasource_linux_syslog
fixes #3182