# Resource:<span pulumi-lang-nodejs=" honeycombio.Trigger
" pulumi-lang-dotnet=" honeycombio.Trigger " pulumi-lang-go=" Trigger " pulumi-lang-python=" Trigger " pulumi-lang-yaml=" honeycombio.Trigger " pulumi-lang-java=" honeycombio.Trigger “> 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 example = honeycombio.getQuerySpecification({
calculations: [{
op: "AVG",
column: "duration_ms",
}],
filters: [{
column: "trace.parent_id",
op: "does-not-exist",
}],
timeRange: 1800,
});
const exampleTrigger = new honeycombio.Trigger("example", {
name: "Requests are slower than usual",
description: "Average duration of all requests for the last 10 minutes.",
queryJson: example.then(example => example.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",
},
],
});
import pulumi
import pulumi_honeycombio as honeycombio
config = pulumi.Config()
dataset = config.require("dataset")
example = 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("example",
name="Requests are slower than usual",
description="Average duration of all requests for the last 10 minutes.",
query_json=example.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",
},
])
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")
example, 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, "example", &honeycombio.TriggerArgs{
Name: pulumi.String("Requests are slower than usual"),
Description: pulumi.String("Average duration of all requests for the last 10 minutes."),
QueryJson: pulumi.String(example.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
})
}
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 example = 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("example", new()
{
Name = "Requests are slower than usual",
Description = "Average duration of all requests for the last 10 minutes.",
QueryJson = example.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",
},
},
});
});
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 example = 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()
.name("Requests are slower than usual")
.description("Average duration of all requests for the last 10 minutes.")
.queryJson(example.json())
.dataset(dataset)
.frequency(600.0)
.alertType("on_change")
.thresholds(TriggerThresholdArgs.builder()
.op(">")
.value(1000.0)
.build())
.recipients(
TriggerRecipientArgs.builder()
.type("email")
.target("hello@example.com")
.build(),
TriggerRecipientArgs.builder()
.type("marker")
.target("Trigger - requests are slow")
.build())
.build());
}
}
configuration:
dataset:
type: string
resources:
exampleTrigger:
type: honeycombio:Trigger
name: example
properties:
name: Requests are slower than usual
description: Average duration of all requests for the last 10 minutes.
queryJson: ${example.json}
dataset: ${dataset}
frequency: 600 # in seconds, 10 minutes
alertType: on_change
thresholds:
- op: '>'
value: 1000
recipients:
- type: email
target: hello@example.com
- type: marker
target: Trigger - requests are slow
variables:
example:
fn::invoke:
function: honeycombio:getQuerySpecification
arguments:
calculations:
- op: AVG
column: duration_ms
filters:
- column: trace.parent_id
op: does-not-exist
timeRange: 1800
Trigger 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 example = honeycombio.getQuerySpecification({
calculations: [{
op: "AVG",
column: "duration_ms",
}],
filters: [{
column: "trace.parent_id",
op: "does-not-exist",
}],
});
const exampleTrigger = new honeycombio.Trigger("example", {
name: "Requests are slower than usual",
description: "Average duration of all requests for the last 10 minutes.",
queryJson: example.then(example => example.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",
],
}],
tags: {
team: "backend",
env: "production",
},
});
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 = honeycombio.get_query_specification(calculations=[{
"op": "AVG",
"column": "duration_ms",
}],
filters=[{
"column": "trace.parent_id",
"op": "does-not-exist",
}])
example_trigger = honeycombio.Trigger("example",
name="Requests are slower than usual",
description="Average duration of all requests for the last 10 minutes.",
query_json=example.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",
],
}],
tags={
"team": "backend",
"env": "production",
})
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
}
example, 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, "example", &honeycombio.TriggerArgs{
Name: pulumi.String("Requests are slower than usual"),
Description: pulumi.String("Average duration of all requests for the last 10 minutes."),
QueryJson: pulumi.String(example.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"),
},
},
},
Tags: pulumi.StringMap{
"team": pulumi.String("backend"),
"env": pulumi.String("production"),
},
})
if err != nil {
return err
}
return nil
})
}
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 example = 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("example", new()
{
Name = "Requests are slower than usual",
Description = "Average duration of all requests for the last 10 minutes.",
QueryJson = example.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",
},
},
},
Tags =
{
{ "team", "backend" },
{ "env", "production" },
},
});
});
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 example = 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()
.name("Requests are slower than usual")
.description("Average duration of all requests for the last 10 minutes.")
.queryJson(example.json())
.dataset(dataset)
.frequency(600.0)
.thresholds(TriggerThresholdArgs.builder()
.op(">")
.value(1000.0)
.exceededLimit(3.0)
.build())
.recipients(TriggerRecipientArgs.builder()
.id(pdProd.id())
.notificationDetails(TriggerRecipientNotificationDetailArgs.builder()
.pagerdutySeverity("warning")
.build())
.build())
.evaluationSchedules(TriggerEvaluationScheduleArgs.builder()
.startTime("13:00")
.endTime("21:00")
.daysOfWeeks(
"monday",
"wednesday",
"friday")
.build())
.tags(Map.ofEntries(
Map.entry("team", "backend"),
Map.entry("env", "production")
))
.build());
}
}
configuration:
dataset:
type: string
resources:
exampleTrigger:
type: honeycombio:Trigger
name: example
properties:
name: Requests are slower than usual
description: Average duration of all requests for the last 10 minutes.
queryJson: ${example.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
tags:
team: backend
env: production
variables:
pdProd:
fn::invoke:
function: honeycombio:getRecipient
arguments:
type: pagerduty
detailFilter:
name: integration_name
value: Prod On-Call
example:
fn::invoke:
function: honeycombio:getQuerySpecification
arguments:
calculations:
- op: AVG
column: duration_ms
filters:
- column: trace.parent_id
op: does-not-exist
Trigger 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 example = honeycombio.getQuerySpecification({
calculations: [{
op: "AVG",
column: "duration_ms",
}],
filters: [{
column: "trace.parent_id",
op: "does-not-exist",
}],
});
const exampleTrigger = new honeycombio.Trigger("example", {
name: "Requests are slower than usual",
description: "Average duration of all requests for the last 10 minutes.",
queryJson: example.then(example => example.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",
],
}],
tags: {
team: "backend",
env: "production",
},
});
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 = honeycombio.get_query_specification(calculations=[{
"op": "AVG",
"column": "duration_ms",
}],
filters=[{
"column": "trace.parent_id",
"op": "does-not-exist",
}])
example_trigger = honeycombio.Trigger("example",
name="Requests are slower than usual",
description="Average duration of all requests for the last 10 minutes.",
query_json=example.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",
],
}],
tags={
"team": "backend",
"env": "production",
})
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
}
example, 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, "example", &honeycombio.TriggerArgs{
Name: pulumi.String("Requests are slower than usual"),
Description: pulumi.String("Average duration of all requests for the last 10 minutes."),
QueryJson: pulumi.String(example.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"),
},
},
},
Tags: pulumi.StringMap{
"team": pulumi.String("backend"),
"env": pulumi.String("production"),
},
})
if err != nil {
return err
}
return nil
})
}
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 example = 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("example", new()
{
Name = "Requests are slower than usual",
Description = "Average duration of all requests for the last 10 minutes.",
QueryJson = example.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",
},
},
},
Tags =
{
{ "team", "backend" },
{ "env", "production" },
},
});
});
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 example = 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()
.name("Requests are slower than usual")
.description("Average duration of all requests for the last 10 minutes.")
.queryJson(example.json())
.dataset(dataset)
.frequency(600.0)
.thresholds(TriggerThresholdArgs.builder()
.op(">")
.value(1000.0)
.exceededLimit(3.0)
.build())
.recipients(TriggerRecipientArgs.builder()
.id(customWebhook.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())
.tags(Map.ofEntries(
Map.entry("team", "backend"),
Map.entry("env", "production")
))
.build());
}
}
configuration:
dataset:
type: string
resources:
exampleTrigger:
type: honeycombio:Trigger
name: example
properties:
name: Requests are slower than usual
description: Average duration of all requests for the last 10 minutes.
queryJson: ${example.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
tags:
team: backend
env: production
variables:
customWebhook:
fn::invoke:
function: honeycombio:getRecipient
arguments:
type: webhook
detailFilter:
name: name
value: My Custom Webhook
example:
fn::invoke:
function: honeycombio:getQuerySpecification
arguments:
calculations:
- op: AVG
column: duration_ms
filters:
- column: trace.parent_id
op: does-not-exist
Baseline Trigger
import * as pulumi from "@pulumi/pulumi";
import * as honeycombio from "@pulumi/honeycombio";
const config = new pulumi.Config();
const dataset = config.require("dataset");
const example = honeycombio.getQuerySpecification({
calculations: [{
op: "AVG",
column: "duration_ms",
}],
});
const exampleTrigger = new honeycombio.Trigger("example", {
name: "Requests are slower than usual",
description: "Average duration of all requests for the last 10 minutes.",
queryJson: example.then(example => example.json),
dataset: dataset,
frequency: 600,
thresholds: [{
op: ">=",
value: 1000,
}],
baselineDetails: [{
type: "percentage",
offsetMinutes: 1440,
}],
tags: {
team: "backend",
env: "production",
},
});
import pulumi
import pulumi_honeycombio as honeycombio
config = pulumi.Config()
dataset = config.require("dataset")
example = honeycombio.get_query_specification(calculations=[{
"op": "AVG",
"column": "duration_ms",
}])
example_trigger = honeycombio.Trigger("example",
name="Requests are slower than usual",
description="Average duration of all requests for the last 10 minutes.",
query_json=example.json,
dataset=dataset,
frequency=600,
thresholds=[{
"op": ">=",
"value": 1000,
}],
baseline_details=[{
"type": "percentage",
"offset_minutes": 1440,
}],
tags={
"team": "backend",
"env": "production",
})
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")
example, err := honeycombio.GetQuerySpecification(ctx, &honeycombio.GetQuerySpecificationArgs{
Calculations: []honeycombio.GetQuerySpecificationCalculation{
{
Op: "AVG",
Column: pulumi.StringRef("duration_ms"),
},
},
}, nil)
if err != nil {
return err
}
_, err = honeycombio.NewTrigger(ctx, "example", &honeycombio.TriggerArgs{
Name: pulumi.String("Requests are slower than usual"),
Description: pulumi.String("Average duration of all requests for the last 10 minutes."),
QueryJson: pulumi.String(example.Json),
Dataset: pulumi.String(dataset),
Frequency: pulumi.Float64(600),
Thresholds: honeycombio.TriggerThresholdArray{
&honeycombio.TriggerThresholdArgs{
Op: pulumi.String(">="),
Value: pulumi.Float64(1000),
},
},
BaselineDetails: honeycombio.TriggerBaselineDetailArray{
&honeycombio.TriggerBaselineDetailArgs{
Type: pulumi.String("percentage"),
OffsetMinutes: pulumi.Float64(1440),
},
},
Tags: pulumi.StringMap{
"team": pulumi.String("backend"),
"env": pulumi.String("production"),
},
})
if err != nil {
return err
}
return nil
})
}
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 example = Honeycombio.GetQuerySpecification.Invoke(new()
{
Calculations = new[]
{
new Honeycombio.Inputs.GetQuerySpecificationCalculationInputArgs
{
Op = "AVG",
Column = "duration_ms",
},
},
});
var exampleTrigger = new Honeycombio.Trigger("example", new()
{
Name = "Requests are slower than usual",
Description = "Average duration of all requests for the last 10 minutes.",
QueryJson = example.Apply(getQuerySpecificationResult => getQuerySpecificationResult.Json),
Dataset = dataset,
Frequency = 600,
Thresholds = new[]
{
new Honeycombio.Inputs.TriggerThresholdArgs
{
Op = ">=",
Value = 1000,
},
},
BaselineDetails = new[]
{
new Honeycombio.Inputs.TriggerBaselineDetailArgs
{
Type = "percentage",
OffsetMinutes = 1440,
},
},
Tags =
{
{ "team", "backend" },
{ "env", "production" },
},
});
});
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.TriggerBaselineDetailArgs;
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 example = HoneycombioFunctions.getQuerySpecification(GetQuerySpecificationArgs.builder()
.calculations(GetQuerySpecificationCalculationArgs.builder()
.op("AVG")
.column("duration_ms")
.build())
.build());
var exampleTrigger = new Trigger("exampleTrigger", TriggerArgs.builder()
.name("Requests are slower than usual")
.description("Average duration of all requests for the last 10 minutes.")
.queryJson(example.json())
.dataset(dataset)
.frequency(600.0)
.thresholds(TriggerThresholdArgs.builder()
.op(">=")
.value(1000.0)
.build())
.baselineDetails(TriggerBaselineDetailArgs.builder()
.type("percentage")
.offsetMinutes(1440.0)
.build())
.tags(Map.ofEntries(
Map.entry("team", "backend"),
Map.entry("env", "production")
))
.build());
}
}
configuration:
dataset:
type: string
resources:
exampleTrigger:
type: honeycombio:Trigger
name: example
properties:
name: Requests are slower than usual
description: Average duration of all requests for the last 10 minutes.
queryJson: ${example.json}
dataset: ${dataset}
frequency: 600 # in seconds, 10 minutes
thresholds:
- op: '>='
value: 1000
baselineDetails:
- type: percentage
offsetMinutes: 1440
tags:
team: backend
env: production
variables:
example:
fn::invoke:
function: honeycombio:getQuerySpecification
arguments:
calculations:
- op: AVG
column: duration_ms
Environment-wide Trigger
import * as pulumi from "@pulumi/pulumi";
import * as honeycombio from "@pulumi/honeycombio";
const example = honeycombio.getQuerySpecification({
calculations: [{
op: "AVG",
column: "duration_ms",
}],
});
const exampleTrigger = new honeycombio.Trigger("example", {
name: "Requests are slower than usual",
description: "Average duration of all requests for the last 10 minutes.",
queryJson: example.then(example => example.json),
frequency: 600,
thresholds: [{
op: ">=",
value: 1000,
}],
});
import pulumi
import pulumi_honeycombio as honeycombio
example = honeycombio.get_query_specification(calculations=[{
"op": "AVG",
"column": "duration_ms",
}])
example_trigger = honeycombio.Trigger("example",
name="Requests are slower than usual",
description="Average duration of all requests for the last 10 minutes.",
query_json=example.json,
frequency=600,
thresholds=[{
"op": ">=",
"value": 1000,
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/honeycombio/honeycombio"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := honeycombio.GetQuerySpecification(ctx, &honeycombio.GetQuerySpecificationArgs{
Calculations: []honeycombio.GetQuerySpecificationCalculation{
{
Op: "AVG",
Column: pulumi.StringRef("duration_ms"),
},
},
}, nil)
if err != nil {
return err
}
_, err = honeycombio.NewTrigger(ctx, "example", &honeycombio.TriggerArgs{
Name: pulumi.String("Requests are slower than usual"),
Description: pulumi.String("Average duration of all requests for the last 10 minutes."),
QueryJson: pulumi.String(example.Json),
Frequency: pulumi.Float64(600),
Thresholds: honeycombio.TriggerThresholdArray{
&honeycombio.TriggerThresholdArgs{
Op: pulumi.String(">="),
Value: pulumi.Float64(1000),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Honeycombio = Pulumi.Honeycombio;
return await Deployment.RunAsync(() =>
{
var example = Honeycombio.GetQuerySpecification.Invoke(new()
{
Calculations = new[]
{
new Honeycombio.Inputs.GetQuerySpecificationCalculationInputArgs
{
Op = "AVG",
Column = "duration_ms",
},
},
});
var exampleTrigger = new Honeycombio.Trigger("example", new()
{
Name = "Requests are slower than usual",
Description = "Average duration of all requests for the last 10 minutes.",
QueryJson = example.Apply(getQuerySpecificationResult => getQuerySpecificationResult.Json),
Frequency = 600,
Thresholds = new[]
{
new Honeycombio.Inputs.TriggerThresholdArgs
{
Op = ">=",
Value = 1000,
},
},
});
});
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 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 example = HoneycombioFunctions.getQuerySpecification(GetQuerySpecificationArgs.builder()
.calculations(GetQuerySpecificationCalculationArgs.builder()
.op("AVG")
.column("duration_ms")
.build())
.build());
var exampleTrigger = new Trigger("exampleTrigger", TriggerArgs.builder()
.name("Requests are slower than usual")
.description("Average duration of all requests for the last 10 minutes.")
.queryJson(example.json())
.frequency(600.0)
.thresholds(TriggerThresholdArgs.builder()
.op(">=")
.value(1000.0)
.build())
.build());
}
}
resources:
exampleTrigger:
type: honeycombio:Trigger
name: example
properties:
name: Requests are slower than usual
description: Average duration of all requests for the last 10 minutes.
queryJson: ${example.json}
frequency: 600 # in seconds, 10 minutes
thresholds:
- op: '>='
value: 1000
variables:
example:
fn::invoke:
function: honeycombio:getQuerySpecification
arguments:
calculations:
- op: AVG
column: duration_ms
Trigger with Having
import * as pulumi from "@pulumi/pulumi";
import * as honeycombio from "@pulumi/honeycombio";
const config = new pulumi.Config();
const dataset = config.require("dataset");
const query = honeycombio.getQuerySpecification({
calculations: [
{
op: "AVG",
column: "duration_ms",
},
{
op: "MAX",
column: "retries",
},
],
filters: [{
column: "error.type",
op: "exists",
}],
havings: [{
calculateOp: "MAX",
column: "retries",
op: ">",
value: 0,
}],
timeRange: 900,
});
const trigger = new honeycombio.Trigger("trigger", {
name: "Retried errors are slower than usual",
description: "Average duration of requests with errors and at least one retry is slower than expected for the last 15 minutes.",
disabled: false,
queryJson: query.then(query => query.json),
dataset: dataset,
frequency: 900,
thresholds: [{
op: ">",
value: 1000,
}],
recipients: [
{
type: "email",
target: "hello@example.com",
},
{
type: "marker",
target: "Trigger - slow requests",
},
],
});
import pulumi
import pulumi_honeycombio as honeycombio
config = pulumi.Config()
dataset = config.require("dataset")
query = honeycombio.get_query_specification(calculations=[
{
"op": "AVG",
"column": "duration_ms",
},
{
"op": "MAX",
"column": "retries",
},
],
filters=[{
"column": "error.type",
"op": "exists",
}],
havings=[{
"calculate_op": "MAX",
"column": "retries",
"op": ">",
"value": 0,
}],
time_range=900)
trigger = honeycombio.Trigger("trigger",
name="Retried errors are slower than usual",
description="Average duration of requests with errors and at least one retry is slower than expected for the last 15 minutes.",
disabled=False,
query_json=query.json,
dataset=dataset,
frequency=900,
thresholds=[{
"op": ">",
"value": 1000,
}],
recipients=[
{
"type": "email",
"target": "hello@example.com",
},
{
"type": "marker",
"target": "Trigger - slow requests",
},
])
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")
query, err := honeycombio.GetQuerySpecification(ctx, &honeycombio.GetQuerySpecificationArgs{
Calculations: []honeycombio.GetQuerySpecificationCalculation{
{
Op: "AVG",
Column: pulumi.StringRef("duration_ms"),
},
{
Op: "MAX",
Column: pulumi.StringRef("retries"),
},
},
Filters: []honeycombio.GetQuerySpecificationFilter{
{
Column: "error.type",
Op: "exists",
},
},
Havings: []honeycombio.GetQuerySpecificationHaving{
{
CalculateOp: "MAX",
Column: pulumi.StringRef("retries"),
Op: ">",
Value: 0,
},
},
TimeRange: pulumi.Float64Ref(900),
}, nil)
if err != nil {
return err
}
_, err = honeycombio.NewTrigger(ctx, "trigger", &honeycombio.TriggerArgs{
Name: pulumi.String("Retried errors are slower than usual"),
Description: pulumi.String("Average duration of requests with errors and at least one retry is slower than expected for the last 15 minutes."),
Disabled: pulumi.Bool(false),
QueryJson: pulumi.String(query.Json),
Dataset: pulumi.String(dataset),
Frequency: pulumi.Float64(900),
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 - slow requests"),
},
},
})
if err != nil {
return err
}
return nil
})
}
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 query = Honeycombio.GetQuerySpecification.Invoke(new()
{
Calculations = new[]
{
new Honeycombio.Inputs.GetQuerySpecificationCalculationInputArgs
{
Op = "AVG",
Column = "duration_ms",
},
new Honeycombio.Inputs.GetQuerySpecificationCalculationInputArgs
{
Op = "MAX",
Column = "retries",
},
},
Filters = new[]
{
new Honeycombio.Inputs.GetQuerySpecificationFilterInputArgs
{
Column = "error.type",
Op = "exists",
},
},
Havings = new[]
{
new Honeycombio.Inputs.GetQuerySpecificationHavingInputArgs
{
CalculateOp = "MAX",
Column = "retries",
Op = ">",
Value = 0,
},
},
TimeRange = 900,
});
var trigger = new Honeycombio.Trigger("trigger", new()
{
Name = "Retried errors are slower than usual",
Description = "Average duration of requests with errors and at least one retry is slower than expected for the last 15 minutes.",
Disabled = false,
QueryJson = query.Apply(getQuerySpecificationResult => getQuerySpecificationResult.Json),
Dataset = dataset,
Frequency = 900,
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 - slow requests",
},
},
});
});
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 query = HoneycombioFunctions.getQuerySpecification(GetQuerySpecificationArgs.builder()
.calculations(
GetQuerySpecificationCalculationArgs.builder()
.op("AVG")
.column("duration_ms")
.build(),
GetQuerySpecificationCalculationArgs.builder()
.op("MAX")
.column("retries")
.build())
.filters(GetQuerySpecificationFilterArgs.builder()
.column("error.type")
.op("exists")
.build())
.havings(GetQuerySpecificationHavingArgs.builder()
.calculateOp("MAX")
.column("retries")
.op(">")
.value(0)
.build())
.timeRange(900)
.build());
var trigger = new Trigger("trigger", TriggerArgs.builder()
.name("Retried errors are slower than usual")
.description("Average duration of requests with errors and at least one retry is slower than expected for the last 15 minutes.")
.disabled(false)
.queryJson(query.json())
.dataset(dataset)
.frequency(900.0)
.thresholds(TriggerThresholdArgs.builder()
.op(">")
.value(1000.0)
.build())
.recipients(
TriggerRecipientArgs.builder()
.type("email")
.target("hello@example.com")
.build(),
TriggerRecipientArgs.builder()
.type("marker")
.target("Trigger - slow requests")
.build())
.build());
}
}
configuration:
dataset:
type: string
resources:
trigger:
type: honeycombio:Trigger
properties:
name: Retried errors are slower than usual
description: Average duration of requests with errors and at least one retry is slower than expected for the last 15 minutes.
disabled: false
queryJson: ${query.json}
dataset: ${dataset}
frequency: 900 # in seconds, 15 minutes
thresholds:
- op: '>'
value: 1000
recipients:
- type: email
target: hello@example.com
- type: marker
target: Trigger - slow requests
variables:
query:
fn::invoke:
function: honeycombio:getQuerySpecification
arguments:
calculations:
- op: AVG
column: duration_ms
- op: MAX
column: retries
filters:
- column: error.type
op: exists
havings:
- calculateOp: MAX
column: retries
op: '>'
value: 0
timeRange: 900
Trigger with Having COUNT
import * as pulumi from "@pulumi/pulumi";
import * as honeycombio from "@pulumi/honeycombio";
const config = new pulumi.Config();
const dataset = config.require("dataset");
const query = honeycombio.getQuerySpecification({
calculations: [
{
op: "AVG",
column: "duration_ms",
},
{
op: "COUNT",
},
],
havings: [{
calculateOp: "COUNT",
op: ">",
value: 100,
}],
timeRange: 900,
});
const trigger = new honeycombio.Trigger("trigger", {
name: "Common requests are slower than usual",
description: "Average duration of common requests is slower than expected for the last 15 minutes.",
disabled: false,
queryJson: query.then(query => query.json),
dataset: dataset,
frequency: 900,
thresholds: [{
op: ">",
value: 1000,
}],
recipients: [
{
type: "email",
target: "hello@example.com",
},
{
type: "marker",
target: "Trigger - slow requests",
},
],
});
import pulumi
import pulumi_honeycombio as honeycombio
config = pulumi.Config()
dataset = config.require("dataset")
query = honeycombio.get_query_specification(calculations=[
{
"op": "AVG",
"column": "duration_ms",
},
{
"op": "COUNT",
},
],
havings=[{
"calculate_op": "COUNT",
"op": ">",
"value": 100,
}],
time_range=900)
trigger = honeycombio.Trigger("trigger",
name="Common requests are slower than usual",
description="Average duration of common requests is slower than expected for the last 15 minutes.",
disabled=False,
query_json=query.json,
dataset=dataset,
frequency=900,
thresholds=[{
"op": ">",
"value": 1000,
}],
recipients=[
{
"type": "email",
"target": "hello@example.com",
},
{
"type": "marker",
"target": "Trigger - slow requests",
},
])
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")
query, err := honeycombio.GetQuerySpecification(ctx, &honeycombio.GetQuerySpecificationArgs{
Calculations: []honeycombio.GetQuerySpecificationCalculation{
{
Op: "AVG",
Column: pulumi.StringRef("duration_ms"),
},
{
Op: "COUNT",
},
},
Havings: []honeycombio.GetQuerySpecificationHaving{
{
CalculateOp: "COUNT",
Op: ">",
Value: 100,
},
},
TimeRange: pulumi.Float64Ref(900),
}, nil)
if err != nil {
return err
}
_, err = honeycombio.NewTrigger(ctx, "trigger", &honeycombio.TriggerArgs{
Name: pulumi.String("Common requests are slower than usual"),
Description: pulumi.String("Average duration of common requests is slower than expected for the last 15 minutes."),
Disabled: pulumi.Bool(false),
QueryJson: pulumi.String(query.Json),
Dataset: pulumi.String(dataset),
Frequency: pulumi.Float64(900),
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 - slow requests"),
},
},
})
if err != nil {
return err
}
return nil
})
}
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 query = Honeycombio.GetQuerySpecification.Invoke(new()
{
Calculations = new[]
{
new Honeycombio.Inputs.GetQuerySpecificationCalculationInputArgs
{
Op = "AVG",
Column = "duration_ms",
},
new Honeycombio.Inputs.GetQuerySpecificationCalculationInputArgs
{
Op = "COUNT",
},
},
Havings = new[]
{
new Honeycombio.Inputs.GetQuerySpecificationHavingInputArgs
{
CalculateOp = "COUNT",
Op = ">",
Value = 100,
},
},
TimeRange = 900,
});
var trigger = new Honeycombio.Trigger("trigger", new()
{
Name = "Common requests are slower than usual",
Description = "Average duration of common requests is slower than expected for the last 15 minutes.",
Disabled = false,
QueryJson = query.Apply(getQuerySpecificationResult => getQuerySpecificationResult.Json),
Dataset = dataset,
Frequency = 900,
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 - slow requests",
},
},
});
});
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 query = HoneycombioFunctions.getQuerySpecification(GetQuerySpecificationArgs.builder()
.calculations(
GetQuerySpecificationCalculationArgs.builder()
.op("AVG")
.column("duration_ms")
.build(),
GetQuerySpecificationCalculationArgs.builder()
.op("COUNT")
.build())
.havings(GetQuerySpecificationHavingArgs.builder()
.calculateOp("COUNT")
.op(">")
.value(100)
.build())
.timeRange(900)
.build());
var trigger = new Trigger("trigger", TriggerArgs.builder()
.name("Common requests are slower than usual")
.description("Average duration of common requests is slower than expected for the last 15 minutes.")
.disabled(false)
.queryJson(query.json())
.dataset(dataset)
.frequency(900.0)
.thresholds(TriggerThresholdArgs.builder()
.op(">")
.value(1000.0)
.build())
.recipients(
TriggerRecipientArgs.builder()
.type("email")
.target("hello@example.com")
.build(),
TriggerRecipientArgs.builder()
.type("marker")
.target("Trigger - slow requests")
.build())
.build());
}
}
configuration:
dataset:
type: string
resources:
trigger:
type: honeycombio:Trigger
properties:
name: Common requests are slower than usual
description: Average duration of common requests is slower than expected for the last 15 minutes.
disabled: false
queryJson: ${query.json}
dataset: ${dataset}
frequency: 900 # in seconds, 15 minutes
thresholds:
- op: '>'
value: 1000
recipients:
- type: email
target: hello@example.com
- type: marker
target: Trigger - slow requests
variables:
query:
fn::invoke:
function: honeycombio:getQuerySpecification
arguments:
calculations:
- op: AVG
column: duration_ms
- op: COUNT
havings:
- calculateOp: COUNT
op: '>'
value: 100
timeRange: 900
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: Optional[TriggerArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Trigger(resource_name: str,
opts: Optional[ResourceOptions] = None,
alert_type: Optional[str] = None,
baseline_details: Optional[Sequence[TriggerBaselineDetailArgs]] = 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,
tags: Optional[Mapping[str, str]] = None,
thresholds: Optional[Sequence[TriggerThresholdArgs]] = None)func NewTrigger(ctx *Context, name string, args *TriggerArgs, opts ...ResourceOption) (*Trigger, error)public Trigger(string name, TriggerArgs? args = null, 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 string
- The unique name of the resource.
- args TriggerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args TriggerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TriggerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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()
{
AlertType = "string",
BaselineDetails = new[]
{
new Honeycombio.Inputs.TriggerBaselineDetailArgs
{
OffsetMinutes = 0,
Type = "string",
},
},
Dataset = "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",
},
},
Tags =
{
{ "string", "string" },
},
Thresholds = new[]
{
new Honeycombio.Inputs.TriggerThresholdArgs
{
Op = "string",
Value = 0,
ExceededLimit = 0,
},
},
});
example, err := honeycombio.NewTrigger(ctx, "triggerResource", &honeycombio.TriggerArgs{
AlertType: pulumi.String("string"),
BaselineDetails: honeycombio.TriggerBaselineDetailArray{
&honeycombio.TriggerBaselineDetailArgs{
OffsetMinutes: pulumi.Float64(0),
Type: pulumi.String("string"),
},
},
Dataset: pulumi.String("string"),
Description: pulumi.String("string"),
Disabled: pulumi.Bool(false),
EvaluationSchedules: honeycombio.TriggerEvaluationScheduleArray{
&honeycombio.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: honeycombio.TriggerRecipientArray{
&honeycombio.TriggerRecipientArgs{
Id: pulumi.String("string"),
NotificationDetails: honeycombio.TriggerRecipientNotificationDetailArray{
&honeycombio.TriggerRecipientNotificationDetailArgs{
PagerdutySeverity: pulumi.String("string"),
Variables: honeycombio.TriggerRecipientNotificationDetailVariableArray{
&honeycombio.TriggerRecipientNotificationDetailVariableArgs{
Name: pulumi.String("string"),
Value: pulumi.String("string"),
},
},
},
},
Target: pulumi.String("string"),
Type: pulumi.String("string"),
},
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
Thresholds: honeycombio.TriggerThresholdArray{
&honeycombio.TriggerThresholdArgs{
Op: pulumi.String("string"),
Value: pulumi.Float64(0),
ExceededLimit: pulumi.Float64(0),
},
},
})
var triggerResource = new Trigger("triggerResource", TriggerArgs.builder()
.alertType("string")
.baselineDetails(TriggerBaselineDetailArgs.builder()
.offsetMinutes(0.0)
.type("string")
.build())
.dataset("string")
.description("string")
.disabled(false)
.evaluationSchedules(TriggerEvaluationScheduleArgs.builder()
.daysOfWeeks("string")
.endTime("string")
.startTime("string")
.build())
.frequency(0.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())
.tags(Map.of("string", "string"))
.thresholds(TriggerThresholdArgs.builder()
.op("string")
.value(0.0)
.exceededLimit(0.0)
.build())
.build());
trigger_resource = honeycombio.Trigger("triggerResource",
alert_type="string",
baseline_details=[{
"offset_minutes": 0,
"type": "string",
}],
dataset="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",
}],
tags={
"string": "string",
},
thresholds=[{
"op": "string",
"value": 0,
"exceeded_limit": 0,
}])
const triggerResource = new honeycombio.Trigger("triggerResource", {
alertType: "string",
baselineDetails: [{
offsetMinutes: 0,
type: "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",
}],
tags: {
string: "string",
},
thresholds: [{
op: "string",
value: 0,
exceededLimit: 0,
}],
});
type: honeycombio:Trigger
properties:
alertType: string
baselineDetails:
- offsetMinutes: 0
type: 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
tags:
string: string
thresholds:
- exceededLimit: 0
op: string
value: 0
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:
- Alert
Type string - Control when the Trigger will send a notification.
- Baseline
Details List<TriggerBaseline Detail> - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- Dataset string
- The dataset this Trigger is associated with.
- Description string
- A description of the Trigger.
- Disabled bool
- The state of the Trigger. If true, the Trigger will not be run.
- Evaluation
Schedules List<TriggerEvaluation Schedule> - The schedule 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.
- Name string
- The name of the Trigger.
- Query
Id string - The ID of the Query that the Trigger will execute.
- Query
Json string - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - Recipients
List<Trigger
Recipient> - Zero or more recipients to notify when the resource fires.
- Dictionary<string, string>
- A map of tags to assign to the resource.
- Thresholds
List<Trigger
Threshold> - A block describing the threshold for the Trigger to fire.
- Alert
Type string - Control when the Trigger will send a notification.
- Baseline
Details []TriggerBaseline Detail Args - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- Dataset string
- The dataset this Trigger is associated with.
- Description string
- A description of the Trigger.
- Disabled bool
- The state of the Trigger. If true, the Trigger will not be run.
- Evaluation
Schedules []TriggerEvaluation Schedule Args - The schedule 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.
- Name string
- The name of the Trigger.
- Query
Id string - The ID of the Query that the Trigger will execute.
- Query
Json string - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - Recipients
[]Trigger
Recipient Args - Zero or more recipients to notify when the resource fires.
- map[string]string
- A map of tags to assign to the resource.
- Thresholds
[]Trigger
Threshold Args - A block describing the threshold for the Trigger to fire.
- alert
Type String - Control when the Trigger will send a notification.
- baseline
Details List<TriggerBaseline Detail> - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- dataset String
- The dataset this Trigger is associated with.
- description String
- A description of the Trigger.
- disabled Boolean
- The state of the Trigger. If true, the Trigger will not be run.
- evaluation
Schedules List<TriggerEvaluation Schedule> - The schedule 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.
- name String
- The name of the Trigger.
- query
Id String - The ID of the Query that the Trigger will execute.
- query
Json String - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - recipients
List<Trigger
Recipient> - Zero or more recipients to notify when the resource fires.
- Map<String,String>
- A map of tags to assign to the resource.
- thresholds
List<Trigger
Threshold> - A block describing the threshold for the Trigger to fire.
- alert
Type string - Control when the Trigger will send a notification.
- baseline
Details TriggerBaseline Detail[] - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- dataset string
- The dataset this Trigger is associated with.
- description string
- A description of the Trigger.
- disabled boolean
- The state of the Trigger. If true, the Trigger will not be run.
- evaluation
Schedules TriggerEvaluation Schedule[] - The schedule 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.
- name string
- The name of the Trigger.
- query
Id string - The ID of the Query that the Trigger will execute.
- query
Json string - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - recipients
Trigger
Recipient[] - Zero or more recipients to notify when the resource fires.
- {[key: string]: string}
- A map of tags to assign to the resource.
- thresholds
Trigger
Threshold[] - A block describing the threshold for the Trigger to fire.
- alert_
type str - Control when the Trigger will send a notification.
- baseline_
details Sequence[TriggerBaseline Detail Args] - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- dataset str
- The dataset this Trigger is associated with.
- description str
- A description of the Trigger.
- disabled bool
- The state of the Trigger. If true, the Trigger will not be run.
- evaluation_
schedules Sequence[TriggerEvaluation Schedule Args] - The schedule 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.
- name str
- The name of the Trigger.
- query_
id str - The ID of the Query that the Trigger will execute.
- query_
json str - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - recipients
Sequence[Trigger
Recipient Args] - Zero or more recipients to notify when the resource fires.
- Mapping[str, str]
- A map of tags to assign to the resource.
- thresholds
Sequence[Trigger
Threshold Args] - A block describing the threshold for the Trigger to fire.
- alert
Type String - Control when the Trigger will send a notification.
- baseline
Details List<Property Map> - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- dataset String
- The dataset this Trigger is associated with.
- description String
- A description of the Trigger.
- disabled Boolean
- The state of the Trigger. If true, the Trigger will not be run.
- evaluation
Schedules List<Property Map> - The schedule 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.
- name String
- The name of the Trigger.
- query
Id String - The ID of the Query that the Trigger will execute.
- query
Json String - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - recipients List<Property Map>
- Zero or more recipients to notify when the resource fires.
- Map<String>
- A map of tags to assign to the resource.
- thresholds List<Property Map>
- A block describing the threshold for the Trigger to fire.
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,
baseline_details: Optional[Sequence[TriggerBaselineDetailArgs]] = 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,
tags: Optional[Mapping[str, str]] = None,
thresholds: Optional[Sequence[TriggerThresholdArgs]] = None) -> Triggerfunc 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Alert
Type string - Control when the Trigger will send a notification.
- Baseline
Details List<TriggerBaseline Detail> - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- Dataset string
- The dataset this Trigger is associated with.
- Description string
- A description of the Trigger.
- Disabled bool
- The state of the Trigger. If true, the Trigger will not be run.
- Evaluation
Schedules List<TriggerEvaluation Schedule> - The schedule 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.
- Name string
- The name of the Trigger.
- Query
Id string - The ID of the Query that the Trigger will execute.
- Query
Json string - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - Recipients
List<Trigger
Recipient> - Zero or more recipients to notify when the resource fires.
- Dictionary<string, string>
- A map of tags to assign to the resource.
- Thresholds
List<Trigger
Threshold> - A block describing the threshold for the Trigger to fire.
- Alert
Type string - Control when the Trigger will send a notification.
- Baseline
Details []TriggerBaseline Detail Args - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- Dataset string
- The dataset this Trigger is associated with.
- Description string
- A description of the Trigger.
- Disabled bool
- The state of the Trigger. If true, the Trigger will not be run.
- Evaluation
Schedules []TriggerEvaluation Schedule Args - The schedule 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.
- Name string
- The name of the Trigger.
- Query
Id string - The ID of the Query that the Trigger will execute.
- Query
Json string - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - Recipients
[]Trigger
Recipient Args - Zero or more recipients to notify when the resource fires.
- map[string]string
- A map of tags to assign to the resource.
- Thresholds
[]Trigger
Threshold Args - A block describing the threshold for the Trigger to fire.
- alert
Type String - Control when the Trigger will send a notification.
- baseline
Details List<TriggerBaseline Detail> - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- dataset String
- The dataset this Trigger is associated with.
- description String
- A description of the Trigger.
- disabled Boolean
- The state of the Trigger. If true, the Trigger will not be run.
- evaluation
Schedules List<TriggerEvaluation Schedule> - The schedule 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.
- name String
- The name of the Trigger.
- query
Id String - The ID of the Query that the Trigger will execute.
- query
Json String - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - recipients
List<Trigger
Recipient> - Zero or more recipients to notify when the resource fires.
- Map<String,String>
- A map of tags to assign to the resource.
- thresholds
List<Trigger
Threshold> - A block describing the threshold for the Trigger to fire.
- alert
Type string - Control when the Trigger will send a notification.
- baseline
Details TriggerBaseline Detail[] - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- dataset string
- The dataset this Trigger is associated with.
- description string
- A description of the Trigger.
- disabled boolean
- The state of the Trigger. If true, the Trigger will not be run.
- evaluation
Schedules TriggerEvaluation Schedule[] - The schedule 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.
- name string
- The name of the Trigger.
- query
Id string - The ID of the Query that the Trigger will execute.
- query
Json string - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - recipients
Trigger
Recipient[] - Zero or more recipients to notify when the resource fires.
- {[key: string]: string}
- A map of tags to assign to the resource.
- thresholds
Trigger
Threshold[] - A block describing the threshold for the Trigger to fire.
- alert_
type str - Control when the Trigger will send a notification.
- baseline_
details Sequence[TriggerBaseline Detail Args] - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- dataset str
- The dataset this Trigger is associated with.
- description str
- A description of the Trigger.
- disabled bool
- The state of the Trigger. If true, the Trigger will not be run.
- evaluation_
schedules Sequence[TriggerEvaluation Schedule Args] - The schedule 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.
- name str
- The name of the Trigger.
- query_
id str - The ID of the Query that the Trigger will execute.
- query_
json str - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - recipients
Sequence[Trigger
Recipient Args] - Zero or more recipients to notify when the resource fires.
- Mapping[str, str]
- A map of tags to assign to the resource.
- thresholds
Sequence[Trigger
Threshold Args] - A block describing the threshold for the Trigger to fire.
- alert
Type String - Control when the Trigger will send a notification.
- baseline
Details List<Property Map> - A configuration block that allows you to receive notifications when the delta between values in your data, compared to a previous time period, cross thresholds you configure.
- dataset String
- The dataset this Trigger is associated with.
- description String
- A description of the Trigger.
- disabled Boolean
- The state of the Trigger. If true, the Trigger will not be run.
- evaluation
Schedules List<Property Map> - The schedule 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.
- name String
- The name of the Trigger.
- query
Id String - The ID of the Query that the Trigger will execute.
- query
Json String - The QuerySpec JSON for the query that the Trigger will execute. Providing the QuerySpec JSON directly allows for additional validation that the QuerySpec is valid as a Trigger Query. While the JSON can be constructed manually, it is easiest to use the
honeycombio.getQuerySpecificationdata source. - recipients List<Property Map>
- Zero or more recipients to notify when the resource fires.
- Map<String>
- A map of tags to assign to the resource.
- thresholds List<Property Map>
- A block describing the threshold for the Trigger to fire.
Supporting Types
TriggerBaselineDetail, TriggerBaselineDetailArgs
- Offset
Minutes double - What previous time period to evaluate against: 1 hour, 1 day, 1 week, or 4 weeks.
- Type string
- Whether to use an absolute value or percentage delta.
- Offset
Minutes float64 - What previous time period to evaluate against: 1 hour, 1 day, 1 week, or 4 weeks.
- Type string
- Whether to use an absolute value or percentage delta.
- offset
Minutes Double - What previous time period to evaluate against: 1 hour, 1 day, 1 week, or 4 weeks.
- type String
- Whether to use an absolute value or percentage delta.
- offset
Minutes number - What previous time period to evaluate against: 1 hour, 1 day, 1 week, or 4 weeks.
- type string
- Whether to use an absolute value or percentage delta.
- offset_
minutes float - What previous time period to evaluate against: 1 hour, 1 day, 1 week, or 4 weeks.
- type str
- Whether to use an absolute value or percentage delta.
- offset
Minutes Number - What previous time period to evaluate against: 1 hour, 1 day, 1 week, or 4 weeks.
- type String
- Whether to use an absolute value or percentage delta.
TriggerEvaluationSchedule, TriggerEvaluationScheduleArgs
- Days
Of List<string>Weeks - The days of the week to evaluate the trigger on
- End
Time string - UTC time to stop evaluating the trigger in HH:mm format
- Start
Time string - UTC time to start evaluating the trigger in HH:mm format
- Days
Of []stringWeeks - The days of the week to evaluate the trigger on
- End
Time string - UTC time to stop evaluating the trigger in HH:mm format
- Start
Time string - UTC time to start evaluating the trigger in HH:mm format
- days
Of List<String>Weeks - The days of the week to evaluate the trigger on
- end
Time String - UTC time to stop evaluating the trigger in HH:mm format
- start
Time String - UTC time to start evaluating the trigger in HH:mm format
- days
Of string[]Weeks - The days of the week to evaluate the trigger on
- end
Time string - UTC time to stop evaluating the trigger in HH:mm format
- start
Time string - UTC time to start evaluating the trigger in HH:mm format
- days_
of_ Sequence[str]weeks - The days of the week to evaluate the trigger on
- end_
time str - UTC time to stop evaluating the trigger in HH:mm format
- start_
time str - UTC time to start evaluating the trigger in HH:mm format
- days
Of List<String>Weeks - The days of the week to evaluate the trigger on
- end
Time String - UTC time to stop evaluating the trigger in HH:mm format
- start
Time String - UTC time to start evaluating the trigger in HH:mm format
TriggerRecipient, TriggerRecipientArgs
- Id string
- The ID of an existing recipient.
- Notification
Details List<TriggerRecipient Notification Detail> - Additional details to send along with the notification.
- Target string
- Target of the notification, this has another meaning depending on the type of recipient.
- Type string
- The type of the notification recipient.
- Id string
- The ID of an existing recipient.
- Notification
Details []TriggerRecipient Notification Detail - Additional details to send along with the notification.
- Target string
- Target of the notification, this has another meaning depending on the type of recipient.
- Type string
- The type of the notification recipient.
- id String
- The ID of an existing recipient.
- notification
Details List<TriggerRecipient Notification Detail> - Additional details to send along with the notification.
- target String
- Target of the notification, this has another meaning depending on the type of recipient.
- type String
- The type of the notification recipient.
- id string
- The ID of an existing recipient.
- notification
Details TriggerRecipient Notification Detail[] - Additional details to send along with the notification.
- target string
- Target of the notification, this has another meaning depending on the type of recipient.
- type string
- The type of the notification recipient.
- id str
- The ID of an existing recipient.
- notification_
details Sequence[TriggerRecipient Notification Detail] - Additional details to send along with the notification.
- target str
- Target of the notification, this has another meaning depending on the type of recipient.
- type str
- The type of the notification recipient.
- id String
- The ID of an existing recipient.
- notification
Details List<Property Map> - Additional details to send along with the notification.
- target String
- Target of the notification, this has another meaning depending on the type of recipient.
- type String
- The type of the notification recipient.
TriggerRecipientNotificationDetail, TriggerRecipientNotificationDetailArgs
- Pagerduty
Severity string - The severity to set with the PagerDuty notification. If no severity is provided, 'critical' is assumed.
- Variables
List<Trigger
Recipient Notification Detail Variable> - The variables to set with the webhook notification.
- Pagerduty
Severity string - The severity to set with the PagerDuty notification. If no severity is provided, 'critical' is assumed.
- Variables
[]Trigger
Recipient Notification Detail Variable - The variables to set with the webhook notification.
- pagerduty
Severity String - The severity to set with the PagerDuty notification. If no severity is provided, 'critical' is assumed.
- variables
List<Trigger
Recipient Notification Detail Variable> - The variables to set with the webhook notification.
- pagerduty
Severity string - The severity to set with the PagerDuty notification. If no severity is provided, 'critical' is assumed.
- variables
Trigger
Recipient Notification Detail Variable[] - The variables to set with the webhook notification.
- pagerduty_
severity str - The severity to set with the PagerDuty notification. If no severity is provided, 'critical' is assumed.
- variables
Sequence[Trigger
Recipient Notification Detail Variable] - The variables to set with the webhook notification.
- pagerduty
Severity String - The severity to set with the PagerDuty notification. If no severity is provided, 'critical' is assumed.
- variables List<Property Map>
- The variables to set with the webhook notification.
TriggerRecipientNotificationDetailVariable, TriggerRecipientNotificationDetailVariableArgs
TriggerThreshold, TriggerThresholdArgs
- Op string
- The operator to apply.
- Value double
- The value to be used with the operator.
- Exceeded
Limit double - The number of times the threshold is met before an alert is sent. Defaults to 1.
- Op string
- The operator to apply.
- Value float64
- The value to be used with the operator.
- Exceeded
Limit float64 - The number of times the threshold is met before an alert is sent. Defaults to 1.
- op String
- The operator to apply.
- value Double
- The value to be used with the operator.
- exceeded
Limit Double - The number of times the threshold is met before an alert is sent. Defaults to 1.
- op string
- The operator to apply.
- value number
- The value to be used with the operator.
- exceeded
Limit number - The number of times the threshold is met before an alert is sent. Defaults to 1.
- op str
- The operator to apply.
- value 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. Defaults to 1.
- op String
- The operator to apply.
- value Number
- The value to be used with the operator.
- exceeded
Limit Number - The number of times the threshold is met before an alert is sent. Defaults to 1.
Import
Environment-wide Trigger
$ pulumi import honeycombio:index/trigger:Trigger my_trigger bj9BwOb1uJz
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
honeycombioTerraform Provider.
