Skip to content
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_monitor_alert_prometheus_rule_group #21751

Conversation


* `record` - (Optional) Specifies the recorded metrics name.

* `resolve_configuration` - (Optional) A `resolve_configuration` block as defined below.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might make more sense as\ ?

Suggested change
* `resolve_configuration` - (Optional) A `resolve_configuration` block as defined below.
* `alert_resolution` - (Optional) A `alert_resolution` block as defined below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your feedback. I have updated the code. Could you please take another look?

scopes = [azurerm_monitor_workspace.example.id]
rule {
enabled = false
expression = "histogram_quantile(0.99, sum(rate(jobs_duration_seconds_bucket{service=\" billing-processing \"}[5m])) by (job_type))"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might be better to use heredoc/multiple line expression here rather then escape "?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your feedback. I have updated the code. Could you please take another look?

Comment on lines 514 to 530

output.Alert = pointer.From(input.Alert)

output.Annotations = pointer.From(input.Annotations)

output.Enabled = pointer.From(input.Enabled)

output.For = pointer.From(input.For)

output.Labels = pointer.From(input.Labels)

output.Record = pointer.From(input.Record)

resolveConfigurationValue := flattenPrometheusRuleResolveConfigurationModel(input.ResolveConfiguration)

output.ResolveConfiguration = resolveConfigurationValue

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need these blank lines?

Suggested change
output.Alert = pointer.From(input.Alert)
output.Annotations = pointer.From(input.Annotations)
output.Enabled = pointer.From(input.Enabled)
output.For = pointer.From(input.For)
output.Labels = pointer.From(input.Labels)
output.Record = pointer.From(input.Record)
resolveConfigurationValue := flattenPrometheusRuleResolveConfigurationModel(input.ResolveConfiguration)
output.ResolveConfiguration = resolveConfigurationValue
output.Alert = pointer.From(input.Alert)
output.Annotations = pointer.From(input.Annotations)
output.Enabled = pointer.From(input.Enabled)
output.For = pointer.From(input.For)
output.Labels = pointer.From(input.Labels)
output.Record = pointer.From(input.Record)
resolveConfigurationValue := flattenPrometheusRuleResolveConfigurationModel(input.ResolveConfiguration)
output.ResolveConfiguration = resolveConfigurationValue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your feedback. I have updated the code. Could you please take another look?

location = azurerm_resource_group.test.location
resource_group_name = azurerm_resource_group.test.name
dns_prefix = "acctestaks%[2]d"
kubernetes_version = "1.25.5"
Copy link
Collaborator

@aristosvo aristosvo May 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just passing by as I was researching azurerm_monitor_workspace and AKS Prometheus metrics, but should this kubernetes_version maybe be based on currentKubernetesVersion ?

Thanks a lot anyway for creating this resource 👍🏽

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just passing by as I was researching azurerm_monitor_workspace and AKS Prometheus metrics, but should this kubernetes_version maybe be based on currentKubernetesVersion ?

Thanks a lot anyway for creating this resource 👍🏽

Yes, kubernetes_version is value of currentKubernetesVersion. Thanks for your reminder. Per the description of kubernetes_version, If not specified, the latest recommended version will be used at provisioning time, so in all tests for resource azurerm_monitor_alert_prometheus_rule_group I removed the specified kubernetes_version to reduce dependencies. Please let me know if you have other suggestions.

@sinbai sinbai force-pushed the monitor/new_resource_monitor_prometheus_rule_group branch from 6e60162 to 296aa02 Compare May 23, 2023 01:26
@sinbai sinbai force-pushed the monitor/new_resource_monitor_prometheus_rule_group branch from 296aa02 to 8b7cdab Compare May 23, 2023 01:57
@sinbai
Copy link
Contributor Author

sinbai commented May 23, 2023

@katbyte After updating the code, all tests have passed in TeamCity as shown below. Just to let you know.

image

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🌳

@katbyte katbyte merged commit a311a2c into hashicorp:main May 24, 2023
katbyte added a commit that referenced this pull request May 24, 2023
@github-actions github-actions bot added this to the v3.58.0 milestone May 24, 2023
@github-actions
Copy link

This functionality has been released in v3.58.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@sinbai sinbai deleted the monitor/new_resource_monitor_prometheus_rule_group branch March 28, 2024 02:50
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants