1. Packages
  2. Sentry
  3. API Docs
  4. SentryMetricAlert
Sentry v0.0.9 published on Friday, Nov 15, 2024 by Pulumiverse

sentry.SentryMetricAlert

Explore with Pulumi AI

Sentry Metric Alert resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as sentry from "@pulumi/sentry";
import * as sentry from "@pulumiverse/sentry";

const slack = sentry.getSentryOrganizationIntegration({
    organization: mainSentryProject.organization,
    providerKey: "slack",
    name: "Slack Workspace",
});
const main = new sentry.SentryMetricAlert("main", {
    organization: mainSentryProject.organization,
    project: mainSentryProject.id,
    name: "My metric alert",
    dataset: "events",
    query: "",
    aggregate: "count()",
    timeWindow: 60,
    thresholdType: 0,
    resolveThreshold: 0,
    triggers: [
        {
            actions: [{
                type: "email",
                targetType: "team",
                targetIdentifier: mainSentryTeam.teamId,
            }],
            alertThreshold: 300,
            label: "critical",
            thresholdType: 0,
        },
        {
            actions: [{
                type: "slack",
                targetType: "specific",
                targetIdentifier: "#slack-channel",
                integrationId: slack.then(slack => slack.id),
            }],
            alertThreshold: 300,
            label: "critical",
            thresholdType: 0,
        },
        {
            alertThreshold: 100,
            label: "warning",
            thresholdType: 0,
        },
    ],
});
Copy
import pulumi
import pulumi_sentry as sentry
import pulumiverse_sentry as sentry

slack = sentry.get_sentry_organization_integration(organization=main_sentry_project["organization"],
    provider_key="slack",
    name="Slack Workspace")
main = sentry.SentryMetricAlert("main",
    organization=main_sentry_project["organization"],
    project=main_sentry_project["id"],
    name="My metric alert",
    dataset="events",
    query="",
    aggregate="count()",
    time_window=60,
    threshold_type=0,
    resolve_threshold=0,
    triggers=[
        {
            "actions": [{
                "type": "email",
                "target_type": "team",
                "target_identifier": main_sentry_team["teamId"],
            }],
            "alert_threshold": 300,
            "label": "critical",
            "threshold_type": 0,
        },
        {
            "actions": [{
                "type": "slack",
                "target_type": "specific",
                "target_identifier": "#slack-channel",
                "integration_id": slack.id,
            }],
            "alert_threshold": 300,
            "label": "critical",
            "threshold_type": 0,
        },
        {
            "alert_threshold": 100,
            "label": "warning",
            "threshold_type": 0,
        },
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-sentry/sdk/go/sentry"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		slack, err := sentry.GetSentryOrganizationIntegration(ctx, &sentry.GetSentryOrganizationIntegrationArgs{
			Organization: mainSentryProject.Organization,
			ProviderKey:  "slack",
			Name:         "Slack Workspace",
		}, nil)
		if err != nil {
			return err
		}
		_, err = sentry.NewSentryMetricAlert(ctx, "main", &sentry.SentryMetricAlertArgs{
			Organization:     pulumi.Any(mainSentryProject.Organization),
			Project:          pulumi.Any(mainSentryProject.Id),
			Name:             pulumi.String("My metric alert"),
			Dataset:          pulumi.String("events"),
			Query:            pulumi.String(""),
			Aggregate:        pulumi.String("count()"),
			TimeWindow:       pulumi.Float64(60),
			ThresholdType:    pulumi.Int(0),
			ResolveThreshold: pulumi.Float64(0),
			Triggers: sentry.SentryMetricAlertTriggerArray{
				&sentry.SentryMetricAlertTriggerArgs{
					Actions: sentry.SentryMetricAlertTriggerActionArray{
						&sentry.SentryMetricAlertTriggerActionArgs{
							Type:             pulumi.String("email"),
							TargetType:       pulumi.String("team"),
							TargetIdentifier: pulumi.Any(mainSentryTeam.TeamId),
						},
					},
					AlertThreshold: pulumi.Float64(300),
					Label:          pulumi.String("critical"),
					ThresholdType:  pulumi.Int(0),
				},
				&sentry.SentryMetricAlertTriggerArgs{
					Actions: sentry.SentryMetricAlertTriggerActionArray{
						&sentry.SentryMetricAlertTriggerActionArgs{
							Type:             pulumi.String("slack"),
							TargetType:       pulumi.String("specific"),
							TargetIdentifier: pulumi.String("#slack-channel"),
							IntegrationId:    pulumi.String(slack.Id),
						},
					},
					AlertThreshold: pulumi.Float64(300),
					Label:          pulumi.String("critical"),
					ThresholdType:  pulumi.Int(0),
				},
				&sentry.SentryMetricAlertTriggerArgs{
					AlertThreshold: pulumi.Float64(100),
					Label:          pulumi.String("warning"),
					ThresholdType:  pulumi.Int(0),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Sentry = Pulumi.Sentry;
using Sentry = Pulumiverse.Sentry;

return await Deployment.RunAsync(() => 
{
    var slack = Sentry.GetSentryOrganizationIntegration.Invoke(new()
    {
        Organization = mainSentryProject.Organization,
        ProviderKey = "slack",
        Name = "Slack Workspace",
    });

    var main = new Sentry.SentryMetricAlert("main", new()
    {
        Organization = mainSentryProject.Organization,
        Project = mainSentryProject.Id,
        Name = "My metric alert",
        Dataset = "events",
        Query = "",
        Aggregate = "count()",
        TimeWindow = 60,
        ThresholdType = 0,
        ResolveThreshold = 0,
        Triggers = new[]
        {
            new Sentry.Inputs.SentryMetricAlertTriggerArgs
            {
                Actions = new[]
                {
                    new Sentry.Inputs.SentryMetricAlertTriggerActionArgs
                    {
                        Type = "email",
                        TargetType = "team",
                        TargetIdentifier = mainSentryTeam.TeamId,
                    },
                },
                AlertThreshold = 300,
                Label = "critical",
                ThresholdType = 0,
            },
            new Sentry.Inputs.SentryMetricAlertTriggerArgs
            {
                Actions = new[]
                {
                    new Sentry.Inputs.SentryMetricAlertTriggerActionArgs
                    {
                        Type = "slack",
                        TargetType = "specific",
                        TargetIdentifier = "#slack-channel",
                        IntegrationId = slack.Apply(getSentryOrganizationIntegrationResult => getSentryOrganizationIntegrationResult.Id),
                    },
                },
                AlertThreshold = 300,
                Label = "critical",
                ThresholdType = 0,
            },
            new Sentry.Inputs.SentryMetricAlertTriggerArgs
            {
                AlertThreshold = 100,
                Label = "warning",
                ThresholdType = 0,
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sentry.SentryFunctions;
import com.pulumi.sentry.inputs.GetSentryOrganizationIntegrationArgs;
import com.pulumi.sentry.SentryMetricAlert;
import com.pulumi.sentry.SentryMetricAlertArgs;
import com.pulumi.sentry.inputs.SentryMetricAlertTriggerArgs;
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) {
        final var slack = SentryFunctions.getSentryOrganizationIntegration(GetSentryOrganizationIntegrationArgs.builder()
            .organization(mainSentryProject.organization())
            .providerKey("slack")
            .name("Slack Workspace")
            .build());

        var main = new SentryMetricAlert("main", SentryMetricAlertArgs.builder()
            .organization(mainSentryProject.organization())
            .project(mainSentryProject.id())
            .name("My metric alert")
            .dataset("events")
            .query("")
            .aggregate("count()")
            .timeWindow(60)
            .thresholdType(0)
            .resolveThreshold(0)
            .triggers(            
                SentryMetricAlertTriggerArgs.builder()
                    .actions(SentryMetricAlertTriggerActionArgs.builder()
                        .type("email")
                        .targetType("team")
                        .targetIdentifier(mainSentryTeam.teamId())
                        .build())
                    .alertThreshold(300)
                    .label("critical")
                    .thresholdType(0)
                    .build(),
                SentryMetricAlertTriggerArgs.builder()
                    .actions(SentryMetricAlertTriggerActionArgs.builder()
                        .type("slack")
                        .targetType("specific")
                        .targetIdentifier("#slack-channel")
                        .integrationId(slack.applyValue(getSentryOrganizationIntegrationResult -> getSentryOrganizationIntegrationResult.id()))
                        .build())
                    .alertThreshold(300)
                    .label("critical")
                    .thresholdType(0)
                    .build(),
                SentryMetricAlertTriggerArgs.builder()
                    .alertThreshold(100)
                    .label("warning")
                    .thresholdType(0)
                    .build())
            .build());

    }
}
Copy
resources:
  main:
    type: sentry:SentryMetricAlert
    properties:
      organization: ${mainSentryProject.organization}
      project: ${mainSentryProject.id}
      name: My metric alert
      dataset: events
      query:
      aggregate: count()
      timeWindow: 60
      thresholdType: 0
      resolveThreshold: 0
      triggers:
        - actions:
            - type: email
              targetType: team
              targetIdentifier: ${mainSentryTeam.teamId}
          alertThreshold: 300
          label: critical
          thresholdType: 0
        - actions:
            - type: slack
              targetType: specific
              targetIdentifier: '#slack-channel'
              integrationId: ${slack.id}
          alertThreshold: 300
          label: critical
          thresholdType: 0
        - alertThreshold: 100
          label: warning
          thresholdType: 0
variables:
  slack:
    fn::invoke:
      Function: sentry:getSentryOrganizationIntegration
      Arguments:
        organization: ${mainSentryProject.organization}
        providerKey: slack
        name: Slack Workspace
Copy

Create SentryMetricAlert Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new SentryMetricAlert(name: string, args: SentryMetricAlertArgs, opts?: CustomResourceOptions);
@overload
def SentryMetricAlert(resource_name: str,
                      args: SentryMetricAlertArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def SentryMetricAlert(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      project: Optional[str] = None,
                      triggers: Optional[Sequence[SentryMetricAlertTriggerArgs]] = None,
                      time_window: Optional[float] = None,
                      threshold_type: Optional[int] = None,
                      query: Optional[str] = None,
                      organization: Optional[str] = None,
                      aggregate: Optional[str] = None,
                      owner: Optional[str] = None,
                      name: Optional[str] = None,
                      resolve_threshold: Optional[float] = None,
                      event_types: Optional[Sequence[str]] = None,
                      environment: Optional[str] = None,
                      dataset: Optional[str] = None)
func NewSentryMetricAlert(ctx *Context, name string, args SentryMetricAlertArgs, opts ...ResourceOption) (*SentryMetricAlert, error)
public SentryMetricAlert(string name, SentryMetricAlertArgs args, CustomResourceOptions? opts = null)
public SentryMetricAlert(String name, SentryMetricAlertArgs args)
public SentryMetricAlert(String name, SentryMetricAlertArgs args, CustomResourceOptions options)
type: sentry:SentryMetricAlert
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. SentryMetricAlertArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. SentryMetricAlertArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. SentryMetricAlertArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. SentryMetricAlertArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. SentryMetricAlertArgs
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 sentryMetricAlertResource = new Sentry.SentryMetricAlert("sentryMetricAlertResource", new()
{
    Project = "string",
    Triggers = new[]
    {
        new Sentry.Inputs.SentryMetricAlertTriggerArgs
        {
            AlertThreshold = 0,
            Label = "string",
            ThresholdType = 0,
            Actions = new[]
            {
                new Sentry.Inputs.SentryMetricAlertTriggerActionArgs
                {
                    TargetType = "string",
                    Type = "string",
                    Id = "string",
                    IntegrationId = 0,
                    TargetIdentifier = "string",
                },
            },
            Id = "string",
            ResolveThreshold = 0,
        },
    },
    TimeWindow = 0,
    ThresholdType = 0,
    Query = "string",
    Organization = "string",
    Aggregate = "string",
    Owner = "string",
    Name = "string",
    ResolveThreshold = 0,
    EventTypes = new[]
    {
        "string",
    },
    Environment = "string",
    Dataset = "string",
});
Copy
example, err := sentry.NewSentryMetricAlert(ctx, "sentryMetricAlertResource", &sentry.SentryMetricAlertArgs{
	Project: pulumi.String("string"),
	Triggers: sentry.SentryMetricAlertTriggerArray{
		&sentry.SentryMetricAlertTriggerArgs{
			AlertThreshold: pulumi.Float64(0),
			Label:          pulumi.String("string"),
			ThresholdType:  pulumi.Int(0),
			Actions: sentry.SentryMetricAlertTriggerActionArray{
				&sentry.SentryMetricAlertTriggerActionArgs{
					TargetType:       pulumi.String("string"),
					Type:             pulumi.String("string"),
					Id:               pulumi.String("string"),
					IntegrationId:    pulumi.Int(0),
					TargetIdentifier: pulumi.String("string"),
				},
			},
			Id:               pulumi.String("string"),
			ResolveThreshold: pulumi.Float64(0),
		},
	},
	TimeWindow:       pulumi.Float64(0),
	ThresholdType:    pulumi.Int(0),
	Query:            pulumi.String("string"),
	Organization:     pulumi.String("string"),
	Aggregate:        pulumi.String("string"),
	Owner:            pulumi.String("string"),
	Name:             pulumi.String("string"),
	ResolveThreshold: pulumi.Float64(0),
	EventTypes: pulumi.StringArray{
		pulumi.String("string"),
	},
	Environment: pulumi.String("string"),
	Dataset:     pulumi.String("string"),
})
Copy
var sentryMetricAlertResource = new SentryMetricAlert("sentryMetricAlertResource", SentryMetricAlertArgs.builder()
    .project("string")
    .triggers(SentryMetricAlertTriggerArgs.builder()
        .alertThreshold(0)
        .label("string")
        .thresholdType(0)
        .actions(SentryMetricAlertTriggerActionArgs.builder()
            .targetType("string")
            .type("string")
            .id("string")
            .integrationId(0)
            .targetIdentifier("string")
            .build())
        .id("string")
        .resolveThreshold(0)
        .build())
    .timeWindow(0)
    .thresholdType(0)
    .query("string")
    .organization("string")
    .aggregate("string")
    .owner("string")
    .name("string")
    .resolveThreshold(0)
    .eventTypes("string")
    .environment("string")
    .dataset("string")
    .build());
Copy
sentry_metric_alert_resource = sentry.SentryMetricAlert("sentryMetricAlertResource",
    project="string",
    triggers=[{
        "alert_threshold": 0,
        "label": "string",
        "threshold_type": 0,
        "actions": [{
            "target_type": "string",
            "type": "string",
            "id": "string",
            "integration_id": 0,
            "target_identifier": "string",
        }],
        "id": "string",
        "resolve_threshold": 0,
    }],
    time_window=0,
    threshold_type=0,
    query="string",
    organization="string",
    aggregate="string",
    owner="string",
    name="string",
    resolve_threshold=0,
    event_types=["string"],
    environment="string",
    dataset="string")
Copy
const sentryMetricAlertResource = new sentry.SentryMetricAlert("sentryMetricAlertResource", {
    project: "string",
    triggers: [{
        alertThreshold: 0,
        label: "string",
        thresholdType: 0,
        actions: [{
            targetType: "string",
            type: "string",
            id: "string",
            integrationId: 0,
            targetIdentifier: "string",
        }],
        id: "string",
        resolveThreshold: 0,
    }],
    timeWindow: 0,
    thresholdType: 0,
    query: "string",
    organization: "string",
    aggregate: "string",
    owner: "string",
    name: "string",
    resolveThreshold: 0,
    eventTypes: ["string"],
    environment: "string",
    dataset: "string",
});
Copy
type: sentry:SentryMetricAlert
properties:
    aggregate: string
    dataset: string
    environment: string
    eventTypes:
        - string
    name: string
    organization: string
    owner: string
    project: string
    query: string
    resolveThreshold: 0
    thresholdType: 0
    timeWindow: 0
    triggers:
        - actions:
            - id: string
              integrationId: 0
              targetIdentifier: string
              targetType: string
              type: string
          alertThreshold: 0
          id: string
          label: string
          resolveThreshold: 0
          thresholdType: 0
Copy

SentryMetricAlert 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 SentryMetricAlert resource accepts the following input properties:

Aggregate This property is required. string
The aggregation criteria to apply
Organization This property is required. string
The slug of the organization the metric alert belongs to.
Project This property is required. string
The slug of the project to create the metric alert for.
Query This property is required. string
The query filter to apply
ThresholdType This property is required. int
The type of threshold
TimeWindow This property is required. double
The period to evaluate the Alert rule in minutes
Triggers This property is required. List<Pulumiverse.Sentry.Inputs.SentryMetricAlertTrigger>
Dataset string
The Sentry Alert category
Environment string
Perform Alert rule in a specific environment
EventTypes List<string>
The events type of dataset.
Name string
The metric alert name.
Owner string
Specifies the owner id of this Alert rule
ResolveThreshold double
The value at which the Alert rule resolves
Aggregate This property is required. string
The aggregation criteria to apply
Organization This property is required. string
The slug of the organization the metric alert belongs to.
Project This property is required. string
The slug of the project to create the metric alert for.
Query This property is required. string
The query filter to apply
ThresholdType This property is required. int
The type of threshold
TimeWindow This property is required. float64
The period to evaluate the Alert rule in minutes
Triggers This property is required. []SentryMetricAlertTriggerArgs
Dataset string
The Sentry Alert category
Environment string
Perform Alert rule in a specific environment
EventTypes []string
The events type of dataset.
Name string
The metric alert name.
Owner string
Specifies the owner id of this Alert rule
ResolveThreshold float64
The value at which the Alert rule resolves
aggregate This property is required. String
The aggregation criteria to apply
organization This property is required. String
The slug of the organization the metric alert belongs to.
project This property is required. String
The slug of the project to create the metric alert for.
query This property is required. String
The query filter to apply
thresholdType This property is required. Integer
The type of threshold
timeWindow This property is required. Double
The period to evaluate the Alert rule in minutes
triggers This property is required. List<SentryMetricAlertTrigger>
dataset String
The Sentry Alert category
environment String
Perform Alert rule in a specific environment
eventTypes List<String>
The events type of dataset.
name String
The metric alert name.
owner String
Specifies the owner id of this Alert rule
resolveThreshold Double
The value at which the Alert rule resolves
aggregate This property is required. string
The aggregation criteria to apply
organization This property is required. string
The slug of the organization the metric alert belongs to.
project This property is required. string
The slug of the project to create the metric alert for.
query This property is required. string
The query filter to apply
thresholdType This property is required. number
The type of threshold
timeWindow This property is required. number
The period to evaluate the Alert rule in minutes
triggers This property is required. SentryMetricAlertTrigger[]
dataset string
The Sentry Alert category
environment string
Perform Alert rule in a specific environment
eventTypes string[]
The events type of dataset.
name string
The metric alert name.
owner string
Specifies the owner id of this Alert rule
resolveThreshold number
The value at which the Alert rule resolves
aggregate This property is required. str
The aggregation criteria to apply
organization This property is required. str
The slug of the organization the metric alert belongs to.
project This property is required. str
The slug of the project to create the metric alert for.
query This property is required. str
The query filter to apply
threshold_type This property is required. int
The type of threshold
time_window This property is required. float
The period to evaluate the Alert rule in minutes
triggers This property is required. Sequence[SentryMetricAlertTriggerArgs]
dataset str
The Sentry Alert category
environment str
Perform Alert rule in a specific environment
event_types Sequence[str]
The events type of dataset.
name str
The metric alert name.
owner str
Specifies the owner id of this Alert rule
resolve_threshold float
The value at which the Alert rule resolves
aggregate This property is required. String
The aggregation criteria to apply
organization This property is required. String
The slug of the organization the metric alert belongs to.
project This property is required. String
The slug of the project to create the metric alert for.
query This property is required. String
The query filter to apply
thresholdType This property is required. Number
The type of threshold
timeWindow This property is required. Number
The period to evaluate the Alert rule in minutes
triggers This property is required. List<Property Map>
dataset String
The Sentry Alert category
environment String
Perform Alert rule in a specific environment
eventTypes List<String>
The events type of dataset.
name String
The metric alert name.
owner String
Specifies the owner id of this Alert rule
resolveThreshold Number
The value at which the Alert rule resolves

Outputs

All input properties are implicitly available as output properties. Additionally, the SentryMetricAlert resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
InternalId string
The internal ID for this metric alert.
Id string
The provider-assigned unique ID for this managed resource.
InternalId string
The internal ID for this metric alert.
id String
The provider-assigned unique ID for this managed resource.
internalId String
The internal ID for this metric alert.
id string
The provider-assigned unique ID for this managed resource.
internalId string
The internal ID for this metric alert.
id str
The provider-assigned unique ID for this managed resource.
internal_id str
The internal ID for this metric alert.
id String
The provider-assigned unique ID for this managed resource.
internalId String
The internal ID for this metric alert.

Look up Existing SentryMetricAlert Resource

Get an existing SentryMetricAlert 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?: SentryMetricAlertState, opts?: CustomResourceOptions): SentryMetricAlert
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        aggregate: Optional[str] = None,
        dataset: Optional[str] = None,
        environment: Optional[str] = None,
        event_types: Optional[Sequence[str]] = None,
        internal_id: Optional[str] = None,
        name: Optional[str] = None,
        organization: Optional[str] = None,
        owner: Optional[str] = None,
        project: Optional[str] = None,
        query: Optional[str] = None,
        resolve_threshold: Optional[float] = None,
        threshold_type: Optional[int] = None,
        time_window: Optional[float] = None,
        triggers: Optional[Sequence[SentryMetricAlertTriggerArgs]] = None) -> SentryMetricAlert
func GetSentryMetricAlert(ctx *Context, name string, id IDInput, state *SentryMetricAlertState, opts ...ResourceOption) (*SentryMetricAlert, error)
public static SentryMetricAlert Get(string name, Input<string> id, SentryMetricAlertState? state, CustomResourceOptions? opts = null)
public static SentryMetricAlert get(String name, Output<String> id, SentryMetricAlertState state, CustomResourceOptions options)
resources:  _:    type: sentry:SentryMetricAlert    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Aggregate string
The aggregation criteria to apply
Dataset string
The Sentry Alert category
Environment string
Perform Alert rule in a specific environment
EventTypes List<string>
The events type of dataset.
InternalId string
The internal ID for this metric alert.
Name string
The metric alert name.
Organization string
The slug of the organization the metric alert belongs to.
Owner string
Specifies the owner id of this Alert rule
Project string
The slug of the project to create the metric alert for.
Query string
The query filter to apply
ResolveThreshold double
The value at which the Alert rule resolves
ThresholdType int
The type of threshold
TimeWindow double
The period to evaluate the Alert rule in minutes
Triggers List<Pulumiverse.Sentry.Inputs.SentryMetricAlertTrigger>
Aggregate string
The aggregation criteria to apply
Dataset string
The Sentry Alert category
Environment string
Perform Alert rule in a specific environment
EventTypes []string
The events type of dataset.
InternalId string
The internal ID for this metric alert.
Name string
The metric alert name.
Organization string
The slug of the organization the metric alert belongs to.
Owner string
Specifies the owner id of this Alert rule
Project string
The slug of the project to create the metric alert for.
Query string
The query filter to apply
ResolveThreshold float64
The value at which the Alert rule resolves
ThresholdType int
The type of threshold
TimeWindow float64
The period to evaluate the Alert rule in minutes
Triggers []SentryMetricAlertTriggerArgs
aggregate String
The aggregation criteria to apply
dataset String
The Sentry Alert category
environment String
Perform Alert rule in a specific environment
eventTypes List<String>
The events type of dataset.
internalId String
The internal ID for this metric alert.
name String
The metric alert name.
organization String
The slug of the organization the metric alert belongs to.
owner String
Specifies the owner id of this Alert rule
project String
The slug of the project to create the metric alert for.
query String
The query filter to apply
resolveThreshold Double
The value at which the Alert rule resolves
thresholdType Integer
The type of threshold
timeWindow Double
The period to evaluate the Alert rule in minutes
triggers List<SentryMetricAlertTrigger>
aggregate string
The aggregation criteria to apply
dataset string
The Sentry Alert category
environment string
Perform Alert rule in a specific environment
eventTypes string[]
The events type of dataset.
internalId string
The internal ID for this metric alert.
name string
The metric alert name.
organization string
The slug of the organization the metric alert belongs to.
owner string
Specifies the owner id of this Alert rule
project string
The slug of the project to create the metric alert for.
query string
The query filter to apply
resolveThreshold number
The value at which the Alert rule resolves
thresholdType number
The type of threshold
timeWindow number
The period to evaluate the Alert rule in minutes
triggers SentryMetricAlertTrigger[]
aggregate str
The aggregation criteria to apply
dataset str
The Sentry Alert category
environment str
Perform Alert rule in a specific environment
event_types Sequence[str]
The events type of dataset.
internal_id str
The internal ID for this metric alert.
name str
The metric alert name.
organization str
The slug of the organization the metric alert belongs to.
owner str
Specifies the owner id of this Alert rule
project str
The slug of the project to create the metric alert for.
query str
The query filter to apply
resolve_threshold float
The value at which the Alert rule resolves
threshold_type int
The type of threshold
time_window float
The period to evaluate the Alert rule in minutes
triggers Sequence[SentryMetricAlertTriggerArgs]
aggregate String
The aggregation criteria to apply
dataset String
The Sentry Alert category
environment String
Perform Alert rule in a specific environment
eventTypes List<String>
The events type of dataset.
internalId String
The internal ID for this metric alert.
name String
The metric alert name.
organization String
The slug of the organization the metric alert belongs to.
owner String
Specifies the owner id of this Alert rule
project String
The slug of the project to create the metric alert for.
query String
The query filter to apply
resolveThreshold Number
The value at which the Alert rule resolves
thresholdType Number
The type of threshold
timeWindow Number
The period to evaluate the Alert rule in minutes
triggers List<Property Map>

Supporting Types

SentryMetricAlertTrigger
, SentryMetricAlertTriggerArgs

AlertThreshold This property is required. double
Label This property is required. string
ThresholdType This property is required. int
Actions List<Pulumiverse.Sentry.Inputs.SentryMetricAlertTriggerAction>
Id string
The ID of this resource.
ResolveThreshold double
AlertThreshold This property is required. float64
Label This property is required. string
ThresholdType This property is required. int
Actions []SentryMetricAlertTriggerAction
Id string
The ID of this resource.
ResolveThreshold float64
alertThreshold This property is required. Double
label This property is required. String
thresholdType This property is required. Integer
actions List<SentryMetricAlertTriggerAction>
id String
The ID of this resource.
resolveThreshold Double
alertThreshold This property is required. number
label This property is required. string
thresholdType This property is required. number
actions SentryMetricAlertTriggerAction[]
id string
The ID of this resource.
resolveThreshold number
alert_threshold This property is required. float
label This property is required. str
threshold_type This property is required. int
actions Sequence[SentryMetricAlertTriggerAction]
id str
The ID of this resource.
resolve_threshold float
alertThreshold This property is required. Number
label This property is required. String
thresholdType This property is required. Number
actions List<Property Map>
id String
The ID of this resource.
resolveThreshold Number

SentryMetricAlertTriggerAction
, SentryMetricAlertTriggerActionArgs

TargetType This property is required. string
Type This property is required. string
Id string
The ID of this resource.
IntegrationId int
TargetIdentifier string
TargetType This property is required. string
Type This property is required. string
Id string
The ID of this resource.
IntegrationId int
TargetIdentifier string
targetType This property is required. String
type This property is required. String
id String
The ID of this resource.
integrationId Integer
targetIdentifier String
targetType This property is required. string
type This property is required. string
id string
The ID of this resource.
integrationId number
targetIdentifier string
target_type This property is required. str
type This property is required. str
id str
The ID of this resource.
integration_id int
target_identifier str
targetType This property is required. String
type This property is required. String
id String
The ID of this resource.
integrationId Number
targetIdentifier String

Import

import using the organization, project slugs and rule id from the URL:

https://sentry.io/organizations/[org-slug]/projects/[project-slug]/

https://sentry.io/organizations/[org-slug]/alerts/rules/details/[rule-id]/

or

https://sentry.io/organizations/[org-slug]/alerts/metric-rules/[project-slug]/[rule-id]/

$ pulumi import sentry:index/sentryMetricAlert:SentryMetricAlert default org-slug/project-slug/rule-id
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
sentry pulumiverse/pulumi-sentry
License
Apache-2.0
Notes
This Pulumi package is based on the sentry Terraform Provider.