1. Packages
  2. Honeycombio Provider
  3. API Docs
  4. Trigger
honeycombio 0.31.0 published on Friday, Mar 7, 2025 by honeycombio

honeycombio.Trigger

Explore with Pulumi AI

# Resource: honeycombio.Trigger

Creates a trigger. For more information about triggers, check out Alert with Triggers.

Example Usage

Basic Example

import * as pulumi from "@pulumi/pulumi";
import * as honeycombio from "@pulumi/honeycombio";

const config = new pulumi.Config();
const dataset = config.require("dataset");
const exampleQuerySpecification = honeycombio.getQuerySpecification({
    calculations: [{
        op: "AVG",
        column: "duration_ms",
    }],
    filters: [{
        column: "trace.parent_id",
        op: "does-not-exist",
    }],
    timeRange: 1800,
});
const exampleTrigger = new honeycombio.Trigger("exampleTrigger", {
    description: "Average duration of all requests for the last 10 minutes.",
    queryJson: exampleQuerySpecification.then(exampleQuerySpecification => exampleQuerySpecification.json),
    dataset: dataset,
    frequency: 600,
    alertType: "on_change",
    thresholds: [{
        op: ">",
        value: 1000,
    }],
    recipients: [
        {
            type: "email",
            target: "hello@example.com",
        },
        {
            type: "marker",
            target: "Trigger - requests are slow",
        },
    ],
});
Copy
import pulumi
import pulumi_honeycombio as honeycombio

config = pulumi.Config()
dataset = config.require("dataset")
example_query_specification = honeycombio.get_query_specification(calculations=[{
        "op": "AVG",
        "column": "duration_ms",
    }],
    filters=[{
        "column": "trace.parent_id",
        "op": "does-not-exist",
    }],
    time_range=1800)
example_trigger = honeycombio.Trigger("exampleTrigger",
    description="Average duration of all requests for the last 10 minutes.",
    query_json=example_query_specification.json,
    dataset=dataset,
    frequency=600,
    alert_type="on_change",
    thresholds=[{
        "op": ">",
        "value": 1000,
    }],
    recipients=[
        {
            "type": "email",
            "target": "hello@example.com",
        },
        {
            "type": "marker",
            "target": "Trigger - requests are slow",
        },
    ])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/honeycombio/honeycombio"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		dataset := cfg.Require("dataset")
		exampleQuerySpecification, err := honeycombio.GetQuerySpecification(ctx, &honeycombio.GetQuerySpecificationArgs{
			Calculations: []honeycombio.GetQuerySpecificationCalculation{
				{
					Op:     "AVG",
					Column: pulumi.StringRef("duration_ms"),
				},
			},
			Filters: []honeycombio.GetQuerySpecificationFilter{
				{
					Column: "trace.parent_id",
					Op:     "does-not-exist",
				},
			},
			TimeRange: pulumi.Float64Ref(1800),
		}, nil)
		if err != nil {
			return err
		}
		_, err = honeycombio.NewTrigger(ctx, "exampleTrigger", &honeycombio.TriggerArgs{
			Description: pulumi.String("Average duration of all requests for the last 10 minutes."),
			QueryJson:   pulumi.String(exampleQuerySpecification.Json),
			Dataset:     pulumi.String(dataset),
			Frequency:   pulumi.Float64(600),
			AlertType:   pulumi.String("on_change"),
			Thresholds: honeycombio.TriggerThresholdArray{
				&honeycombio.TriggerThresholdArgs{
					Op:    pulumi.String(">"),
					Value: pulumi.Float64(1000),
				},
			},
			Recipients: honeycombio.TriggerRecipientArray{
				&honeycombio.TriggerRecipientArgs{
					Type:   pulumi.String("email"),
					Target: pulumi.String("hello@example.com"),
				},
				&honeycombio.TriggerRecipientArgs{
					Type:   pulumi.String("marker"),
					Target: pulumi.String("Trigger - requests are slow"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Honeycombio = Pulumi.Honeycombio;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var dataset = config.Require("dataset");
    var exampleQuerySpecification = Honeycombio.GetQuerySpecification.Invoke(new()
    {
        Calculations = new[]
        {
            new Honeycombio.Inputs.GetQuerySpecificationCalculationInputArgs
            {
                Op = "AVG",
                Column = "duration_ms",
            },
        },
        Filters = new[]
        {
            new Honeycombio.Inputs.GetQuerySpecificationFilterInputArgs
            {
                Column = "trace.parent_id",
                Op = "does-not-exist",
            },
        },
        TimeRange = 1800,
    });

    var exampleTrigger = new Honeycombio.Trigger("exampleTrigger", new()
    {
        Description = "Average duration of all requests for the last 10 minutes.",
        QueryJson = exampleQuerySpecification.Apply(getQuerySpecificationResult => getQuerySpecificationResult.Json),
        Dataset = dataset,
        Frequency = 600,
        AlertType = "on_change",
        Thresholds = new[]
        {
            new Honeycombio.Inputs.TriggerThresholdArgs
            {
                Op = ">",
                Value = 1000,
            },
        },
        Recipients = new[]
        {
            new Honeycombio.Inputs.TriggerRecipientArgs
            {
                Type = "email",
                Target = "hello@example.com",
            },
            new Honeycombio.Inputs.TriggerRecipientArgs
            {
                Type = "marker",
                Target = "Trigger - requests are slow",
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.honeycombio.HoneycombioFunctions;
import com.pulumi.honeycombio.inputs.GetQuerySpecificationArgs;
import com.pulumi.honeycombio.Trigger;
import com.pulumi.honeycombio.TriggerArgs;
import com.pulumi.honeycombio.inputs.TriggerThresholdArgs;
import com.pulumi.honeycombio.inputs.TriggerRecipientArgs;
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 config = ctx.config();
        final var dataset = config.get("dataset");
        final var exampleQuerySpecification = HoneycombioFunctions.getQuerySpecification(GetQuerySpecificationArgs.builder()
            .calculations(GetQuerySpecificationCalculationArgs.builder()
                .op("AVG")
                .column("duration_ms")
                .build())
            .filters(GetQuerySpecificationFilterArgs.builder()
                .column("trace.parent_id")
                .op("does-not-exist")
                .build())
            .timeRange(1800)
            .build());

        var exampleTrigger = new Trigger("exampleTrigger", TriggerArgs.builder()
            .description("Average duration of all requests for the last 10 minutes.")
            .queryJson(exampleQuerySpecification.applyValue(getQuerySpecificationResult -> getQuerySpecificationResult.json()))
            .dataset(dataset)
            .frequency(600)
            .alertType("on_change")
            .thresholds(TriggerThresholdArgs.builder()
                .op(">")
                .value(1000)
                .build())
            .recipients(            
                TriggerRecipientArgs.builder()
                    .type("email")
                    .target("hello@example.com")
                    .build(),
                TriggerRecipientArgs.builder()
                    .type("marker")
                    .target("Trigger - requests are slow")
                    .build())
            .build());

    }
}
Copy
configuration:
  dataset:
    type: string
resources:
  exampleTrigger:
    type: honeycombio:Trigger
    properties:
      description: Average duration of all requests for the last 10 minutes.
      queryJson: ${exampleQuerySpecification.json}
      dataset: ${dataset}
      frequency: 600 # in seconds, 10 minutes
      alertType: on_change # on_change is default, on_true can refers to the "Alert on True" checkbox in the UI
      thresholds:
        - op: '>'
          value: 1000
      # zero or more recipients
      recipients:
        - type: email
          target: hello@example.com
        - type: marker
          target: Trigger - requests are slow
variables:
  exampleQuerySpecification:
    fn::invoke:
      function: honeycombio:getQuerySpecification
      arguments:
        calculations:
          - op: AVG
            column: duration_ms
        filters:
          - column: trace.parent_id
            op: does-not-exist
        timeRange: 1800
Copy

Example with PagerDuty Recipient and Severity

import * as pulumi from "@pulumi/pulumi";
import * as honeycombio from "@pulumi/honeycombio";

const config = new pulumi.Config();
const dataset = config.require("dataset");
const pdProd = honeycombio.getRecipient({
    type: "pagerduty",
    detailFilter: {
        name: "integration_name",
        value: "Prod On-Call",
    },
});
const exampleQuerySpecification = honeycombio.getQuerySpecification({
    calculations: [{
        op: "AVG",
        column: "duration_ms",
    }],
    filters: [{
        column: "trace.parent_id",
        op: "does-not-exist",
    }],
});
const exampleTrigger = new honeycombio.Trigger("exampleTrigger", {
    description: "Average duration of all requests for the last 10 minutes.",
    queryJson: exampleQuerySpecification.then(exampleQuerySpecification => exampleQuerySpecification.json),
    dataset: dataset,
    frequency: 600,
    thresholds: [{
        op: ">",
        value: 1000,
        exceededLimit: 3,
    }],
    recipients: [{
        id: pdProd.then(pdProd => pdProd.id),
        notificationDetails: [{
            pagerdutySeverity: "warning",
        }],
    }],
    evaluationSchedules: [{
        startTime: "13:00",
        endTime: "21:00",
        daysOfWeeks: [
            "monday",
            "wednesday",
            "friday",
        ],
    }],
});
Copy
import pulumi
import pulumi_honeycombio as honeycombio

config = pulumi.Config()
dataset = config.require("dataset")
pd_prod = honeycombio.get_recipient(type="pagerduty",
    detail_filter={
        "name": "integration_name",
        "value": "Prod On-Call",
    })
example_query_specification = honeycombio.get_query_specification(calculations=[{
        "op": "AVG",
        "column": "duration_ms",
    }],
    filters=[{
        "column": "trace.parent_id",
        "op": "does-not-exist",
    }])
example_trigger = honeycombio.Trigger("exampleTrigger",
    description="Average duration of all requests for the last 10 minutes.",
    query_json=example_query_specification.json,
    dataset=dataset,
    frequency=600,
    thresholds=[{
        "op": ">",
        "value": 1000,
        "exceeded_limit": 3,
    }],
    recipients=[{
        "id": pd_prod.id,
        "notification_details": [{
            "pagerduty_severity": "warning",
        }],
    }],
    evaluation_schedules=[{
        "start_time": "13:00",
        "end_time": "21:00",
        "days_of_weeks": [
            "monday",
            "wednesday",
            "friday",
        ],
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/honeycombio/honeycombio"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		dataset := cfg.Require("dataset")
		pdProd, err := honeycombio.GetRecipient(ctx, &honeycombio.GetRecipientArgs{
			Type: "pagerduty",
			DetailFilter: honeycombio.GetRecipientDetailFilter{
				Name:  "integration_name",
				Value: pulumi.StringRef("Prod On-Call"),
			},
		}, nil)
		if err != nil {
			return err
		}
		exampleQuerySpecification, err := honeycombio.GetQuerySpecification(ctx, &honeycombio.GetQuerySpecificationArgs{
			Calculations: []honeycombio.GetQuerySpecificationCalculation{
				{
					Op:     "AVG",
					Column: pulumi.StringRef("duration_ms"),
				},
			},
			Filters: []honeycombio.GetQuerySpecificationFilter{
				{
					Column: "trace.parent_id",
					Op:     "does-not-exist",
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = honeycombio.NewTrigger(ctx, "exampleTrigger", &honeycombio.TriggerArgs{
			Description: pulumi.String("Average duration of all requests for the last 10 minutes."),
			QueryJson:   pulumi.String(exampleQuerySpecification.Json),
			Dataset:     pulumi.String(dataset),
			Frequency:   pulumi.Float64(600),
			Thresholds: honeycombio.TriggerThresholdArray{
				&honeycombio.TriggerThresholdArgs{
					Op:            pulumi.String(">"),
					Value:         pulumi.Float64(1000),
					ExceededLimit: pulumi.Float64(3),
				},
			},
			Recipients: honeycombio.TriggerRecipientArray{
				&honeycombio.TriggerRecipientArgs{
					Id: pulumi.String(pdProd.Id),
					NotificationDetails: honeycombio.TriggerRecipientNotificationDetailArray{
						&honeycombio.TriggerRecipientNotificationDetailArgs{
							PagerdutySeverity: pulumi.String("warning"),
						},
					},
				},
			},
			EvaluationSchedules: honeycombio.TriggerEvaluationScheduleArray{
				&honeycombio.TriggerEvaluationScheduleArgs{
					StartTime: pulumi.String("13:00"),
					EndTime:   pulumi.String("21:00"),
					DaysOfWeeks: pulumi.StringArray{
						pulumi.String("monday"),
						pulumi.String("wednesday"),
						pulumi.String("friday"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Honeycombio = Pulumi.Honeycombio;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var dataset = config.Require("dataset");
    var pdProd = Honeycombio.GetRecipient.Invoke(new()
    {
        Type = "pagerduty",
        DetailFilter = new Honeycombio.Inputs.GetRecipientDetailFilterInputArgs
        {
            Name = "integration_name",
            Value = "Prod On-Call",
        },
    });

    var exampleQuerySpecification = Honeycombio.GetQuerySpecification.Invoke(new()
    {
        Calculations = new[]
        {
            new Honeycombio.Inputs.GetQuerySpecificationCalculationInputArgs
            {
                Op = "AVG",
                Column = "duration_ms",
            },
        },
        Filters = new[]
        {
            new Honeycombio.Inputs.GetQuerySpecificationFilterInputArgs
            {
                Column = "trace.parent_id",
                Op = "does-not-exist",
            },
        },
    });

    var exampleTrigger = new Honeycombio.Trigger("exampleTrigger", new()
    {
        Description = "Average duration of all requests for the last 10 minutes.",
        QueryJson = exampleQuerySpecification.Apply(getQuerySpecificationResult => getQuerySpecificationResult.Json),
        Dataset = dataset,
        Frequency = 600,
        Thresholds = new[]
        {
            new Honeycombio.Inputs.TriggerThresholdArgs
            {
                Op = ">",
                Value = 1000,
                ExceededLimit = 3,
            },
        },
        Recipients = new[]
        {
            new Honeycombio.Inputs.TriggerRecipientArgs
            {
                Id = pdProd.Apply(getRecipientResult => getRecipientResult.Id),
                NotificationDetails = new[]
                {
                    new Honeycombio.Inputs.TriggerRecipientNotificationDetailArgs
                    {
                        PagerdutySeverity = "warning",
                    },
                },
            },
        },
        EvaluationSchedules = new[]
        {
            new Honeycombio.Inputs.TriggerEvaluationScheduleArgs
            {
                StartTime = "13:00",
                EndTime = "21:00",
                DaysOfWeeks = new[]
                {
                    "monday",
                    "wednesday",
                    "friday",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.honeycombio.HoneycombioFunctions;
import com.pulumi.honeycombio.inputs.GetRecipientArgs;
import com.pulumi.honeycombio.inputs.GetRecipientDetailFilterArgs;
import com.pulumi.honeycombio.inputs.GetQuerySpecificationArgs;
import com.pulumi.honeycombio.Trigger;
import com.pulumi.honeycombio.TriggerArgs;
import com.pulumi.honeycombio.inputs.TriggerThresholdArgs;
import com.pulumi.honeycombio.inputs.TriggerRecipientArgs;
import com.pulumi.honeycombio.inputs.TriggerEvaluationScheduleArgs;
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 config = ctx.config();
        final var dataset = config.get("dataset");
        final var pdProd = HoneycombioFunctions.getRecipient(GetRecipientArgs.builder()
            .type("pagerduty")
            .detailFilter(GetRecipientDetailFilterArgs.builder()
                .name("integration_name")
                .value("Prod On-Call")
                .build())
            .build());

        final var exampleQuerySpecification = HoneycombioFunctions.getQuerySpecification(GetQuerySpecificationArgs.builder()
            .calculations(GetQuerySpecificationCalculationArgs.builder()
                .op("AVG")
                .column("duration_ms")
                .build())
            .filters(GetQuerySpecificationFilterArgs.builder()
                .column("trace.parent_id")
                .op("does-not-exist")
                .build())
            .build());

        var exampleTrigger = new Trigger("exampleTrigger", TriggerArgs.builder()
            .description("Average duration of all requests for the last 10 minutes.")
            .queryJson(exampleQuerySpecification.applyValue(getQuerySpecificationResult -> getQuerySpecificationResult.json()))
            .dataset(dataset)
            .frequency(600)
            .thresholds(TriggerThresholdArgs.builder()
                .op(">")
                .value(1000)
                .exceededLimit(3)
                .build())
            .recipients(TriggerRecipientArgs.builder()
                .id(pdProd.applyValue(getRecipientResult -> getRecipientResult.id()))
                .notificationDetails(TriggerRecipientNotificationDetailArgs.builder()
                    .pagerdutySeverity("warning")
                    .build())
                .build())
            .evaluationSchedules(TriggerEvaluationScheduleArgs.builder()
                .startTime("13:00")
                .endTime("21:00")
                .daysOfWeeks(                
                    "monday",
                    "wednesday",
                    "friday")
                .build())
            .build());

    }
}
Copy
configuration:
  dataset:
    type: string
resources:
  exampleTrigger:
    type: honeycombio:Trigger
    properties:
      description: Average duration of all requests for the last 10 minutes.
      queryJson: ${exampleQuerySpecification.json}
      dataset: ${dataset}
      frequency: 600 # in seconds, 10 minutes
      thresholds:
        - op: '>'
          value: 1000
          exceededLimit: 3
      recipients:
        - id: ${pdProd.id}
          notificationDetails:
            - pagerdutySeverity: warning
      evaluationSchedules:
        - startTime: 13:00
          endTime: 21:00
          daysOfWeeks:
            - monday
            - wednesday
            - friday
variables:
  pdProd:
    fn::invoke:
      function: honeycombio:getRecipient
      arguments:
        type: pagerduty
        detailFilter:
          name: integration_name
          value: Prod On-Call
  exampleQuerySpecification:
    fn::invoke:
      function: honeycombio:getQuerySpecification
      arguments:
        calculations:
          - op: AVG
            column: duration_ms
        filters:
          - column: trace.parent_id
            op: does-not-exist
Copy

Example - Example with Webhook Recipient and Notification Variable

import * as pulumi from "@pulumi/pulumi";
import * as honeycombio from "@pulumi/honeycombio";

const config = new pulumi.Config();
const dataset = config.require("dataset");
const customWebhook = honeycombio.getRecipient({
    type: "webhook",
    detailFilter: {
        name: "name",
        value: "My Custom Webhook",
    },
});
const exampleQuerySpecification = honeycombio.getQuerySpecification({
    calculations: [{
        op: "AVG",
        column: "duration_ms",
    }],
    filters: [{
        column: "trace.parent_id",
        op: "does-not-exist",
    }],
});
const exampleTrigger = new honeycombio.Trigger("exampleTrigger", {
    description: "Average duration of all requests for the last 10 minutes.",
    queryJson: exampleQuerySpecification.then(exampleQuerySpecification => exampleQuerySpecification.json),
    dataset: dataset,
    frequency: 600,
    thresholds: [{
        op: ">",
        value: 1000,
        exceededLimit: 3,
    }],
    recipients: [{
        id: customWebhook.then(customWebhook => customWebhook.id),
        notificationDetails: [{
            variables: [{
                name: "severity",
                value: "info",
            }],
        }],
    }],
    evaluationSchedules: [{
        startTime: "13:00",
        endTime: "21:00",
        daysOfWeeks: [
            "monday",
            "wednesday",
            "friday",
        ],
    }],
});
Copy
import pulumi
import pulumi_honeycombio as honeycombio

config = pulumi.Config()
dataset = config.require("dataset")
custom_webhook = honeycombio.get_recipient(type="webhook",
    detail_filter={
        "name": "name",
        "value": "My Custom Webhook",
    })
example_query_specification = honeycombio.get_query_specification(calculations=[{
        "op": "AVG",
        "column": "duration_ms",
    }],
    filters=[{
        "column": "trace.parent_id",
        "op": "does-not-exist",
    }])
example_trigger = honeycombio.Trigger("exampleTrigger",
    description="Average duration of all requests for the last 10 minutes.",
    query_json=example_query_specification.json,
    dataset=dataset,
    frequency=600,
    thresholds=[{
        "op": ">",
        "value": 1000,
        "exceeded_limit": 3,
    }],
    recipients=[{
        "id": custom_webhook.id,
        "notification_details": [{
            "variables": [{
                "name": "severity",
                "value": "info",
            }],
        }],
    }],
    evaluation_schedules=[{
        "start_time": "13:00",
        "end_time": "21:00",
        "days_of_weeks": [
            "monday",
            "wednesday",
            "friday",
        ],
    }])
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/honeycombio/honeycombio"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		dataset := cfg.Require("dataset")
		customWebhook, err := honeycombio.GetRecipient(ctx, &honeycombio.GetRecipientArgs{
			Type: "webhook",
			DetailFilter: honeycombio.GetRecipientDetailFilter{
				Name:  "name",
				Value: pulumi.StringRef("My Custom Webhook"),
			},
		}, nil)
		if err != nil {
			return err
		}
		exampleQuerySpecification, err := honeycombio.GetQuerySpecification(ctx, &honeycombio.GetQuerySpecificationArgs{
			Calculations: []honeycombio.GetQuerySpecificationCalculation{
				{
					Op:     "AVG",
					Column: pulumi.StringRef("duration_ms"),
				},
			},
			Filters: []honeycombio.GetQuerySpecificationFilter{
				{
					Column: "trace.parent_id",
					Op:     "does-not-exist",
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = honeycombio.NewTrigger(ctx, "exampleTrigger", &honeycombio.TriggerArgs{
			Description: pulumi.String("Average duration of all requests for the last 10 minutes."),
			QueryJson:   pulumi.String(exampleQuerySpecification.Json),
			Dataset:     pulumi.String(dataset),
			Frequency:   pulumi.Float64(600),
			Thresholds: honeycombio.TriggerThresholdArray{
				&honeycombio.TriggerThresholdArgs{
					Op:            pulumi.String(">"),
					Value:         pulumi.Float64(1000),
					ExceededLimit: pulumi.Float64(3),
				},
			},
			Recipients: honeycombio.TriggerRecipientArray{
				&honeycombio.TriggerRecipientArgs{
					Id: pulumi.String(customWebhook.Id),
					NotificationDetails: honeycombio.TriggerRecipientNotificationDetailArray{
						&honeycombio.TriggerRecipientNotificationDetailArgs{
							Variables: honeycombio.TriggerRecipientNotificationDetailVariableArray{
								&honeycombio.TriggerRecipientNotificationDetailVariableArgs{
									Name:  pulumi.String("severity"),
									Value: pulumi.String("info"),
								},
							},
						},
					},
				},
			},
			EvaluationSchedules: honeycombio.TriggerEvaluationScheduleArray{
				&honeycombio.TriggerEvaluationScheduleArgs{
					StartTime: pulumi.String("13:00"),
					EndTime:   pulumi.String("21:00"),
					DaysOfWeeks: pulumi.StringArray{
						pulumi.String("monday"),
						pulumi.String("wednesday"),
						pulumi.String("friday"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Honeycombio = Pulumi.Honeycombio;

return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var dataset = config.Require("dataset");
    var customWebhook = Honeycombio.GetRecipient.Invoke(new()
    {
        Type = "webhook",
        DetailFilter = new Honeycombio.Inputs.GetRecipientDetailFilterInputArgs
        {
            Name = "name",
            Value = "My Custom Webhook",
        },
    });

    var exampleQuerySpecification = Honeycombio.GetQuerySpecification.Invoke(new()
    {
        Calculations = new[]
        {
            new Honeycombio.Inputs.GetQuerySpecificationCalculationInputArgs
            {
                Op = "AVG",
                Column = "duration_ms",
            },
        },
        Filters = new[]
        {
            new Honeycombio.Inputs.GetQuerySpecificationFilterInputArgs
            {
                Column = "trace.parent_id",
                Op = "does-not-exist",
            },
        },
    });

    var exampleTrigger = new Honeycombio.Trigger("exampleTrigger", new()
    {
        Description = "Average duration of all requests for the last 10 minutes.",
        QueryJson = exampleQuerySpecification.Apply(getQuerySpecificationResult => getQuerySpecificationResult.Json),
        Dataset = dataset,
        Frequency = 600,
        Thresholds = new[]
        {
            new Honeycombio.Inputs.TriggerThresholdArgs
            {
                Op = ">",
                Value = 1000,
                ExceededLimit = 3,
            },
        },
        Recipients = new[]
        {
            new Honeycombio.Inputs.TriggerRecipientArgs
            {
                Id = customWebhook.Apply(getRecipientResult => getRecipientResult.Id),
                NotificationDetails = new[]
                {
                    new Honeycombio.Inputs.TriggerRecipientNotificationDetailArgs
                    {
                        Variables = new[]
                        {
                            new Honeycombio.Inputs.TriggerRecipientNotificationDetailVariableArgs
                            {
                                Name = "severity",
                                Value = "info",
                            },
                        },
                    },
                },
            },
        },
        EvaluationSchedules = new[]
        {
            new Honeycombio.Inputs.TriggerEvaluationScheduleArgs
            {
                StartTime = "13:00",
                EndTime = "21:00",
                DaysOfWeeks = new[]
                {
                    "monday",
                    "wednesday",
                    "friday",
                },
            },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.honeycombio.HoneycombioFunctions;
import com.pulumi.honeycombio.inputs.GetRecipientArgs;
import com.pulumi.honeycombio.inputs.GetRecipientDetailFilterArgs;
import com.pulumi.honeycombio.inputs.GetQuerySpecificationArgs;
import com.pulumi.honeycombio.Trigger;
import com.pulumi.honeycombio.TriggerArgs;
import com.pulumi.honeycombio.inputs.TriggerThresholdArgs;
import com.pulumi.honeycombio.inputs.TriggerRecipientArgs;
import com.pulumi.honeycombio.inputs.TriggerEvaluationScheduleArgs;
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 config = ctx.config();
        final var dataset = config.get("dataset");
        final var customWebhook = HoneycombioFunctions.getRecipient(GetRecipientArgs.builder()
            .type("webhook")
            .detailFilter(GetRecipientDetailFilterArgs.builder()
                .name("name")
                .value("My Custom Webhook")
                .build())
            .build());

        final var exampleQuerySpecification = HoneycombioFunctions.getQuerySpecification(GetQuerySpecificationArgs.builder()
            .calculations(GetQuerySpecificationCalculationArgs.builder()
                .op("AVG")
                .column("duration_ms")
                .build())
            .filters(GetQuerySpecificationFilterArgs.builder()
                .column("trace.parent_id")
                .op("does-not-exist")
                .build())
            .build());

        var exampleTrigger = new Trigger("exampleTrigger", TriggerArgs.builder()
            .description("Average duration of all requests for the last 10 minutes.")
            .queryJson(exampleQuerySpecification.applyValue(getQuerySpecificationResult -> getQuerySpecificationResult.json()))
            .dataset(dataset)
            .frequency(600)
            .thresholds(TriggerThresholdArgs.builder()
                .op(">")
                .value(1000)
                .exceededLimit(3)
                .build())
            .recipients(TriggerRecipientArgs.builder()
                .id(customWebhook.applyValue(getRecipientResult -> getRecipientResult.id()))
                .notificationDetails(TriggerRecipientNotificationDetailArgs.builder()
                    .variables(TriggerRecipientNotificationDetailVariableArgs.builder()
                        .name("severity")
                        .value("info")
                        .build())
                    .build())
                .build())
            .evaluationSchedules(TriggerEvaluationScheduleArgs.builder()
                .startTime("13:00")
                .endTime("21:00")
                .daysOfWeeks(                
                    "monday",
                    "wednesday",
                    "friday")
                .build())
            .build());

    }
}
Copy
configuration:
  dataset:
    type: string
resources:
  exampleTrigger:
    type: honeycombio:Trigger
    properties:
      description: Average duration of all requests for the last 10 minutes.
      queryJson: ${exampleQuerySpecification.json}
      dataset: ${dataset}
      frequency: 600 # in seconds, 10 minutes
      thresholds:
        - op: '>'
          value: 1000
          exceededLimit: 3
      recipients:
        - id: ${customWebhook.id}
          notificationDetails:
            - variables:
                - name: severity
                  value: info
      evaluationSchedules:
        - startTime: 13:00
          endTime: 21:00
          daysOfWeeks:
            - monday
            - wednesday
            - friday
variables:
  customWebhook:
    fn::invoke:
      function: honeycombio:getRecipient
      arguments:
        type: webhook
        detailFilter:
          name: name
          value: My Custom Webhook
  exampleQuerySpecification:
    fn::invoke:
      function: honeycombio:getQuerySpecification
      arguments:
        calculations:
          - op: AVG
            column: duration_ms
        filters:
          - column: trace.parent_id
            op: does-not-exist
Copy

Create Trigger Resource

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

Constructor syntax

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

@overload
def Trigger(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            dataset: Optional[str] = None,
            alert_type: Optional[str] = None,
            description: Optional[str] = None,
            disabled: Optional[bool] = None,
            evaluation_schedules: Optional[Sequence[TriggerEvaluationScheduleArgs]] = None,
            frequency: Optional[float] = None,
            name: Optional[str] = None,
            query_id: Optional[str] = None,
            query_json: Optional[str] = None,
            recipients: Optional[Sequence[TriggerRecipientArgs]] = None,
            thresholds: Optional[Sequence[TriggerThresholdArgs]] = None)
func NewTrigger(ctx *Context, name string, args TriggerArgs, opts ...ResourceOption) (*Trigger, error)
public Trigger(string name, TriggerArgs args, CustomResourceOptions? opts = null)
public Trigger(String name, TriggerArgs args)
public Trigger(String name, TriggerArgs args, CustomResourceOptions options)
type: honeycombio:Trigger
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. TriggerArgs
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. TriggerArgs
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. TriggerArgs
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. TriggerArgs
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. TriggerArgs
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 triggerResource = new Honeycombio.Trigger("triggerResource", new()
{
    Dataset = "string",
    AlertType = "string",
    Description = "string",
    Disabled = false,
    EvaluationSchedules = new[]
    {
        new Honeycombio.Inputs.TriggerEvaluationScheduleArgs
        {
            DaysOfWeeks = new[]
            {
                "string",
            },
            EndTime = "string",
            StartTime = "string",
        },
    },
    Frequency = 0,
    Name = "string",
    QueryId = "string",
    QueryJson = "string",
    Recipients = new[]
    {
        new Honeycombio.Inputs.TriggerRecipientArgs
        {
            Id = "string",
            NotificationDetails = new[]
            {
                new Honeycombio.Inputs.TriggerRecipientNotificationDetailArgs
                {
                    PagerdutySeverity = "string",
                    Variables = new[]
                    {
                        new Honeycombio.Inputs.TriggerRecipientNotificationDetailVariableArgs
                        {
                            Name = "string",
                            Value = "string",
                        },
                    },
                },
            },
            Target = "string",
            Type = "string",
        },
    },
    Thresholds = new[]
    {
        new Honeycombio.Inputs.TriggerThresholdArgs
        {
            Op = "string",
            Value = 0,
            ExceededLimit = 0,
        },
    },
});
Copy
example, err := honeycombio.NewTrigger(ctx, "triggerResource", &honeycombio.TriggerArgs{
Dataset: pulumi.String("string"),
AlertType: pulumi.String("string"),
Description: pulumi.String("string"),
Disabled: pulumi.Bool(false),
EvaluationSchedules: .TriggerEvaluationScheduleArray{
&.TriggerEvaluationScheduleArgs{
DaysOfWeeks: pulumi.StringArray{
pulumi.String("string"),
},
EndTime: pulumi.String("string"),
StartTime: pulumi.String("string"),
},
},
Frequency: pulumi.Float64(0),
Name: pulumi.String("string"),
QueryId: pulumi.String("string"),
QueryJson: pulumi.String("string"),
Recipients: .TriggerRecipientArray{
&.TriggerRecipientArgs{
Id: pulumi.String("string"),
NotificationDetails: .TriggerRecipientNotificationDetailArray{
&.TriggerRecipientNotificationDetailArgs{
PagerdutySeverity: pulumi.String("string"),
Variables: .TriggerRecipientNotificationDetailVariableArray{
&.TriggerRecipientNotificationDetailVariableArgs{
Name: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
},
},
Target: pulumi.String("string"),
Type: pulumi.String("string"),
},
},
Thresholds: .TriggerThresholdArray{
&.TriggerThresholdArgs{
Op: pulumi.String("string"),
Value: pulumi.Float64(0),
ExceededLimit: pulumi.Float64(0),
},
},
})
Copy
var triggerResource = new Trigger("triggerResource", TriggerArgs.builder()
    .dataset("string")
    .alertType("string")
    .description("string")
    .disabled(false)
    .evaluationSchedules(TriggerEvaluationScheduleArgs.builder()
        .daysOfWeeks("string")
        .endTime("string")
        .startTime("string")
        .build())
    .frequency(0)
    .name("string")
    .queryId("string")
    .queryJson("string")
    .recipients(TriggerRecipientArgs.builder()
        .id("string")
        .notificationDetails(TriggerRecipientNotificationDetailArgs.builder()
            .pagerdutySeverity("string")
            .variables(TriggerRecipientNotificationDetailVariableArgs.builder()
                .name("string")
                .value("string")
                .build())
            .build())
        .target("string")
        .type("string")
        .build())
    .thresholds(TriggerThresholdArgs.builder()
        .op("string")
        .value(0)
        .exceededLimit(0)
        .build())
    .build());
Copy
trigger_resource = honeycombio.Trigger("triggerResource",
    dataset="string",
    alert_type="string",
    description="string",
    disabled=False,
    evaluation_schedules=[{
        "days_of_weeks": ["string"],
        "end_time": "string",
        "start_time": "string",
    }],
    frequency=0,
    name="string",
    query_id="string",
    query_json="string",
    recipients=[{
        "id": "string",
        "notification_details": [{
            "pagerduty_severity": "string",
            "variables": [{
                "name": "string",
                "value": "string",
            }],
        }],
        "target": "string",
        "type": "string",
    }],
    thresholds=[{
        "op": "string",
        "value": 0,
        "exceeded_limit": 0,
    }])
Copy
const triggerResource = new honeycombio.Trigger("triggerResource", {
    dataset: "string",
    alertType: "string",
    description: "string",
    disabled: false,
    evaluationSchedules: [{
        daysOfWeeks: ["string"],
        endTime: "string",
        startTime: "string",
    }],
    frequency: 0,
    name: "string",
    queryId: "string",
    queryJson: "string",
    recipients: [{
        id: "string",
        notificationDetails: [{
            pagerdutySeverity: "string",
            variables: [{
                name: "string",
                value: "string",
            }],
        }],
        target: "string",
        type: "string",
    }],
    thresholds: [{
        op: "string",
        value: 0,
        exceededLimit: 0,
    }],
});
Copy
type: honeycombio:Trigger
properties:
    alertType: string
    dataset: string
    description: string
    disabled: false
    evaluationSchedules:
        - daysOfWeeks:
            - string
          endTime: string
          startTime: string
    frequency: 0
    name: string
    queryId: string
    queryJson: string
    recipients:
        - id: string
          notificationDetails:
            - pagerdutySeverity: string
              variables:
                - name: string
                  value: string
          target: string
          type: string
    thresholds:
        - exceededLimit: 0
          op: string
          value: 0
Copy

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

Dataset This property is required. string
The dataset this trigger is associated with.
AlertType string
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
Description string
Description of the trigger.
Disabled bool
The state of the trigger. If true, the trigger will not be run. Defaults to false.
EvaluationSchedules List<TriggerEvaluationSchedule>
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
Frequency double
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
Name string
Name of the trigger.
QueryId string
The ID of the Query that the Trigger will execute. Conflicts with query_json.
QueryJson string
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
Recipients List<TriggerRecipient>

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

Thresholds List<TriggerThreshold>
A configuration block (described below) describing the threshold of the trigger.
Dataset This property is required. string
The dataset this trigger is associated with.
AlertType string
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
Description string
Description of the trigger.
Disabled bool
The state of the trigger. If true, the trigger will not be run. Defaults to false.
EvaluationSchedules []TriggerEvaluationScheduleArgs
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
Frequency float64
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
Name string
Name of the trigger.
QueryId string
The ID of the Query that the Trigger will execute. Conflicts with query_json.
QueryJson string
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
Recipients []TriggerRecipientArgs

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

Thresholds []TriggerThresholdArgs
A configuration block (described below) describing the threshold of the trigger.
dataset This property is required. String
The dataset this trigger is associated with.
alertType String
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
description String
Description of the trigger.
disabled Boolean
The state of the trigger. If true, the trigger will not be run. Defaults to false.
evaluationSchedules List<TriggerEvaluationSchedule>
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
frequency Double
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
name String
Name of the trigger.
queryId String
The ID of the Query that the Trigger will execute. Conflicts with query_json.
queryJson String
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
recipients List<TriggerRecipient>

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

thresholds List<TriggerThreshold>
A configuration block (described below) describing the threshold of the trigger.
dataset This property is required. string
The dataset this trigger is associated with.
alertType string
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
description string
Description of the trigger.
disabled boolean
The state of the trigger. If true, the trigger will not be run. Defaults to false.
evaluationSchedules TriggerEvaluationSchedule[]
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
frequency number
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
name string
Name of the trigger.
queryId string
The ID of the Query that the Trigger will execute. Conflicts with query_json.
queryJson string
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
recipients TriggerRecipient[]

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

thresholds TriggerThreshold[]
A configuration block (described below) describing the threshold of the trigger.
dataset This property is required. str
The dataset this trigger is associated with.
alert_type str
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
description str
Description of the trigger.
disabled bool
The state of the trigger. If true, the trigger will not be run. Defaults to false.
evaluation_schedules Sequence[TriggerEvaluationScheduleArgs]
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
frequency float
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
name str
Name of the trigger.
query_id str
The ID of the Query that the Trigger will execute. Conflicts with query_json.
query_json str
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
recipients Sequence[TriggerRecipientArgs]

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

thresholds Sequence[TriggerThresholdArgs]
A configuration block (described below) describing the threshold of the trigger.
dataset This property is required. String
The dataset this trigger is associated with.
alertType String
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
description String
Description of the trigger.
disabled Boolean
The state of the trigger. If true, the trigger will not be run. Defaults to false.
evaluationSchedules List<Property Map>
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
frequency Number
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
name String
Name of the trigger.
queryId String
The ID of the Query that the Trigger will execute. Conflicts with query_json.
queryJson String
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
recipients List<Property Map>

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

thresholds List<Property Map>
A configuration block (described below) describing the threshold of the trigger.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing Trigger Resource

Get an existing Trigger 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?: TriggerState, opts?: CustomResourceOptions): Trigger
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        alert_type: Optional[str] = None,
        dataset: Optional[str] = None,
        description: Optional[str] = None,
        disabled: Optional[bool] = None,
        evaluation_schedules: Optional[Sequence[TriggerEvaluationScheduleArgs]] = None,
        frequency: Optional[float] = None,
        name: Optional[str] = None,
        query_id: Optional[str] = None,
        query_json: Optional[str] = None,
        recipients: Optional[Sequence[TriggerRecipientArgs]] = None,
        thresholds: Optional[Sequence[TriggerThresholdArgs]] = None) -> Trigger
func GetTrigger(ctx *Context, name string, id IDInput, state *TriggerState, opts ...ResourceOption) (*Trigger, error)
public static Trigger Get(string name, Input<string> id, TriggerState? state, CustomResourceOptions? opts = null)
public static Trigger get(String name, Output<String> id, TriggerState state, CustomResourceOptions options)
resources:  _:    type: honeycombio:Trigger    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:
AlertType string
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
Dataset string
The dataset this trigger is associated with.
Description string
Description of the trigger.
Disabled bool
The state of the trigger. If true, the trigger will not be run. Defaults to false.
EvaluationSchedules List<TriggerEvaluationSchedule>
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
Frequency double
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
Name string
Name of the trigger.
QueryId string
The ID of the Query that the Trigger will execute. Conflicts with query_json.
QueryJson string
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
Recipients List<TriggerRecipient>

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

Thresholds List<TriggerThreshold>
A configuration block (described below) describing the threshold of the trigger.
AlertType string
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
Dataset string
The dataset this trigger is associated with.
Description string
Description of the trigger.
Disabled bool
The state of the trigger. If true, the trigger will not be run. Defaults to false.
EvaluationSchedules []TriggerEvaluationScheduleArgs
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
Frequency float64
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
Name string
Name of the trigger.
QueryId string
The ID of the Query that the Trigger will execute. Conflicts with query_json.
QueryJson string
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
Recipients []TriggerRecipientArgs

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

Thresholds []TriggerThresholdArgs
A configuration block (described below) describing the threshold of the trigger.
alertType String
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
dataset String
The dataset this trigger is associated with.
description String
Description of the trigger.
disabled Boolean
The state of the trigger. If true, the trigger will not be run. Defaults to false.
evaluationSchedules List<TriggerEvaluationSchedule>
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
frequency Double
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
name String
Name of the trigger.
queryId String
The ID of the Query that the Trigger will execute. Conflicts with query_json.
queryJson String
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
recipients List<TriggerRecipient>

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

thresholds List<TriggerThreshold>
A configuration block (described below) describing the threshold of the trigger.
alertType string
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
dataset string
The dataset this trigger is associated with.
description string
Description of the trigger.
disabled boolean
The state of the trigger. If true, the trigger will not be run. Defaults to false.
evaluationSchedules TriggerEvaluationSchedule[]
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
frequency number
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
name string
Name of the trigger.
queryId string
The ID of the Query that the Trigger will execute. Conflicts with query_json.
queryJson string
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
recipients TriggerRecipient[]

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

thresholds TriggerThreshold[]
A configuration block (described below) describing the threshold of the trigger.
alert_type str
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
dataset str
The dataset this trigger is associated with.
description str
Description of the trigger.
disabled bool
The state of the trigger. If true, the trigger will not be run. Defaults to false.
evaluation_schedules Sequence[TriggerEvaluationScheduleArgs]
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
frequency float
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
name str
Name of the trigger.
query_id str
The ID of the Query that the Trigger will execute. Conflicts with query_json.
query_json str
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
recipients Sequence[TriggerRecipientArgs]

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

thresholds Sequence[TriggerThresholdArgs]
A configuration block (described below) describing the threshold of the trigger.
alertType String
The frequency for the alert to trigger. (on_change is the default behavior, on_true can also be selected)
dataset String
The dataset this trigger is associated with.
description String
Description of the trigger.
disabled Boolean
The state of the trigger. If true, the trigger will not be run. Defaults to false.
evaluationSchedules List<Property Map>
A configuration block (described below) that determines when the trigger is run. When the time is within the scheduled window the trigger will be run at the specified frequency. Outside of the window, the trigger will not be run. If no schedule is specified, the trigger will be run at the specified frequency at all times.
frequency Number
The interval (in seconds) in which to check the results of the query’s calculation against the threshold. This value must be divisible by 60, between 60 and 86400 (between 1 minute and 1 day), and not be more than 4 times the query's duration (see note below). Defaults to 900 (15 minutes).
name String
Name of the trigger.
queryId String
The ID of the Query that the Trigger will execute. Conflicts with query_json.
queryJson String
The Query Specfication JSON for the Trigger to execute. Providing the Query Specification as JSON -- as opposed to a Query ID -- enables additional validation during the validate and plan stages. Conflicts with query_id.
recipients List<Property Map>

Zero or more configuration blocks (described below) with the recipients to notify when the trigger fires.

One of query_id or query_json are required.

NOTE The query used in a Trigger must follow a strict subset: the query must contain exactly one calcuation and may only contain calculation, filter, filter_combination and breakdowns fields. The query's duration cannot be more than four times the trigger frequency (i.e. duration <= frequency*4). See A Caveat on Time) for more information on specifying a query's duration. For example: if using the default query time_range of 7200 the lowest frequency for a trigger is 1800.

thresholds List<Property Map>
A configuration block (described below) describing the threshold of the trigger.

Supporting Types

TriggerEvaluationSchedule
, TriggerEvaluationScheduleArgs

DaysOfWeeks This property is required. List<string>
A list of days of the week (in lowercase) to evaluate the trigger on
EndTime This property is required. string
UTC time to stop evaluating the trigger in HH:mm format (e.g. 13:00)
StartTime This property is required. string
UTC time to start evaluating the trigger in HH:mm format (e.g. 13:00)
DaysOfWeeks This property is required. []string
A list of days of the week (in lowercase) to evaluate the trigger on
EndTime This property is required. string
UTC time to stop evaluating the trigger in HH:mm format (e.g. 13:00)
StartTime This property is required. string
UTC time to start evaluating the trigger in HH:mm format (e.g. 13:00)
daysOfWeeks This property is required. List<String>
A list of days of the week (in lowercase) to evaluate the trigger on
endTime This property is required. String
UTC time to stop evaluating the trigger in HH:mm format (e.g. 13:00)
startTime This property is required. String
UTC time to start evaluating the trigger in HH:mm format (e.g. 13:00)
daysOfWeeks This property is required. string[]
A list of days of the week (in lowercase) to evaluate the trigger on
endTime This property is required. string
UTC time to stop evaluating the trigger in HH:mm format (e.g. 13:00)
startTime This property is required. string
UTC time to start evaluating the trigger in HH:mm format (e.g. 13:00)
days_of_weeks This property is required. Sequence[str]
A list of days of the week (in lowercase) to evaluate the trigger on
end_time This property is required. str
UTC time to stop evaluating the trigger in HH:mm format (e.g. 13:00)
start_time This property is required. str
UTC time to start evaluating the trigger in HH:mm format (e.g. 13:00)
daysOfWeeks This property is required. List<String>
A list of days of the week (in lowercase) to evaluate the trigger on
endTime This property is required. String
UTC time to stop evaluating the trigger in HH:mm format (e.g. 13:00)
startTime This property is required. String
UTC time to start evaluating the trigger in HH:mm format (e.g. 13:00)

TriggerRecipient
, TriggerRecipientArgs

Id string
The ID of an already existing recipient. Cannot not be used in combination with type and target.
NotificationDetails List<TriggerRecipientNotificationDetail>
a block of additional details to send along with the notification.
Target string
Target of the trigger recipient, this has another meaning depending on the type of recipient (see the table below). Cannot not be used in combination with id.
Type string
The type of the trigger recipient, allowed types are email, marker, msteams, pagerduty, slack and webhook. Cannot not be used in combination with id.
Id string
The ID of an already existing recipient. Cannot not be used in combination with type and target.
NotificationDetails []TriggerRecipientNotificationDetail
a block of additional details to send along with the notification.
Target string
Target of the trigger recipient, this has another meaning depending on the type of recipient (see the table below). Cannot not be used in combination with id.
Type string
The type of the trigger recipient, allowed types are email, marker, msteams, pagerduty, slack and webhook. Cannot not be used in combination with id.
id String
The ID of an already existing recipient. Cannot not be used in combination with type and target.
notificationDetails List<TriggerRecipientNotificationDetail>
a block of additional details to send along with the notification.
target String
Target of the trigger recipient, this has another meaning depending on the type of recipient (see the table below). Cannot not be used in combination with id.
type String
The type of the trigger recipient, allowed types are email, marker, msteams, pagerduty, slack and webhook. Cannot not be used in combination with id.
id string
The ID of an already existing recipient. Cannot not be used in combination with type and target.
notificationDetails TriggerRecipientNotificationDetail[]
a block of additional details to send along with the notification.
target string
Target of the trigger recipient, this has another meaning depending on the type of recipient (see the table below). Cannot not be used in combination with id.
type string
The type of the trigger recipient, allowed types are email, marker, msteams, pagerduty, slack and webhook. Cannot not be used in combination with id.
id str
The ID of an already existing recipient. Cannot not be used in combination with type and target.
notification_details Sequence[TriggerRecipientNotificationDetail]
a block of additional details to send along with the notification.
target str
Target of the trigger recipient, this has another meaning depending on the type of recipient (see the table below). Cannot not be used in combination with id.
type str
The type of the trigger recipient, allowed types are email, marker, msteams, pagerduty, slack and webhook. Cannot not be used in combination with id.
id String
The ID of an already existing recipient. Cannot not be used in combination with type and target.
notificationDetails List<Property Map>
a block of additional details to send along with the notification.
target String
Target of the trigger recipient, this has another meaning depending on the type of recipient (see the table below). Cannot not be used in combination with id.
type String
The type of the trigger recipient, allowed types are email, marker, msteams, pagerduty, slack and webhook. Cannot not be used in combination with id.

TriggerRecipientNotificationDetail
, TriggerRecipientNotificationDetailArgs

PagerdutySeverity string
Indicates the severity of an alert and has a default value of critical but can be set to one of info, warning, error, or critical and must be used in combination with a PagerDuty recipient.
Variables List<TriggerRecipientNotificationDetailVariable>

Up to 10 configuration blocks with a name and a value to override the default variable value. Must be used in combination with a Webhook recipient that already has a variable with the same name configured.

Type | Target ----------|------------------------- email | an email address marker | name of the marker pagerduty | N/A slack | name of the channel webhook | name of the webhook

PagerdutySeverity string
Indicates the severity of an alert and has a default value of critical but can be set to one of info, warning, error, or critical and must be used in combination with a PagerDuty recipient.
Variables []TriggerRecipientNotificationDetailVariable

Up to 10 configuration blocks with a name and a value to override the default variable value. Must be used in combination with a Webhook recipient that already has a variable with the same name configured.

Type | Target ----------|------------------------- email | an email address marker | name of the marker pagerduty | N/A slack | name of the channel webhook | name of the webhook

pagerdutySeverity String
Indicates the severity of an alert and has a default value of critical but can be set to one of info, warning, error, or critical and must be used in combination with a PagerDuty recipient.
variables List<TriggerRecipientNotificationDetailVariable>

Up to 10 configuration blocks with a name and a value to override the default variable value. Must be used in combination with a Webhook recipient that already has a variable with the same name configured.

Type | Target ----------|------------------------- email | an email address marker | name of the marker pagerduty | N/A slack | name of the channel webhook | name of the webhook

pagerdutySeverity string
Indicates the severity of an alert and has a default value of critical but can be set to one of info, warning, error, or critical and must be used in combination with a PagerDuty recipient.
variables TriggerRecipientNotificationDetailVariable[]

Up to 10 configuration blocks with a name and a value to override the default variable value. Must be used in combination with a Webhook recipient that already has a variable with the same name configured.

Type | Target ----------|------------------------- email | an email address marker | name of the marker pagerduty | N/A slack | name of the channel webhook | name of the webhook

pagerduty_severity str
Indicates the severity of an alert and has a default value of critical but can be set to one of info, warning, error, or critical and must be used in combination with a PagerDuty recipient.
variables Sequence[TriggerRecipientNotificationDetailVariable]

Up to 10 configuration blocks with a name and a value to override the default variable value. Must be used in combination with a Webhook recipient that already has a variable with the same name configured.

Type | Target ----------|------------------------- email | an email address marker | name of the marker pagerduty | N/A slack | name of the channel webhook | name of the webhook

pagerdutySeverity String
Indicates the severity of an alert and has a default value of critical but can be set to one of info, warning, error, or critical and must be used in combination with a PagerDuty recipient.
variables List<Property Map>

Up to 10 configuration blocks with a name and a value to override the default variable value. Must be used in combination with a Webhook recipient that already has a variable with the same name configured.

Type | Target ----------|------------------------- email | an email address marker | name of the marker pagerduty | N/A slack | name of the channel webhook | name of the webhook

TriggerRecipientNotificationDetailVariable
, TriggerRecipientNotificationDetailVariableArgs

Name This property is required. string
Name of the trigger.
Value string
The value of the variable
Name This property is required. string
Name of the trigger.
Value string
The value of the variable
name This property is required. String
Name of the trigger.
value String
The value of the variable
name This property is required. string
Name of the trigger.
value string
The value of the variable
name This property is required. str
Name of the trigger.
value str
The value of the variable
name This property is required. String
Name of the trigger.
value String
The value of the variable

TriggerThreshold
, TriggerThresholdArgs

Op This property is required. string
The operator to apply, allowed threshold operators are >, >=, <, and <=.
Value This property is required. double
The value to be used with the operator.
ExceededLimit double
The number of times the threshold is met before an alert is sent, must be between 1 and 5. Defaults to 1.
Op This property is required. string
The operator to apply, allowed threshold operators are >, >=, <, and <=.
Value This property is required. float64
The value to be used with the operator.
ExceededLimit float64
The number of times the threshold is met before an alert is sent, must be between 1 and 5. Defaults to 1.
op This property is required. String
The operator to apply, allowed threshold operators are >, >=, <, and <=.
value This property is required. Double
The value to be used with the operator.
exceededLimit Double
The number of times the threshold is met before an alert is sent, must be between 1 and 5. Defaults to 1.
op This property is required. string
The operator to apply, allowed threshold operators are >, >=, <, and <=.
value This property is required. number
The value to be used with the operator.
exceededLimit number
The number of times the threshold is met before an alert is sent, must be between 1 and 5. Defaults to 1.
op This property is required. str
The operator to apply, allowed threshold operators are >, >=, <, and <=.
value This property is required. float
The value to be used with the operator.
exceeded_limit float
The number of times the threshold is met before an alert is sent, must be between 1 and 5. Defaults to 1.
op This property is required. String
The operator to apply, allowed threshold operators are >, >=, <, and <=.
value This property is required. Number
The value to be used with the operator.
exceededLimit Number
The number of times the threshold is met before an alert is sent, must be between 1 and 5. Defaults to 1.

Import

Triggers can be imported using a combination of the dataset name and their ID, e.g.

$ pulumi import honeycombio:index/trigger:Trigger my_trigger my-dataset/AeZzSoWws9G
Copy

You can find the ID in the URL bar when visiting the trigger from the UI.

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

Package Details

Repository
honeycombio honeycombio/terraform-provider-honeycombio
License
Notes
This Pulumi package is based on the honeycombio Terraform Provider.