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

amending Readme.md (#3) #14

Merged
merged 8 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions dynatrace_alerts.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
resource "dynatrace_alerting" "dynatrace_alerting_profile" {
name = var.alerting_profile_name
filters {
filter {
custom {
description {
operator = var.operator
value = var.value
case_sensitive = var.case_sensitive
enabled = var.enabled
}
title {
operator = var.operator
value = var.value
case_sensitive = var.case_sensitive
enabled = var.enabled

}

}
}
}
rules {
rule {
include_mode = var.include_mode
tags = var.tags
delay_in_minutes = var.delay_in_minutes
severity_level = var.severity_level
}
}
}

resource "dynatrace_email_notification" "dynatrace_email_alerts" {
active = var.email_notification_enabled
name = var.email_notification_name
profile = dynatrace_alerting.dynatrace_alerting_profile.id
subject = var.email_subject
to = var.email_id
notify_closed_problems = var.notify_closed_problem
body = "{ProblemDetailsHTML}"
}

resource "dynatrace_slack_notification" "dynatrace_slack_alerts" {
active = var.slack_notification_enabled
name = var.slack_notification_name
profile = dynatrace_alerting.dynatrace_alerting_profile.id
url = var.slack_url
channel = var.channel_name
message = var.slack_message
}
51 changes: 51 additions & 0 deletions dynatrace_metric_events.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
resource "dynatrace_metric_events" "dynatrace_readcapacityunitssum" {
enabled = var.tenant_vars.enabled
event_entity_dimension_key = var.tenant_vars.event_entity_dimension_key
summary = var.tenant_vars.summary
event_template {
description = var.tenant_vars.description
davis_merge = var.tenant_vars.davis_merge
event_type = var.tenant_vars.event_type
title = var.tenant_vars.title
}
model_properties {
type = var.tenant_vars.model_properties_type
alert_condition = var.tenant_vars.alert_condition
alert_on_no_data = var.tenant_vars.alert_on_no_data
dealerting_samples = var.tenant_vars.dealerting_samples
samples = var.tenant_vars.samples
threshold = var.tenant_vars.threshold
violating_samples = var.tenant_vars.violating_samples
}
query_definition {
type = var.tenant_vars.query_definition_type
aggregation = var.tenant_vars.aggregation
metric_key = var.tenant_vars.metric_key
dimension_filter {
filter {
dimension_key = var.tenant_vars.dimension_key
dimension_value = var.tenant_vars.dimension_value
}
}
entity_filter {
dimension_key = var.tenant_vars.dimension_key
conditions {
condition {
type = var.tenant_vars.entity_filter_condition1_type
operator = var.tenant_vars.entity_filter_condition1_operator
value = var.tenant_vars.entity_filter_condition1_value
}
condition {
type = var.tenant_vars.entity_filter_condition2_type
operator = var.tenant_vars.entity_filter_condition2_operator
value = var.tenant_vars.entity_filter_condition2_value
}
# condition {
# type = "HOST_GROUP_NAME" re-visit when we need host group
# operator = "EQUALS"
# value = "HOST-42FDD00356069724"
# }
}
}
}
}
Loading