@pulumiverse/sentry
Version:
A Pulumi package for creating and managing Sentry resources.
388 lines • 13 kB
JavaScript
"use strict";
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.SentryDashboard = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Sentry Dashboard resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as sentry from "@pulumiverse/sentry";
*
* const main = new sentry.SentryDashboard("main", {
* organization: mainSentryOrganization.id,
* title: "Test dashboard",
* widgets: [
* {
* title: "Number of Errors",
* displayType: "big_number",
* interval: "5m",
* widgetType: "discover",
* queries: [{
* fields: ["count()"],
* aggregates: ["count()"],
* conditions: "!event.type:transaction",
* orderBy: "count()",
* }],
* layout: {
* x: 0,
* y: 0,
* w: 1,
* h: 1,
* minH: 1,
* },
* },
* {
* title: "Number of Issues",
* displayType: "big_number",
* interval: "5m",
* widgetType: "discover",
* queries: [{
* fields: ["count_unique(issue)"],
* aggregates: ["count_unique(issue)"],
* conditions: "!event.type:transaction",
* orderBy: "count_unique(issue)",
* }],
* layout: {
* x: 1,
* y: 0,
* w: 1,
* h: 1,
* minH: 1,
* },
* },
* {
* title: "Events",
* displayType: "line",
* interval: "5m",
* widgetType: "discover",
* queries: [{
* name: "Events",
* fields: ["count()"],
* aggregates: ["count()"],
* conditions: "!event.type:transaction",
* orderBy: "count()",
* }],
* layout: {
* x: 2,
* y: 0,
* w: 4,
* h: 2,
* minH: 2,
* },
* },
* {
* title: "Affected Users",
* displayType: "line",
* interval: "5m",
* widgetType: "discover",
* queries: [
* {
* name: "Known Users",
* fields: ["count_unique(user)"],
* aggregates: ["count_unique(user)"],
* conditions: "has:user.email !event.type:transaction",
* orderBy: "count_unique(user)",
* },
* {
* name: "Anonymous Users",
* fields: ["count_unique(user)"],
* aggregates: ["count_unique(user)"],
* conditions: "!has:user.email !event.type:transaction",
* orderBy: "count_unique(user)",
* },
* ],
* layout: {
* x: 1,
* y: 2,
* w: 1,
* h: 2,
* minH: 2,
* },
* },
* {
* title: "Handled vs. Unhandled",
* displayType: "line",
* interval: "5m",
* widgetType: "discover",
* queries: [
* {
* name: "Handled",
* fields: ["count()"],
* aggregates: ["count()"],
* conditions: "error.handled:true",
* orderBy: "count()",
* },
* {
* name: "Unhandled",
* fields: ["count()"],
* aggregates: ["count()"],
* conditions: "error.handled:false",
* orderBy: "count()",
* },
* ],
* layout: {
* x: 0,
* y: 2,
* w: 1,
* h: 2,
* minH: 2,
* },
* },
* {
* title: "Errors by Country",
* displayType: "world_map",
* interval: "5m",
* widgetType: "discover",
* queries: [{
* fields: ["count()"],
* aggregates: ["count()"],
* conditions: "!event.type:transaction has:geo.country_code",
* orderBy: "count()",
* }],
* layout: {
* x: 4,
* y: 6,
* w: 2,
* h: 4,
* minH: 2,
* },
* },
* {
* title: "High Throughput Transactions",
* displayType: "table",
* interval: "5m",
* widgetType: "discover",
* queries: [{
* fields: [
* "count()",
* "transaction",
* ],
* aggregates: ["count()"],
* columns: ["transaction"],
* conditions: "!event.type:error",
* orderBy: "-count()",
* }],
* layout: {
* x: 0,
* y: 6,
* w: 2,
* h: 4,
* minH: 2,
* },
* },
* {
* title: "Errors by Browser",
* displayType: "table",
* interval: "5m",
* widgetType: "discover",
* queries: [{
* fields: [
* "browser.name",
* "count()",
* ],
* aggregates: ["count()"],
* columns: ["browser.name"],
* conditions: "!event.type:transaction has:browser.name",
* orderBy: "-count()",
* }],
* layout: {
* x: 5,
* y: 2,
* w: 1,
* h: 4,
* minH: 2,
* },
* },
* {
* title: "Overall User Misery",
* displayType: "big_number",
* interval: "5m",
* widgetType: "discover",
* queries: [{
* fields: ["user_misery(300)"],
* aggregates: ["user_misery(300)"],
* }],
* layout: {
* x: 0,
* y: 1,
* w: 1,
* h: 1,
* minH: 1,
* },
* },
* {
* title: "Overall Apdex",
* displayType: "big_number",
* interval: "5m",
* widgetType: "discover",
* queries: [{
* fields: ["apdex(300)"],
* aggregates: ["apdex(300)"],
* }],
* layout: {
* x: 1,
* y: 1,
* w: 1,
* h: 1,
* minH: 1,
* },
* },
* {
* title: "High Throughput Transactions",
* displayType: "top_n",
* interval: "5m",
* widgetType: "discover",
* queries: [{
* fields: [
* "transaction",
* "count()",
* ],
* aggregates: ["count()"],
* columns: ["transaction"],
* conditions: "!event.type:error",
* orderBy: "-count()",
* }],
* layout: {
* x: 0,
* y: 4,
* w: 2,
* h: 2,
* minH: 2,
* },
* },
* {
* title: "Issues Assigned to Me or My Teams",
* displayType: "table",
* interval: "5m",
* widgetType: "issue",
* queries: [{
* fields: [
* "assignee",
* "issue",
* "title",
* ],
* columns: [
* "assignee",
* "issue",
* "title",
* ],
* conditions: "assigned_or_suggested:me is:unresolved",
* orderBy: "priority",
* }],
* layout: {
* x: 2,
* y: 2,
* w: 2,
* h: 4,
* minH: 2,
* },
* },
* {
* title: "Transactions Ordered by Misery",
* displayType: "table",
* interval: "5m",
* widgetType: "discover",
* queries: [{
* fields: [
* "transaction",
* "user_misery(300)",
* ],
* aggregates: ["user_misery(300)"],
* columns: ["transaction"],
* orderBy: "-user_misery(300)",
* }],
* layout: {
* x: 2,
* y: 6,
* w: 2,
* h: 4,
* minH: 2,
* },
* },
* {
* title: "Errors by Browser Over Time",
* displayType: "top_n",
* interval: "5m",
* widgetType: "discover",
* queries: [{
* fields: [
* "browser.name",
* "count()",
* ],
* aggregates: ["count()"],
* columns: ["browser.name"],
* conditions: "event.type:error has:browser.name",
* orderBy: "-count()",
* }],
* layout: {
* x: 4,
* y: 2,
* w: 1,
* h: 4,
* minH: 2,
* },
* },
* ],
* });
* ```
*/
class SentryDashboard extends pulumi.CustomResource {
/**
* Get an existing SentryDashboard 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, id, state, opts) {
return new SentryDashboard(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of SentryDashboard. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === SentryDashboard.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["internalId"] = state ? state.internalId : undefined;
resourceInputs["organization"] = state ? state.organization : undefined;
resourceInputs["title"] = state ? state.title : undefined;
resourceInputs["widgets"] = state ? state.widgets : undefined;
}
else {
const args = argsOrState;
if ((!args || args.organization === undefined) && !opts.urn) {
throw new Error("Missing required property 'organization'");
}
if ((!args || args.title === undefined) && !opts.urn) {
throw new Error("Missing required property 'title'");
}
resourceInputs["organization"] = args ? args.organization : undefined;
resourceInputs["title"] = args ? args.title : undefined;
resourceInputs["widgets"] = args ? args.widgets : undefined;
resourceInputs["internalId"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(SentryDashboard.__pulumiType, name, resourceInputs, opts);
}
}
exports.SentryDashboard = SentryDashboard;
/** @internal */
SentryDashboard.__pulumiType = 'sentry:index/sentryDashboard:SentryDashboard';
//# sourceMappingURL=sentryDashboard.js.map