sysdig.MonitorAlertPromql
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as sysdig from "@pulumi/sysdig";
const sample = new sysdig.MonitorAlertPromql("sample", {
    description: "Elasticsearch JVM heap used over attention threshold",
    promql: "(elasticsearch_jvm_memory_used_bytes{area=\"heap\"} / elasticsearch_jvm_memory_max_bytes{area=\"heap\"}) * 100 > 80",
    severity: 6,
    triggerAfterMinutes: 10,
});
import pulumi
import pulumi_sysdig as sysdig
sample = sysdig.MonitorAlertPromql("sample",
    description="Elasticsearch JVM heap used over attention threshold",
    promql="(elasticsearch_jvm_memory_used_bytes{area=\"heap\"} / elasticsearch_jvm_memory_max_bytes{area=\"heap\"}) * 100 > 80",
    severity=6,
    trigger_after_minutes=10)
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/sysdig/sysdig"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sysdig.NewMonitorAlertPromql(ctx, "sample", &sysdig.MonitorAlertPromqlArgs{
			Description:         pulumi.String("Elasticsearch JVM heap used over attention threshold"),
			Promql:              pulumi.String("(elasticsearch_jvm_memory_used_bytes{area=\"heap\"} / elasticsearch_jvm_memory_max_bytes{area=\"heap\"}) * 100 > 80"),
			Severity:            pulumi.Float64(6),
			TriggerAfterMinutes: pulumi.Float64(10),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Sysdig = Pulumi.Sysdig;
return await Deployment.RunAsync(() => 
{
    var sample = new Sysdig.MonitorAlertPromql("sample", new()
    {
        Description = "Elasticsearch JVM heap used over attention threshold",
        Promql = "(elasticsearch_jvm_memory_used_bytes{area=\"heap\"} / elasticsearch_jvm_memory_max_bytes{area=\"heap\"}) * 100 > 80",
        Severity = 6,
        TriggerAfterMinutes = 10,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sysdig.MonitorAlertPromql;
import com.pulumi.sysdig.MonitorAlertPromqlArgs;
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 sample = new MonitorAlertPromql("sample", MonitorAlertPromqlArgs.builder()
            .description("Elasticsearch JVM heap used over attention threshold")
            .promql("(elasticsearch_jvm_memory_used_bytes{area=\"heap\"} / elasticsearch_jvm_memory_max_bytes{area=\"heap\"}) * 100 > 80")
            .severity(6)
            .triggerAfterMinutes(10)
            .build());
    }
}
resources:
  sample:
    type: sysdig:MonitorAlertPromql
    properties:
      description: Elasticsearch JVM heap used over attention threshold
      promql: (elasticsearch_jvm_memory_used_bytes{area="heap"} / elasticsearch_jvm_memory_max_bytes{area="heap"}) * 100 > 80
      severity: 6
      triggerAfterMinutes: 10
Create MonitorAlertPromql Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MonitorAlertPromql(name: string, args: MonitorAlertPromqlArgs, opts?: CustomResourceOptions);@overload
def MonitorAlertPromql(resource_name: str,
                       args: MonitorAlertPromqlArgs,
                       opts: Optional[ResourceOptions] = None)
@overload
def MonitorAlertPromql(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       promql: Optional[str] = None,
                       trigger_after_minutes: Optional[float] = None,
                       name: Optional[str] = None,
                       enabled: Optional[bool] = None,
                       group_name: Optional[str] = None,
                       monitor_alert_promql_id: Optional[str] = None,
                       capture: Optional[MonitorAlertPromqlCaptureArgs] = None,
                       notification_channels: Optional[Sequence[float]] = None,
                       description: Optional[str] = None,
                       renotification_minutes: Optional[float] = None,
                       scope: Optional[str] = None,
                       severity: Optional[float] = None,
                       timeouts: Optional[MonitorAlertPromqlTimeoutsArgs] = None,
                       custom_notification: Optional[MonitorAlertPromqlCustomNotificationArgs] = None)func NewMonitorAlertPromql(ctx *Context, name string, args MonitorAlertPromqlArgs, opts ...ResourceOption) (*MonitorAlertPromql, error)public MonitorAlertPromql(string name, MonitorAlertPromqlArgs args, CustomResourceOptions? opts = null)
public MonitorAlertPromql(String name, MonitorAlertPromqlArgs args)
public MonitorAlertPromql(String name, MonitorAlertPromqlArgs args, CustomResourceOptions options)
type: sysdig:MonitorAlertPromql
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args MonitorAlertPromqlArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args MonitorAlertPromqlArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args MonitorAlertPromqlArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args MonitorAlertPromqlArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args MonitorAlertPromqlArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var monitorAlertPromqlResource = new Sysdig.MonitorAlertPromql("monitorAlertPromqlResource", new()
{
    Promql = "string",
    TriggerAfterMinutes = 0,
    Name = "string",
    Enabled = false,
    GroupName = "string",
    MonitorAlertPromqlId = "string",
    Capture = new Sysdig.Inputs.MonitorAlertPromqlCaptureArgs
    {
        Duration = 0,
        Filename = "string",
        Filter = "string",
    },
    NotificationChannels = new[]
    {
        0,
    },
    Description = "string",
    RenotificationMinutes = 0,
    Scope = "string",
    Severity = 0,
    Timeouts = new Sysdig.Inputs.MonitorAlertPromqlTimeoutsArgs
    {
        Create = "string",
        Delete = "string",
        Read = "string",
        Update = "string",
    },
    CustomNotification = new Sysdig.Inputs.MonitorAlertPromqlCustomNotificationArgs
    {
        Title = "string",
        Append = "string",
        Prepend = "string",
    },
});
example, err := sysdig.NewMonitorAlertPromql(ctx, "monitorAlertPromqlResource", &sysdig.MonitorAlertPromqlArgs{
	Promql:               pulumi.String("string"),
	TriggerAfterMinutes:  pulumi.Float64(0),
	Name:                 pulumi.String("string"),
	Enabled:              pulumi.Bool(false),
	GroupName:            pulumi.String("string"),
	MonitorAlertPromqlId: pulumi.String("string"),
	Capture: &sysdig.MonitorAlertPromqlCaptureArgs{
		Duration: pulumi.Float64(0),
		Filename: pulumi.String("string"),
		Filter:   pulumi.String("string"),
	},
	NotificationChannels: pulumi.Float64Array{
		pulumi.Float64(0),
	},
	Description:           pulumi.String("string"),
	RenotificationMinutes: pulumi.Float64(0),
	Scope:                 pulumi.String("string"),
	Severity:              pulumi.Float64(0),
	Timeouts: &sysdig.MonitorAlertPromqlTimeoutsArgs{
		Create: pulumi.String("string"),
		Delete: pulumi.String("string"),
		Read:   pulumi.String("string"),
		Update: pulumi.String("string"),
	},
	CustomNotification: &sysdig.MonitorAlertPromqlCustomNotificationArgs{
		Title:   pulumi.String("string"),
		Append:  pulumi.String("string"),
		Prepend: pulumi.String("string"),
	},
})
var monitorAlertPromqlResource = new MonitorAlertPromql("monitorAlertPromqlResource", MonitorAlertPromqlArgs.builder()
    .promql("string")
    .triggerAfterMinutes(0.0)
    .name("string")
    .enabled(false)
    .groupName("string")
    .monitorAlertPromqlId("string")
    .capture(MonitorAlertPromqlCaptureArgs.builder()
        .duration(0.0)
        .filename("string")
        .filter("string")
        .build())
    .notificationChannels(0.0)
    .description("string")
    .renotificationMinutes(0.0)
    .scope("string")
    .severity(0.0)
    .timeouts(MonitorAlertPromqlTimeoutsArgs.builder()
        .create("string")
        .delete("string")
        .read("string")
        .update("string")
        .build())
    .customNotification(MonitorAlertPromqlCustomNotificationArgs.builder()
        .title("string")
        .append("string")
        .prepend("string")
        .build())
    .build());
monitor_alert_promql_resource = sysdig.MonitorAlertPromql("monitorAlertPromqlResource",
    promql="string",
    trigger_after_minutes=0,
    name="string",
    enabled=False,
    group_name="string",
    monitor_alert_promql_id="string",
    capture={
        "duration": 0,
        "filename": "string",
        "filter": "string",
    },
    notification_channels=[0],
    description="string",
    renotification_minutes=0,
    scope="string",
    severity=0,
    timeouts={
        "create": "string",
        "delete": "string",
        "read": "string",
        "update": "string",
    },
    custom_notification={
        "title": "string",
        "append": "string",
        "prepend": "string",
    })
const monitorAlertPromqlResource = new sysdig.MonitorAlertPromql("monitorAlertPromqlResource", {
    promql: "string",
    triggerAfterMinutes: 0,
    name: "string",
    enabled: false,
    groupName: "string",
    monitorAlertPromqlId: "string",
    capture: {
        duration: 0,
        filename: "string",
        filter: "string",
    },
    notificationChannels: [0],
    description: "string",
    renotificationMinutes: 0,
    scope: "string",
    severity: 0,
    timeouts: {
        create: "string",
        "delete": "string",
        read: "string",
        update: "string",
    },
    customNotification: {
        title: "string",
        append: "string",
        prepend: "string",
    },
});
type: sysdig:MonitorAlertPromql
properties:
    capture:
        duration: 0
        filename: string
        filter: string
    customNotification:
        append: string
        prepend: string
        title: string
    description: string
    enabled: false
    groupName: string
    monitorAlertPromqlId: string
    name: string
    notificationChannels:
        - 0
    promql: string
    renotificationMinutes: 0
    scope: string
    severity: 0
    timeouts:
        create: string
        delete: string
        read: string
        update: string
    triggerAfterMinutes: 0
MonitorAlertPromql Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The MonitorAlertPromql resource accepts the following input properties:
- Promql string
- TriggerAfter doubleMinutes 
- Capture
MonitorAlert Promql Capture 
- CustomNotification MonitorAlert Promql Custom Notification 
- Description string
- Enabled bool
- GroupName string
- MonitorAlert stringPromql Id 
- ID of the alert created.
- Name string
- NotificationChannels List<double>
- RenotificationMinutes double
- Scope string
- Severity double
- Timeouts
MonitorAlert Promql Timeouts 
- Promql string
- TriggerAfter float64Minutes 
- Capture
MonitorAlert Promql Capture Args 
- CustomNotification MonitorAlert Promql Custom Notification Args 
- Description string
- Enabled bool
- GroupName string
- MonitorAlert stringPromql Id 
- ID of the alert created.
- Name string
- NotificationChannels []float64
- RenotificationMinutes float64
- Scope string
- Severity float64
- Timeouts
MonitorAlert Promql Timeouts Args 
- promql String
- triggerAfter DoubleMinutes 
- capture
MonitorAlert Promql Capture 
- customNotification MonitorAlert Promql Custom Notification 
- description String
- enabled Boolean
- groupName String
- monitorAlert StringPromql Id 
- ID of the alert created.
- name String
- notificationChannels List<Double>
- renotificationMinutes Double
- scope String
- severity Double
- timeouts
MonitorAlert Promql Timeouts 
- promql string
- triggerAfter numberMinutes 
- capture
MonitorAlert Promql Capture 
- customNotification MonitorAlert Promql Custom Notification 
- description string
- enabled boolean
- groupName string
- monitorAlert stringPromql Id 
- ID of the alert created.
- name string
- notificationChannels number[]
- renotificationMinutes number
- scope string
- severity number
- timeouts
MonitorAlert Promql Timeouts 
- promql str
- trigger_after_ floatminutes 
- capture
MonitorAlert Promql Capture Args 
- custom_notification MonitorAlert Promql Custom Notification Args 
- description str
- enabled bool
- group_name str
- monitor_alert_ strpromql_ id 
- ID of the alert created.
- name str
- notification_channels Sequence[float]
- renotification_minutes float
- scope str
- severity float
- timeouts
MonitorAlert Promql Timeouts Args 
- promql String
- triggerAfter NumberMinutes 
- capture Property Map
- customNotification Property Map
- description String
- enabled Boolean
- groupName String
- monitorAlert StringPromql Id 
- ID of the alert created.
- name String
- notificationChannels List<Number>
- renotificationMinutes Number
- scope String
- severity Number
- timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the MonitorAlertPromql resource produces the following output properties:
Look up Existing MonitorAlertPromql Resource
Get an existing MonitorAlertPromql resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: MonitorAlertPromqlState, opts?: CustomResourceOptions): MonitorAlertPromql@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        capture: Optional[MonitorAlertPromqlCaptureArgs] = None,
        custom_notification: Optional[MonitorAlertPromqlCustomNotificationArgs] = None,
        description: Optional[str] = None,
        enabled: Optional[bool] = None,
        group_name: Optional[str] = None,
        monitor_alert_promql_id: Optional[str] = None,
        name: Optional[str] = None,
        notification_channels: Optional[Sequence[float]] = None,
        promql: Optional[str] = None,
        renotification_minutes: Optional[float] = None,
        scope: Optional[str] = None,
        severity: Optional[float] = None,
        team: Optional[float] = None,
        timeouts: Optional[MonitorAlertPromqlTimeoutsArgs] = None,
        trigger_after_minutes: Optional[float] = None,
        version: Optional[float] = None) -> MonitorAlertPromqlfunc GetMonitorAlertPromql(ctx *Context, name string, id IDInput, state *MonitorAlertPromqlState, opts ...ResourceOption) (*MonitorAlertPromql, error)public static MonitorAlertPromql Get(string name, Input<string> id, MonitorAlertPromqlState? state, CustomResourceOptions? opts = null)public static MonitorAlertPromql get(String name, Output<String> id, MonitorAlertPromqlState state, CustomResourceOptions options)resources:  _:    type: sysdig:MonitorAlertPromql    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Capture
MonitorAlert Promql Capture 
- CustomNotification MonitorAlert Promql Custom Notification 
- Description string
- Enabled bool
- GroupName string
- MonitorAlert stringPromql Id 
- ID of the alert created.
- Name string
- NotificationChannels List<double>
- Promql string
- RenotificationMinutes double
- Scope string
- Severity double
- Team double
- Team ID that owns the alert.
- Timeouts
MonitorAlert Promql Timeouts 
- TriggerAfter doubleMinutes 
- Version double
- Current version of the resource in Sysdig Monitor.
- Capture
MonitorAlert Promql Capture Args 
- CustomNotification MonitorAlert Promql Custom Notification Args 
- Description string
- Enabled bool
- GroupName string
- MonitorAlert stringPromql Id 
- ID of the alert created.
- Name string
- NotificationChannels []float64
- Promql string
- RenotificationMinutes float64
- Scope string
- Severity float64
- Team float64
- Team ID that owns the alert.
- Timeouts
MonitorAlert Promql Timeouts Args 
- TriggerAfter float64Minutes 
- Version float64
- Current version of the resource in Sysdig Monitor.
- capture
MonitorAlert Promql Capture 
- customNotification MonitorAlert Promql Custom Notification 
- description String
- enabled Boolean
- groupName String
- monitorAlert StringPromql Id 
- ID of the alert created.
- name String
- notificationChannels List<Double>
- promql String
- renotificationMinutes Double
- scope String
- severity Double
- team Double
- Team ID that owns the alert.
- timeouts
MonitorAlert Promql Timeouts 
- triggerAfter DoubleMinutes 
- version Double
- Current version of the resource in Sysdig Monitor.
- capture
MonitorAlert Promql Capture 
- customNotification MonitorAlert Promql Custom Notification 
- description string
- enabled boolean
- groupName string
- monitorAlert stringPromql Id 
- ID of the alert created.
- name string
- notificationChannels number[]
- promql string
- renotificationMinutes number
- scope string
- severity number
- team number
- Team ID that owns the alert.
- timeouts
MonitorAlert Promql Timeouts 
- triggerAfter numberMinutes 
- version number
- Current version of the resource in Sysdig Monitor.
- capture
MonitorAlert Promql Capture Args 
- custom_notification MonitorAlert Promql Custom Notification Args 
- description str
- enabled bool
- group_name str
- monitor_alert_ strpromql_ id 
- ID of the alert created.
- name str
- notification_channels Sequence[float]
- promql str
- renotification_minutes float
- scope str
- severity float
- team float
- Team ID that owns the alert.
- timeouts
MonitorAlert Promql Timeouts Args 
- trigger_after_ floatminutes 
- version float
- Current version of the resource in Sysdig Monitor.
- capture Property Map
- customNotification Property Map
- description String
- enabled Boolean
- groupName String
- monitorAlert StringPromql Id 
- ID of the alert created.
- name String
- notificationChannels List<Number>
- promql String
- renotificationMinutes Number
- scope String
- severity Number
- team Number
- Team ID that owns the alert.
- timeouts Property Map
- triggerAfter NumberMinutes 
- version Number
- Current version of the resource in Sysdig Monitor.
Supporting Types
MonitorAlertPromqlCapture, MonitorAlertPromqlCaptureArgs        
MonitorAlertPromqlCustomNotification, MonitorAlertPromqlCustomNotificationArgs          
MonitorAlertPromqlTimeouts, MonitorAlertPromqlTimeoutsArgs        
Import
Prometheus alerts can be imported using the alert ID, e.g.
$ pulumi import sysdig:index/monitorAlertPromql:MonitorAlertPromql example 12345
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- sysdig sysdiglabs/terraform-provider-sysdig
- License
- Notes
- This Pulumi package is based on the sysdigTerraform Provider.