UNPKG

@pulumi/sumologic

Version:

A Pulumi package for creating and managing sumologic cloud resources.

363 lines (362 loc) 13.1 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Provides the ability to create, read, delete, and update SLOs. * * ## Example SLO * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as sumologic from "@pulumi/sumologic"; * * const sloTfWindowMetricRatio = new sumologic.Slo("slo_tf_window_metric_ratio", { * name: "login error rate", * description: "per minute login error rate over rolling 7 days", * parentId: "0000000000000001", * signalType: "Error", * service: "auth", * application: "login", * tags: { * team: "metrics", * application: "sumologic", * }, * compliances: [{ * complianceType: "Rolling", * size: "7d", * target: 95, * timezone: "Asia/Kolkata", * }], * indicator: { * windowBasedEvaluation: { * op: "LessThan", * queryType: "Metrics", * size: "1m", * threshold: 99, * queries: [ * { * queryGroupType: "Unsuccessful", * queryGroups: [{ * rowId: "A", * query: "service=auth api=login metric=HTTP_5XX_Count", * useRowCount: false, * }], * }, * { * queryGroupType: "Total", * queryGroups: [{ * rowId: "A", * query: "service=auth api=login metric=TotalRequests", * useRowCount: false, * }], * }, * ], * }, * }, * }); * const sloTfWindowBased = new sumologic.Slo("slo_tf_window_based", { * name: "slo-tf-window-based", * description: "example SLO created with terraform", * parentId: "0000000000000001", * signalType: "Latency", * service: "auth", * application: "login", * tags: { * team: "metrics", * application: "sumologic", * }, * compliances: [{ * complianceType: "Rolling", * size: "7d", * target: 99, * timezone: "Asia/Kolkata", * }], * indicator: { * windowBasedEvaluation: { * op: "LessThan", * queryType: "Metrics", * aggregation: "Avg", * size: "1m", * threshold: 200, * queries: [{ * queryGroupType: "Threshold", * queryGroups: [{ * rowId: "A", * query: "metric=request_time_p90 service=auth api=login", * useRowCount: false, * }], * }], * }, * }, * }); * const sloTfRequestBased = new sumologic.Slo("slo_tf_request_based", { * name: "slo-tf-request-based", * description: "example SLO created with terraform for request based SLI", * parentId: tfSloFolder.id, * signalType: "Latency", * service: "auth", * application: "login", * tags: { * team: "metrics", * application: "sumologic", * }, * compliances: [{ * complianceType: "Rolling", * size: "7d", * target: 99, * timezone: "Asia/Kolkata", * }], * indicator: { * requestBasedEvaluation: { * op: "LessThanOrEqual", * queryType: "Logs", * threshold: 1, * queries: [{ * queryGroupType: "Threshold", * queryGroups: [{ * rowId: "A", * query: ` cluster=sedemostaging namespace=warp004* * | parse "Coffee preparation request time: * ms" as latency nodrop * | if(isBlank(latency), "false", "true") as hasLatency * | where hasLatency = "true" * | if(isBlank(latency), 0.0, latency) as latency * | latency/ 1000 as latency_sec * `, * useRowCount: false, * field: "latency_sec", * }], * }], * }, * }, * }); * const sloTfMonitorBased = new sumologic.Slo("slo_tf_monitor_based", { * name: "slo-tf-monitor-based", * description: "example of monitor based SLO created with terraform", * parentId: "0000000000000001", * signalType: "Error", * service: "auth", * application: "login", * tags: { * team: "metrics", * application: "sumologic", * }, * compliances: [{ * complianceType: "Rolling", * size: "7d", * target: 99, * timezone: "Asia/Kolkata", * }], * indicator: { * monitorBasedEvaluation: { * monitorTriggers: { * monitorId: "0000000000BCB3A4", * triggerTypes: "Critical", * }, * }, * }, * }); * ``` */ export declare class Slo extends pulumi.CustomResource { /** * Get an existing Slo 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?: SloState, opts?: pulumi.CustomResourceOptions): Slo; /** * Returns true if the given object is an instance of Slo. 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 Slo; /** * Name of the application. */ readonly application: pulumi.Output<string>; /** * The compliance settings for the SLO. */ readonly compliances: pulumi.Output<outputs.SloCompliance[]>; readonly createdAt: pulumi.Output<string>; readonly createdBy: pulumi.Output<string>; /** * The description of the SLO. */ readonly description: pulumi.Output<string | undefined>; /** * The service level indicator on which SLO is to be defined. more details on the difference * b/w them can be found on * the [slo help page](https://help.sumologic.com/Beta/SLO_Reliability_Management/Access_and_Create_SLOs) * - windowBasedEvaluation - Evaluate SLI using successful/total windows. * - requestBasedEvaluation - Evaluate SLI based on occurrence of successful * events / total events over entire compliance period. * - monitorBasedEvaluation - SLIs for Monitor-based SLOs are calculated at a granularity of 1 minute. A minute is treated as unsuccessful if the Monitor threshold is violated at any point of time within that minute. */ readonly indicator: pulumi.Output<outputs.SloIndicator>; readonly isLocked: pulumi.Output<boolean | undefined>; readonly isMutable: pulumi.Output<boolean>; readonly isSystem: pulumi.Output<boolean>; readonly modifiedAt: pulumi.Output<string>; readonly modifiedBy: pulumi.Output<string>; /** * The name of the SLO. The name must be alphanumeric. */ readonly name: pulumi.Output<string>; /** * The ID of the SLO Folder that contains this SLO. Defaults to the root folder. */ readonly parentId: pulumi.Output<string>; readonly postRequestMap: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Name of the service. */ readonly service: pulumi.Output<string>; /** * The type of SLO. Valid values are `Latency`, `Error`, `Throughput`, `Availability` * , `Other`. Defaults to `Latency`. */ readonly signalType: pulumi.Output<string>; /** * A map defining tag keys and tag values for the SLO. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; readonly version: pulumi.Output<number>; /** * Create a Slo 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: SloArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Slo resources. */ export interface SloState { /** * Name of the application. */ application?: pulumi.Input<string>; /** * The compliance settings for the SLO. */ compliances?: pulumi.Input<pulumi.Input<inputs.SloCompliance>[]>; createdAt?: pulumi.Input<string>; createdBy?: pulumi.Input<string>; /** * The description of the SLO. */ description?: pulumi.Input<string>; /** * The service level indicator on which SLO is to be defined. more details on the difference * b/w them can be found on * the [slo help page](https://help.sumologic.com/Beta/SLO_Reliability_Management/Access_and_Create_SLOs) * - windowBasedEvaluation - Evaluate SLI using successful/total windows. * - requestBasedEvaluation - Evaluate SLI based on occurrence of successful * events / total events over entire compliance period. * - monitorBasedEvaluation - SLIs for Monitor-based SLOs are calculated at a granularity of 1 minute. A minute is treated as unsuccessful if the Monitor threshold is violated at any point of time within that minute. */ indicator?: pulumi.Input<inputs.SloIndicator>; isLocked?: pulumi.Input<boolean>; isMutable?: pulumi.Input<boolean>; isSystem?: pulumi.Input<boolean>; modifiedAt?: pulumi.Input<string>; modifiedBy?: pulumi.Input<string>; /** * The name of the SLO. The name must be alphanumeric. */ name?: pulumi.Input<string>; /** * The ID of the SLO Folder that contains this SLO. Defaults to the root folder. */ parentId?: pulumi.Input<string>; postRequestMap?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Name of the service. */ service?: pulumi.Input<string>; /** * The type of SLO. Valid values are `Latency`, `Error`, `Throughput`, `Availability` * , `Other`. Defaults to `Latency`. */ signalType?: pulumi.Input<string>; /** * A map defining tag keys and tag values for the SLO. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; version?: pulumi.Input<number>; } /** * The set of arguments for constructing a Slo resource. */ export interface SloArgs { /** * Name of the application. */ application?: pulumi.Input<string>; /** * The compliance settings for the SLO. */ compliances: pulumi.Input<pulumi.Input<inputs.SloCompliance>[]>; createdAt?: pulumi.Input<string>; createdBy?: pulumi.Input<string>; /** * The description of the SLO. */ description?: pulumi.Input<string>; /** * The service level indicator on which SLO is to be defined. more details on the difference * b/w them can be found on * the [slo help page](https://help.sumologic.com/Beta/SLO_Reliability_Management/Access_and_Create_SLOs) * - windowBasedEvaluation - Evaluate SLI using successful/total windows. * - requestBasedEvaluation - Evaluate SLI based on occurrence of successful * events / total events over entire compliance period. * - monitorBasedEvaluation - SLIs for Monitor-based SLOs are calculated at a granularity of 1 minute. A minute is treated as unsuccessful if the Monitor threshold is violated at any point of time within that minute. */ indicator: pulumi.Input<inputs.SloIndicator>; isLocked?: pulumi.Input<boolean>; isMutable?: pulumi.Input<boolean>; isSystem?: pulumi.Input<boolean>; modifiedAt?: pulumi.Input<string>; modifiedBy?: pulumi.Input<string>; /** * The name of the SLO. The name must be alphanumeric. */ name?: pulumi.Input<string>; /** * The ID of the SLO Folder that contains this SLO. Defaults to the root folder. */ parentId?: pulumi.Input<string>; postRequestMap?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Name of the service. */ service?: pulumi.Input<string>; /** * The type of SLO. Valid values are `Latency`, `Error`, `Throughput`, `Availability` * , `Other`. Defaults to `Latency`. */ signalType: pulumi.Input<string>; /** * A map defining tag keys and tag values for the SLO. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; version?: pulumi.Input<number>; }