@pulumi/signalfx
Version:
A Pulumi package for creating and managing SignalFx resources.
401 lines (400 loc) • 17.6 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
/**
* Provides a Splunk Observability Cloud detector resource. This can be used to create and manage detectors.
*
* If you're interested in using Splunk Observability Cloud detector features such as Historical Anomaly, Resource Running Out, or others, consider building them in the UI first and then use the "Show SignalFlow" feature to extract the value for `programText`. You can also see the [documentation for detector functions in signalflow-library](https://github.com/signalfx/signalflow-library/tree/master/library/signalfx/detectors).
*
* > **NOTE** When you want to change or remove write permissions for a user other than yourself regarding detectors, use a session token of an administrator to authenticate the Splunk Observability Cloud provider. See [Operations that require a session token for an administrator](https://dev.splunk.com/observability/docs/administration/authtokens#Operations-that-require-a-session-token-for-an-administrator).
*
* ## Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as signalfx from "@pulumi/signalfx";
*
* const config = new pulumi.Config();
* const clusters = config.getObject<any>("clusters") || [
* "clusterA",
* "clusterB",
* ];
* const applicationDelay: signalfx.Detector[] = [];
* for (const range = {value: 0}; range.value < clusters.length; range.value++) {
* applicationDelay.push(new signalfx.Detector(`application_delay-${range.value}`, {
* name: ` max average delay - ${clusters[range.value]}`,
* description: `your application is slow - ${clusters[range.value]}`,
* maxDelay: 30,
* tags: [
* "app-backend",
* "staging",
* ],
* authorizedWriterTeams: [mycoolteam.id],
* authorizedWriterUsers: ["abc123"],
* programText: `signal = data('app.delay', filter('cluster','${clusters[range.value]}'), extrapolation='last_value', maxExtrapolations=5).max()
* detect(when(signal > 60, '5m')).publish('Processing old messages 5m')
* detect(when(signal > 60, '30m')).publish('Processing old messages 30m')
* `,
* rules: [
* {
* description: "maximum > 60 for 5m",
* severity: "Warning",
* detectLabel: "Processing old messages 5m",
* notifications: ["Email,foo-alerts@bar.com"],
* },
* {
* description: "maximum > 60 for 30m",
* severity: "Critical",
* detectLabel: "Processing old messages 30m",
* notifications: ["Email,foo-alerts@bar.com"],
* },
* ],
* }));
* }
* ```
*
* ## Notification format
*
* As Splunk Observability Cloud supports different notification mechanisms, use a comma-delimited string to provide inputs. If you want to specify multiple notifications, each must be a member in the list, like so:
*
* See [Splunk Observability Cloud Docs](https://dev.splunk.com/observability/reference/api/detectors/latest) for more information.
*
* Here are some example of how to configure each notification type:
*
* ### Email
*
* ### Jira
*
* Note that the `credentialId` is the Splunk-provided ID shown after setting up your Jira integration. See also `signalfx.jira.Integration`.
*
* ### OpsGenie
*
* Note that the `credentialId` is the Splunk-provided ID shown after setting up your Opsgenie integration. `Team` here is hardcoded as the `responderType` as that is the only acceptable type as per the API docs.
*
* ### PagerDuty
*
* ### Slack
*
* Exclude the `#` on the channel name:
*
* ### Team
*
* Sends [notifications to a team](https://docs.signalfx.com/en/latest/managing/teams/team-notifications.html).
*
* ### TeamEmail
*
* Sends an email to every member of a team.
*
* ### Splunk On-Call (formerly VictorOps)
*
* ### Webhooks
*
* You need to include all the commas even if you only use a credential id.
*
* You can either configure a Webhook to use an existing integration's credential id:
*
* Or configure one inline:
*
* ## Import
*
* Detectors can be imported using their string ID (recoverable from URL: `/#/detector/v2/abc123/edit`, e.g.
*
* ```sh
* $ pulumi import signalfx:index/detector:Detector application_delay abc123
* ```
*/
export declare class Detector extends pulumi.CustomResource {
/**
* Get an existing Detector resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DetectorState, opts?: pulumi.CustomResourceOptions): Detector;
/**
* Returns true if the given object is an instance of Detector. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is Detector;
/**
* Team IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's team id (or user id in `authorizedWriterUsers`).
*/
readonly authorizedWriterTeams: pulumi.Output<string[] | undefined>;
/**
* User IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's user id (or team id in `authorizedWriterTeams`).
*/
readonly authorizedWriterUsers: pulumi.Output<string[] | undefined>;
/**
* Description of the detector.
*/
readonly description: pulumi.Output<string | undefined>;
/**
* Indicates how a detector was created. The possible values are: Standard and AutoDetectCustomization. The value can only be set when creating the detector and cannot be modified later.
*/
readonly detectorOrigin: pulumi.Output<string | undefined>;
/**
* When `false`, the visualization may sample the output timeseries rather than displaying them all. `false` by default.
*/
readonly disableSampling: pulumi.Output<boolean | undefined>;
/**
* Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
*/
readonly endTime: pulumi.Output<number | undefined>;
/**
* The resolutions of the detector alerts in milliseconds that indicate how often data is analyzed to determine if an alert should be triggered.
*/
readonly labelResolutions: pulumi.Output<{
[key: string]: number;
}>;
/**
* allows Splunk Observability Cloud to continue with computation if there is a lag in receiving data points.
*/
readonly maxDelay: pulumi.Output<number | undefined>;
/**
* How long (in seconds) to wait even if the datapoints are arriving in a timely fashion. Max value is 900 (15m).
*/
readonly minDelay: pulumi.Output<number | undefined>;
/**
* Name of the detector.
*/
readonly name: pulumi.Output<string>;
/**
* ID of the AutoDetect parent detector from which this detector is customized and created. This property is required for detectors with detectorOrigin of type AutoDetectCustomization. The value can only be set when creating the detector and cannot be modified later.
*/
readonly parentDetectorId: pulumi.Output<string | undefined>;
/**
* Signalflow program text for the detector. More info [in the Splunk Observability Cloud docs](https://dev.splunk.com/observability/docs/signalflow/).
*/
readonly programText: pulumi.Output<string>;
/**
* Set of rules used for alerting.
*/
readonly rules: pulumi.Output<outputs.DetectorRule[]>;
/**
* When `true`, markers will be drawn for each datapoint within the visualization. `true` by default.
*/
readonly showDataMarkers: pulumi.Output<boolean | undefined>;
/**
* When `true`, the visualization will display a vertical line for each event trigger. `false` by default.
*/
readonly showEventLines: pulumi.Output<boolean | undefined>;
/**
* Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
*/
readonly startTime: pulumi.Output<number | undefined>;
/**
* Tags associated with the detector.
*/
readonly tags: pulumi.Output<string[] | undefined>;
/**
* Team IDs to associate the detector to.
*/
readonly teams: pulumi.Output<string[] | undefined>;
/**
* Seconds to display in the visualization. This is a rolling range from the current time. Example: `3600` corresponds to `-1h` in web UI. `3600` by default.
*/
readonly timeRange: pulumi.Output<number | undefined>;
/**
* The property value is a string that denotes the geographic region associated with the time zone, (e.g. Australia/Sydney)
*/
readonly timezone: pulumi.Output<string | undefined>;
/**
* The URL of the detector.
*/
readonly url: pulumi.Output<string>;
/**
* Plot-level customization options, associated with a publish statement.
*/
readonly vizOptions: pulumi.Output<outputs.DetectorVizOption[] | undefined>;
/**
* Create a Detector resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: DetectorArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Detector resources.
*/
export interface DetectorState {
/**
* Team IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's team id (or user id in `authorizedWriterUsers`).
*/
authorizedWriterTeams?: pulumi.Input<pulumi.Input<string>[]>;
/**
* User IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's user id (or team id in `authorizedWriterTeams`).
*/
authorizedWriterUsers?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Description of the detector.
*/
description?: pulumi.Input<string>;
/**
* Indicates how a detector was created. The possible values are: Standard and AutoDetectCustomization. The value can only be set when creating the detector and cannot be modified later.
*/
detectorOrigin?: pulumi.Input<string>;
/**
* When `false`, the visualization may sample the output timeseries rather than displaying them all. `false` by default.
*/
disableSampling?: pulumi.Input<boolean>;
/**
* Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
*/
endTime?: pulumi.Input<number>;
/**
* The resolutions of the detector alerts in milliseconds that indicate how often data is analyzed to determine if an alert should be triggered.
*/
labelResolutions?: pulumi.Input<{
[key: string]: pulumi.Input<number>;
}>;
/**
* allows Splunk Observability Cloud to continue with computation if there is a lag in receiving data points.
*/
maxDelay?: pulumi.Input<number>;
/**
* How long (in seconds) to wait even if the datapoints are arriving in a timely fashion. Max value is 900 (15m).
*/
minDelay?: pulumi.Input<number>;
/**
* Name of the detector.
*/
name?: pulumi.Input<string>;
/**
* ID of the AutoDetect parent detector from which this detector is customized and created. This property is required for detectors with detectorOrigin of type AutoDetectCustomization. The value can only be set when creating the detector and cannot be modified later.
*/
parentDetectorId?: pulumi.Input<string>;
/**
* Signalflow program text for the detector. More info [in the Splunk Observability Cloud docs](https://dev.splunk.com/observability/docs/signalflow/).
*/
programText?: pulumi.Input<string>;
/**
* Set of rules used for alerting.
*/
rules?: pulumi.Input<pulumi.Input<inputs.DetectorRule>[]>;
/**
* When `true`, markers will be drawn for each datapoint within the visualization. `true` by default.
*/
showDataMarkers?: pulumi.Input<boolean>;
/**
* When `true`, the visualization will display a vertical line for each event trigger. `false` by default.
*/
showEventLines?: pulumi.Input<boolean>;
/**
* Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
*/
startTime?: pulumi.Input<number>;
/**
* Tags associated with the detector.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Team IDs to associate the detector to.
*/
teams?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Seconds to display in the visualization. This is a rolling range from the current time. Example: `3600` corresponds to `-1h` in web UI. `3600` by default.
*/
timeRange?: pulumi.Input<number>;
/**
* The property value is a string that denotes the geographic region associated with the time zone, (e.g. Australia/Sydney)
*/
timezone?: pulumi.Input<string>;
/**
* The URL of the detector.
*/
url?: pulumi.Input<string>;
/**
* Plot-level customization options, associated with a publish statement.
*/
vizOptions?: pulumi.Input<pulumi.Input<inputs.DetectorVizOption>[]>;
}
/**
* The set of arguments for constructing a Detector resource.
*/
export interface DetectorArgs {
/**
* Team IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's team id (or user id in `authorizedWriterUsers`).
*/
authorizedWriterTeams?: pulumi.Input<pulumi.Input<string>[]>;
/**
* User IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's user id (or team id in `authorizedWriterTeams`).
*/
authorizedWriterUsers?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Description of the detector.
*/
description?: pulumi.Input<string>;
/**
* Indicates how a detector was created. The possible values are: Standard and AutoDetectCustomization. The value can only be set when creating the detector and cannot be modified later.
*/
detectorOrigin?: pulumi.Input<string>;
/**
* When `false`, the visualization may sample the output timeseries rather than displaying them all. `false` by default.
*/
disableSampling?: pulumi.Input<boolean>;
/**
* Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
*/
endTime?: pulumi.Input<number>;
/**
* allows Splunk Observability Cloud to continue with computation if there is a lag in receiving data points.
*/
maxDelay?: pulumi.Input<number>;
/**
* How long (in seconds) to wait even if the datapoints are arriving in a timely fashion. Max value is 900 (15m).
*/
minDelay?: pulumi.Input<number>;
/**
* Name of the detector.
*/
name?: pulumi.Input<string>;
/**
* ID of the AutoDetect parent detector from which this detector is customized and created. This property is required for detectors with detectorOrigin of type AutoDetectCustomization. The value can only be set when creating the detector and cannot be modified later.
*/
parentDetectorId?: pulumi.Input<string>;
/**
* Signalflow program text for the detector. More info [in the Splunk Observability Cloud docs](https://dev.splunk.com/observability/docs/signalflow/).
*/
programText: pulumi.Input<string>;
/**
* Set of rules used for alerting.
*/
rules: pulumi.Input<pulumi.Input<inputs.DetectorRule>[]>;
/**
* When `true`, markers will be drawn for each datapoint within the visualization. `true` by default.
*/
showDataMarkers?: pulumi.Input<boolean>;
/**
* When `true`, the visualization will display a vertical line for each event trigger. `false` by default.
*/
showEventLines?: pulumi.Input<boolean>;
/**
* Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
*/
startTime?: pulumi.Input<number>;
/**
* Tags associated with the detector.
*/
tags?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Team IDs to associate the detector to.
*/
teams?: pulumi.Input<pulumi.Input<string>[]>;
/**
* Seconds to display in the visualization. This is a rolling range from the current time. Example: `3600` corresponds to `-1h` in web UI. `3600` by default.
*/
timeRange?: pulumi.Input<number>;
/**
* The property value is a string that denotes the geographic region associated with the time zone, (e.g. Australia/Sydney)
*/
timezone?: pulumi.Input<string>;
/**
* Plot-level customization options, associated with a publish statement.
*/
vizOptions?: pulumi.Input<pulumi.Input<inputs.DetectorVizOption>[]>;
}