Alert

Log alert is a unit of log service, which is used to monitor and alert the user's logstore status information. Log Service enables you to configure alerts based on the charts in a dashboard to monitor the service status in real time. For information about SLS Alert and how to use it, see SLS Alert Overview

NOTE: Available in 1.78.0

Example Usage

Basic Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.log.Store;
import com.pulumi.alicloud.log.StoreArgs;
import com.pulumi.alicloud.log.Alert;
import com.pulumi.alicloud.log.AlertArgs;
import com.pulumi.alicloud.log.inputs.AlertScheduleArgs;
import com.pulumi.alicloud.log.inputs.AlertQueryListArgs;
import com.pulumi.alicloud.log.inputs.AlertNotificationListArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleProject = new Project("exampleProject", ProjectArgs.builder()
.description("create by terraform")
.build());
var exampleStore = new Store("exampleStore", StoreArgs.builder()
.project(exampleProject.name())
.retentionPeriod(3650)
.shardCount(3)
.autoSplit(true)
.maxSplitShardCount(60)
.appendMeta(true)
.build());
var exampleAlert = new Alert("exampleAlert", AlertArgs.builder()
.projectName(exampleProject.name())
.alertName("tf-test-alert")
.alertDisplayname("tf-test-alert-displayname")
.condition("count> 100")
.dashboard("tf-test-dashboard")
.schedule(AlertScheduleArgs.builder()
.type("FixedRate")
.interval("5m")
.hour(0)
.dayOfWeek(0)
.delay(0)
.runImmediately(false)
.build())
.queryLists(AlertQueryListArgs.builder()
.logstore("tf-test-logstore")
.chartTitle("chart_title")
.start("-60s")
.end("20s")
.query("* AND aliyun")
.build())
.notificationLists(
AlertNotificationListArgs.builder()
.type("SMS")
.mobileLists(
"12345678",
"87654321")
.content("alert content")
.build(),
AlertNotificationListArgs.builder()
.type("Email")
.emailLists(
"aliyun@alibaba-inc.com",
"tf-test@123.com")
.content("alert content")
.build(),
AlertNotificationListArgs.builder()
.type("DingTalk")
.serviceUri("www.aliyun.com")
.content("alert content")
.build())
.build());
}
}

Import

Log alert can be imported using the id, e.g.

$ pulumi import alicloud:log/alert:Alert example tf-log:tf-log-alert

Properties

Link copied to clipboard
val alertDescription: Output<String>?

Alert description.

Link copied to clipboard

Alert displayname.

Link copied to clipboard
val alertName: Output<String>

Name of logstore for configuring alarm service.

Link copied to clipboard

Annotations for new alert.

Link copied to clipboard
val autoAnnotation: Output<Boolean>?

whether to add automatic annotation, default is false.

Link copied to clipboard
val condition: Output<String>?

Join condition.

Link copied to clipboard
val dashboard: Output<String>?
Link copied to clipboard

Group configuration for new alert.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Join configuration for different queries.

Link copied to clipboard
val labels: Output<List<AlertLabel>>?

Labels for new alert.

Link copied to clipboard
val muteUntil: Output<Int>

Timestamp, notifications before closing again.

Link copied to clipboard
val noDataFire: Output<Boolean>?

Switch for whether new alert fires when no data happens, default is false.

Link copied to clipboard
val noDataSeverity: Output<Int>?

when no data happens, the severity of new alert.

Link copied to clipboard

Alarm information notification list, Deprecated from 1.161.0+.

Link copied to clipboard
val notifyThreshold: Output<Int>?

Notification threshold, which is not notified until the number of triggers is reached. The default is 1, Deprecated from 1.161.0+.

Link copied to clipboard

Policy configuration for new alert.

Link copied to clipboard
val projectName: Output<String>

The project name.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Multiple conditions for configured alarm query.

Link copied to clipboard
val schedule: Output<AlertSchedule>?

schedule for alert.

Link copied to clipboard

Execution interval. 60 seconds minimum, such as 60s, 1h. Deprecated from 1.176.0+. use interval in schedule.

Link copied to clipboard
val scheduleType: Output<String>

Default FixedRate. No need to configure this parameter. Deprecated from 1.176.0+. use type in schedule.

Link copied to clipboard
val sendResolved: Output<Boolean>?

when new alert is resolved, whether to notify, default is false.

Link copied to clipboard

Severity configuration for new alert.

Link copied to clipboard
val threshold: Output<Int>

Evaluation threshold, alert will not fire until the number of triggers is reached. The default is 1.

Link copied to clipboard
val throttling: Output<String>?

Notification interval, default is no interval. Support number + unit type, for example 60s, 1h, Deprecated from 1.161.0+.

Link copied to clipboard
val type: Output<String>?

including FixedRate,Hourly,Daily,Weekly,Cron.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val version: Output<String>?

The version of alert, new alert is 2.0.