Dashboard

Use this resource to create and manage New Relic dashboards.

Additional Examples

Create cross-account widgets in your dashboard.

The example below shows how you can display data for an application from a primary account and an application from a subaccount. In order to create cross-account widgets, you must use an API key from a user with admin permissions in the primary account. Please see the widget attribute documentation for more details.

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

const primaryAccountApplication = newrelic.getEntity({
    name: "Main Account Application Name",
    type: "APPLICATION",
    domain: "APM",
});
const subaccountApplication = newrelic.getEntity({
    name: "Subaccount Application Name",
    type: "APPLICATION",
    domain: "APM",
});
const crossAccountWidgetExample = new newrelic.Dashboard("crossAccountWidgetExample", {
    title: "tf-test-cross-account-widget-dashboard",
    filter: {
        eventTypes: ["Transaction"],
        attributes: [
            "appName",
            "envName",
        ],
    },
    gridColumnCount: 12,
    widgets: [
        {
            title: "Apdex (primary account)",
            row: 1,
            column: 1,
            width: 6,
            height: 3,
            visualization: "metric_line_chart",
            duration: 1800000,
            metrics: [{
                name: "Apdex",
                values: ["score"],
            }],
            entityIds: [primaryAccountApplication.then(primaryAccountApplication => primaryAccountApplication.applicationId)],
        },
        {
            accountId: _var.subaccount_id,
            title: "Apdex (subaccount)",
            row: 1,
            column: 7,
            width: 6,
            height: 3,
            visualization: "metric_line_chart",
            duration: 1800000,
            metrics: [{
                name: "Apdex",
                values: ["score"],
            }],
            entityIds: [subaccountApplication.then(subaccountApplication => subaccountApplication.applicationId)],
        },
    ],
});
import pulumi
import pulumi_newrelic as newrelic

primary_account_application = newrelic.get_entity(name="Main Account Application Name",
    type="APPLICATION",
    domain="APM")
subaccount_application = newrelic.get_entity(name="Subaccount Application Name",
    type="APPLICATION",
    domain="APM")
cross_account_widget_example = newrelic.Dashboard("crossAccountWidgetExample",
    title="tf-test-cross-account-widget-dashboard",
    filter=newrelic.DashboardFilterArgs(
        event_types=["Transaction"],
        attributes=[
            "appName",
            "envName",
        ],
    ),
    grid_column_count=12,
    widgets=[
        newrelic.DashboardWidgetArgs(
            title="Apdex (primary account)",
            row=1,
            column=1,
            width=6,
            height=3,
            visualization="metric_line_chart",
            duration=1800000,
            metrics=[newrelic.DashboardWidgetMetricArgs(
                name="Apdex",
                values=["score"],
            )],
            entity_ids=[primary_account_application.application_id],
        ),
        newrelic.DashboardWidgetArgs(
            account_id=var["subaccount_id"],
            title="Apdex (subaccount)",
            row=1,
            column=7,
            width=6,
            height=3,
            visualization="metric_line_chart",
            duration=1800000,
            metrics=[newrelic.DashboardWidgetMetricArgs(
                name="Apdex",
                values=["score"],
            )],
            entity_ids=[subaccount_application.application_id],
        ),
    ])
using Pulumi;
using NewRelic = Pulumi.NewRelic;

class MyStack : Stack
{
    public MyStack()
    {
        var primaryAccountApplication = Output.Create(NewRelic.GetEntity.InvokeAsync(new NewRelic.GetEntityArgs
        {
            Name = "Main Account Application Name",
            Type = "APPLICATION",
            Domain = "APM",
        }));
        var subaccountApplication = Output.Create(NewRelic.GetEntity.InvokeAsync(new NewRelic.GetEntityArgs
        {
            Name = "Subaccount Application Name",
            Type = "APPLICATION",
            Domain = "APM",
        }));
        var crossAccountWidgetExample = new NewRelic.Dashboard("crossAccountWidgetExample", new NewRelic.DashboardArgs
        {
            Title = "tf-test-cross-account-widget-dashboard",
            Filter = new NewRelic.Inputs.DashboardFilterArgs
            {
                EventTypes = 
                {
                    "Transaction",
                },
                Attributes = 
                {
                    "appName",
                    "envName",
                },
            },
            GridColumnCount = 12,
            Widgets = 
            {
                new NewRelic.Inputs.DashboardWidgetArgs
                {
                    Title = "Apdex (primary account)",
                    Row = 1,
                    Column = 1,
                    Width = 6,
                    Height = 3,
                    Visualization = "metric_line_chart",
                    Duration = 1800000,
                    Metrics = 
                    {
                        new NewRelic.Inputs.DashboardWidgetMetricArgs
                        {
                            Name = "Apdex",
                            Values = 
                            {
                                "score",
                            },
                        },
                    },
                    EntityIds = 
                    {
                        primaryAccountApplication.Apply(primaryAccountApplication => primaryAccountApplication.ApplicationId),
                    },
                },
                new NewRelic.Inputs.DashboardWidgetArgs
                {
                    AccountId = @var.Subaccount_id,
                    Title = "Apdex (subaccount)",
                    Row = 1,
                    Column = 7,
                    Width = 6,
                    Height = 3,
                    Visualization = "metric_line_chart",
                    Duration = 1800000,
                    Metrics = 
                    {
                        new NewRelic.Inputs.DashboardWidgetMetricArgs
                        {
                            Name = "Apdex",
                            Values = 
                            {
                                "score",
                            },
                        },
                    },
                    EntityIds = 
                    {
                        subaccountApplication.Apply(subaccountApplication => subaccountApplication.ApplicationId),
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-newrelic/sdk/v4/go/newrelic"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "APPLICATION"
		opt1 := "APM"
		primaryAccountApplication, err := newrelic.GetEntity(ctx, &newrelic.GetEntityArgs{
			Name:   "Main Account Application Name",
			Type:   &opt0,
			Domain: &opt1,
		}, nil)
		if err != nil {
			return err
		}
		opt2 := "APPLICATION"
		opt3 := "APM"
		subaccountApplication, err := newrelic.GetEntity(ctx, &newrelic.GetEntityArgs{
			Name:   "Subaccount Application Name",
			Type:   &opt2,
			Domain: &opt3,
		}, nil)
		if err != nil {
			return err
		}
		_, err = newrelic.NewDashboard(ctx, "crossAccountWidgetExample", &newrelic.DashboardArgs{
			Title: pulumi.String("tf-test-cross-account-widget-dashboard"),
			Filter: &newrelic.DashboardFilterArgs{
				EventTypes: pulumi.StringArray{
					pulumi.String("Transaction"),
				},
				Attributes: pulumi.StringArray{
					pulumi.String("appName"),
					pulumi.String("envName"),
				},
			},
			GridColumnCount: pulumi.Int(12),
			Widgets: newrelic.DashboardWidgetArray{
				&newrelic.DashboardWidgetArgs{
					Title:         pulumi.String("Apdex (primary account)"),
					Row:           pulumi.Int(1),
					Column:        pulumi.Int(1),
					Width:         pulumi.Int(6),
					Height:        pulumi.Int(3),
					Visualization: pulumi.String("metric_line_chart"),
					Duration:      pulumi.Int(1800000),
					Metrics: newrelic.DashboardWidgetMetricArray{
						&newrelic.DashboardWidgetMetricArgs{
							Name: pulumi.String("Apdex"),
							Values: pulumi.StringArray{
								pulumi.String("score"),
							},
						},
					},
					EntityIds: pulumi.IntArray{
						pulumi.Int(primaryAccountApplication.ApplicationId),
					},
				},
				&newrelic.DashboardWidgetArgs{
					AccountId:     pulumi.Any(_var.Subaccount_id),
					Title:         pulumi.String("Apdex (subaccount)"),
					Row:           pulumi.Int(1),
					Column:        pulumi.Int(7),
					Width:         pulumi.Int(6),
					Height:        pulumi.Int(3),
					Visualization: pulumi.String("metric_line_chart"),
					Duration:      pulumi.Int(1800000),
					Metrics: newrelic.DashboardWidgetMetricArray{
						&newrelic.DashboardWidgetMetricArgs{
							Name: pulumi.String("Apdex"),
							Values: pulumi.StringArray{
								pulumi.String("score"),
							},
						},
					},
					EntityIds: pulumi.IntArray{
						pulumi.Int(subaccountApplication.ApplicationId),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Example Usage

Create A New Relic Dashboard

using Pulumi;
using NewRelic = Pulumi.NewRelic;

class MyStack : Stack
{
    public MyStack()
    {
        var myApplication = Output.Create(NewRelic.GetEntity.InvokeAsync(new NewRelic.GetEntityArgs
        {
            Name = "My Application",
            Type = "APPLICATION",
            Domain = "APM",
        }));
        var exampledash = new NewRelic.Dashboard("exampledash", new NewRelic.DashboardArgs
        {
            Title = "New Relic Terraform Example",
            Filter = new NewRelic.Inputs.DashboardFilterArgs
            {
                EventTypes = 
                {
                    "Transaction",
                },
                Attributes = 
                {
                    "appName",
                    "name",
                },
            },
            Widgets = 
            {
                new NewRelic.Inputs.DashboardWidgetArgs
                {
                    Title = "Requests per minute",
                    Visualization = "billboard",
                    Nrql = "SELECT rate(count(*), 1 minute) FROM Transaction",
                    Row = 1,
                    Column = 1,
                },
                new NewRelic.Inputs.DashboardWidgetArgs
                {
                    Title = "Error rate",
                    Visualization = "gauge",
                    Nrql = "SELECT percentage(count(*), WHERE error IS True) FROM Transaction",
                    ThresholdRed = 2.5,
                    Row = 1,
                    Column = 2,
                },
                new NewRelic.Inputs.DashboardWidgetArgs
                {
                    Title = "Average transaction duration, by application",
                    Visualization = "facet_bar_chart",
                    Nrql = "SELECT average(duration) FROM Transaction FACET appName",
                    Row = 1,
                    Column = 3,
                },
                new NewRelic.Inputs.DashboardWidgetArgs
                {
                    Title = "Apdex, top 5 by host",
                    Duration = 1800000,
                    Visualization = "metric_line_chart",
                    EntityIds = 
                    {
                        myApplication.Apply(myApplication => myApplication.ApplicationId),
                    },
                    Metrics = 
                    {
                        new NewRelic.Inputs.DashboardWidgetMetricArgs
                        {
                            Name = "Apdex",
                            Values = 
                            {
                                "score",
                            },
                        },
                    },
                    Facet = "host",
                    Limit = 5,
                    OrderBy = "score",
                    Row = 2,
                    Column = 1,
                },
                new NewRelic.Inputs.DashboardWidgetArgs
                {
                    Title = "Requests per minute, by transaction",
                    Visualization = "facet_table",
                    Nrql = "SELECT rate(count(*), 1 minute) FROM Transaction FACET name",
                    Row = 2,
                    Column = 2,
                },
                new NewRelic.Inputs.DashboardWidgetArgs
                {
                    Title = "Dashboard Note",
                    Visualization = "markdown",
                    Source = @"### Helpful Links

* [New Relic One](https://one.newrelic.com)
* [Developer Portal](https://developer.newrelic.com)",
                    Row = 2,
                    Column = 3,
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-newrelic/sdk/v4/go/newrelic"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "APPLICATION"
		opt1 := "APM"
		myApplication, err := newrelic.GetEntity(ctx, &newrelic.GetEntityArgs{
			Name:   "My Application",
			Type:   &opt0,
			Domain: &opt1,
		}, nil)
		if err != nil {
			return err
		}
		_, err = newrelic.NewDashboard(ctx, "exampledash", &newrelic.DashboardArgs{
			Title: pulumi.String("New Relic Terraform Example"),
			Filter: &newrelic.DashboardFilterArgs{
				EventTypes: pulumi.StringArray{
					pulumi.String("Transaction"),
				},
				Attributes: pulumi.StringArray{
					pulumi.String("appName"),
					pulumi.String("name"),
				},
			},
			Widgets: newrelic.DashboardWidgetArray{
				&newrelic.DashboardWidgetArgs{
					Title:         pulumi.String("Requests per minute"),
					Visualization: pulumi.String("billboard"),
					Nrql:          pulumi.String("SELECT rate(count(*), 1 minute) FROM Transaction"),
					Row:           pulumi.Int(1),
					Column:        pulumi.Int(1),
				},
				&newrelic.DashboardWidgetArgs{
					Title:         pulumi.String("Error rate"),
					Visualization: pulumi.String("gauge"),
					Nrql:          pulumi.String("SELECT percentage(count(*), WHERE error IS True) FROM Transaction"),
					ThresholdRed:  pulumi.Float64(2.5),
					Row:           pulumi.Int(1),
					Column:        pulumi.Int(2),
				},
				&newrelic.DashboardWidgetArgs{
					Title:         pulumi.String("Average transaction duration, by application"),
					Visualization: pulumi.String("facet_bar_chart"),
					Nrql:          pulumi.String("SELECT average(duration) FROM Transaction FACET appName"),
					Row:           pulumi.Int(1),
					Column:        pulumi.Int(3),
				},
				&newrelic.DashboardWidgetArgs{
					Title:         pulumi.String("Apdex, top 5 by host"),
					Duration:      pulumi.Int(1800000),
					Visualization: pulumi.String("metric_line_chart"),
					EntityIds: pulumi.IntArray{
						pulumi.Int(myApplication.ApplicationId),
					},
					Metrics: newrelic.DashboardWidgetMetricArray{
						&newrelic.DashboardWidgetMetricArgs{
							Name: pulumi.String("Apdex"),
							Values: pulumi.StringArray{
								pulumi.String("score"),
							},
						},
					},
					Facet:   pulumi.String("host"),
					Limit:   pulumi.Int(5),
					OrderBy: pulumi.String("score"),
					Row:     pulumi.Int(2),
					Column:  pulumi.Int(1),
				},
				&newrelic.DashboardWidgetArgs{
					Title:         pulumi.String("Requests per minute, by transaction"),
					Visualization: pulumi.String("facet_table"),
					Nrql:          pulumi.String("SELECT rate(count(*), 1 minute) FROM Transaction FACET name"),
					Row:           pulumi.Int(2),
					Column:        pulumi.Int(2),
				},
				&newrelic.DashboardWidgetArgs{
					Title:         pulumi.String("Dashboard Note"),
					Visualization: pulumi.String("markdown"),
					Source:        pulumi.String("### Helpful Links\n\n* [New Relic One](https://one.newrelic.com)\n* [Developer Portal](https://developer.newrelic.com)"),
					Row:           pulumi.Int(2),
					Column:        pulumi.Int(3),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_newrelic as newrelic

my_application = newrelic.get_entity(name="My Application",
    type="APPLICATION",
    domain="APM")
exampledash = newrelic.Dashboard("exampledash",
    title="New Relic Terraform Example",
    filter=newrelic.DashboardFilterArgs(
        event_types=["Transaction"],
        attributes=[
            "appName",
            "name",
        ],
    ),
    widgets=[
        newrelic.DashboardWidgetArgs(
            title="Requests per minute",
            visualization="billboard",
            nrql="SELECT rate(count(*), 1 minute) FROM Transaction",
            row=1,
            column=1,
        ),
        newrelic.DashboardWidgetArgs(
            title="Error rate",
            visualization="gauge",
            nrql="SELECT percentage(count(*), WHERE error IS True) FROM Transaction",
            threshold_red=2.5,
            row=1,
            column=2,
        ),
        newrelic.DashboardWidgetArgs(
            title="Average transaction duration, by application",
            visualization="facet_bar_chart",
            nrql="SELECT average(duration) FROM Transaction FACET appName",
            row=1,
            column=3,
        ),
        newrelic.DashboardWidgetArgs(
            title="Apdex, top 5 by host",
            duration=1800000,
            visualization="metric_line_chart",
            entity_ids=[my_application.application_id],
            metrics=[newrelic.DashboardWidgetMetricArgs(
                name="Apdex",
                values=["score"],
            )],
            facet="host",
            limit=5,
            order_by="score",
            row=2,
            column=1,
        ),
        newrelic.DashboardWidgetArgs(
            title="Requests per minute, by transaction",
            visualization="facet_table",
            nrql="SELECT rate(count(*), 1 minute) FROM Transaction FACET name",
            row=2,
            column=2,
        ),
        newrelic.DashboardWidgetArgs(
            title="Dashboard Note",
            visualization="markdown",
            source="""### Helpful Links

* [New Relic One](https://one.newrelic.com)
* [Developer Portal](https://developer.newrelic.com)""",
            row=2,
            column=3,
        ),
    ])
import * as pulumi from "@pulumi/pulumi";
import * as newrelic from "@pulumi/newrelic";

const myApplication = newrelic.getEntity({
    name: "My Application",
    type: "APPLICATION",
    domain: "APM",
});
const exampledash = new newrelic.Dashboard("exampledash", {
    title: "New Relic Terraform Example",
    filter: {
        eventTypes: ["Transaction"],
        attributes: [
            "appName",
            "name",
        ],
    },
    widgets: [
        {
            title: "Requests per minute",
            visualization: "billboard",
            nrql: "SELECT rate(count(*), 1 minute) FROM Transaction",
            row: 1,
            column: 1,
        },
        {
            title: "Error rate",
            visualization: "gauge",
            nrql: "SELECT percentage(count(*), WHERE error IS True) FROM Transaction",
            thresholdRed: 2.5,
            row: 1,
            column: 2,
        },
        {
            title: "Average transaction duration, by application",
            visualization: "facet_bar_chart",
            nrql: "SELECT average(duration) FROM Transaction FACET appName",
            row: 1,
            column: 3,
        },
        {
            title: "Apdex, top 5 by host",
            duration: 1800000,
            visualization: "metric_line_chart",
            entityIds: [myApplication.then(myApplication => myApplication.applicationId)],
            metrics: [{
                name: "Apdex",
                values: ["score"],
            }],
            facet: "host",
            limit: 5,
            orderBy: "score",
            row: 2,
            column: 1,
        },
        {
            title: "Requests per minute, by transaction",
            visualization: "facet_table",
            nrql: "SELECT rate(count(*), 1 minute) FROM Transaction FACET name",
            row: 2,
            column: 2,
        },
        {
            title: "Dashboard Note",
            visualization: "markdown",
            source: `### Helpful Links

* [New Relic One](https://one.newrelic.com)
* [Developer Portal](https://developer.newrelic.com)`,
            row: 2,
            column: 3,
        },
    ],
});

Create a Dashboard Resource

new Dashboard(name: string, args: DashboardArgs, opts?: CustomResourceOptions);
@overload
def Dashboard(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              editable: Optional[str] = None,
              filter: Optional[DashboardFilterArgs] = None,
              grid_column_count: Optional[int] = None,
              icon: Optional[str] = None,
              title: Optional[str] = None,
              visibility: Optional[str] = None,
              widgets: Optional[Sequence[DashboardWidgetArgs]] = None)
@overload
def Dashboard(resource_name: str,
              args: DashboardArgs,
              opts: Optional[ResourceOptions] = None)
func NewDashboard(ctx *Context, name string, args DashboardArgs, opts ...ResourceOption) (*Dashboard, error)
public Dashboard(string name, DashboardArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args DashboardArgs
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 DashboardArgs
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 DashboardArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DashboardArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Dashboard Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Dashboard resource accepts the following input properties:

Title string
The title of the dashboard.
Editable string
Determines who can edit the dashboard in an account. Valid values are all, editable_by_all, editable_by_owner, or read_only. Defaults to editable_by_all.
Filter Pulumi.NewRelic.Inputs.DashboardFilterArgs
A nested block that describes a dashboard filter. Exactly one nested filter block is allowed. See Nested filter block below for details.
GridColumnCount int
The number of columns to use when organizing and displaying widgets. New Relic One supports a 3 column grid and a 12 column grid. New Relic Insights supports a 3 column grid.
Icon string
The icon for the dashboard. Valid values are adjust, archive, bar-chart, bell, bolt, bug, bullhorn, bullseye, clock-o, cloud, cog, comments-o, crosshairs, dashboard, envelope, fire, flag, flask, globe, heart, leaf, legal, life-ring, line-chart, magic, mobile, money, none, paper-plane, pie-chart, puzzle-piece, road, rocket, shopping-cart, sitemap, sliders, tablet, thumbs-down, thumbs-up, trophy, usd, user, and users. Defaults to bar-chart.
Visibility string
Determines who can see the dashboard in an account. Valid values are all or owner. Defaults to all.
Widgets List<Pulumi.NewRelic.Inputs.DashboardWidgetArgs>
A nested block that describes a visualization. Up to 300 widget blocks are allowed in a dashboard definition. See Nested widget blocks below for details.
Title string
The title of the dashboard.
Editable string
Determines who can edit the dashboard in an account. Valid values are all, editable_by_all, editable_by_owner, or read_only. Defaults to editable_by_all.
Filter DashboardFilter
A nested block that describes a dashboard filter. Exactly one nested filter block is allowed. See Nested filter block below for details.
GridColumnCount int
The number of columns to use when organizing and displaying widgets. New Relic One supports a 3 column grid and a 12 column grid. New Relic Insights supports a 3 column grid.
Icon string
The icon for the dashboard. Valid values are adjust, archive, bar-chart, bell, bolt, bug, bullhorn, bullseye, clock-o, cloud, cog, comments-o, crosshairs, dashboard, envelope, fire, flag, flask, globe, heart, leaf, legal, life-ring, line-chart, magic, mobile, money, none, paper-plane, pie-chart, puzzle-piece, road, rocket, shopping-cart, sitemap, sliders, tablet, thumbs-down, thumbs-up, trophy, usd, user, and users. Defaults to bar-chart.
Visibility string
Determines who can see the dashboard in an account. Valid values are all or owner. Defaults to all.
Widgets []DashboardWidget
A nested block that describes a visualization. Up to 300 widget blocks are allowed in a dashboard definition. See Nested widget blocks below for details.
title string
The title of the dashboard.
editable string
Determines who can edit the dashboard in an account. Valid values are all, editable_by_all, editable_by_owner, or read_only. Defaults to editable_by_all.
filter DashboardFilterArgs
A nested block that describes a dashboard filter. Exactly one nested filter block is allowed. See Nested filter block below for details.
gridColumnCount number
The number of columns to use when organizing and displaying widgets. New Relic One supports a 3 column grid and a 12 column grid. New Relic Insights supports a 3 column grid.
icon string
The icon for the dashboard. Valid values are adjust, archive, bar-chart, bell, bolt, bug, bullhorn, bullseye, clock-o, cloud, cog, comments-o, crosshairs, dashboard, envelope, fire, flag, flask, globe, heart, leaf, legal, life-ring, line-chart, magic, mobile, money, none, paper-plane, pie-chart, puzzle-piece, road, rocket, shopping-cart, sitemap, sliders, tablet, thumbs-down, thumbs-up, trophy, usd, user, and users. Defaults to bar-chart.
visibility string
Determines who can see the dashboard in an account. Valid values are all or owner. Defaults to all.
widgets DashboardWidgetArgs[]
A nested block that describes a visualization. Up to 300 widget blocks are allowed in a dashboard definition. See Nested widget blocks below for details.
title str
The title of the dashboard.
editable str
Determines who can edit the dashboard in an account. Valid values are all, editable_by_all, editable_by_owner, or read_only. Defaults to editable_by_all.
filter DashboardFilterArgs
A nested block that describes a dashboard filter. Exactly one nested filter block is allowed. See Nested filter block below for details.
grid_column_count int
The number of columns to use when organizing and displaying widgets. New Relic One supports a 3 column grid and a 12 column grid. New Relic Insights supports a 3 column grid.
icon str
The icon for the dashboard. Valid values are adjust, archive, bar-chart, bell, bolt, bug, bullhorn, bullseye, clock-o, cloud, cog, comments-o, crosshairs, dashboard, envelope, fire, flag, flask, globe, heart, leaf, legal, life-ring, line-chart, magic, mobile, money, none, paper-plane, pie-chart, puzzle-piece, road, rocket, shopping-cart, sitemap, sliders, tablet, thumbs-down, thumbs-up, trophy, usd, user, and users. Defaults to bar-chart.
visibility str
Determines who can see the dashboard in an account. Valid values are all or owner. Defaults to all.
widgets Sequence[DashboardWidgetArgs]
A nested block that describes a visualization. Up to 300 widget blocks are allowed in a dashboard definition. See Nested widget blocks below for details.

Outputs

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

DashboardUrl string
The URL for viewing the dashboard.
Id string
The provider-assigned unique ID for this managed resource.
DashboardUrl string
The URL for viewing the dashboard.
Id string
The provider-assigned unique ID for this managed resource.
dashboardUrl string
The URL for viewing the dashboard.
id string
The provider-assigned unique ID for this managed resource.
dashboard_url str
The URL for viewing the dashboard.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Dashboard Resource

Get an existing Dashboard 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?: DashboardState, opts?: CustomResourceOptions): Dashboard
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        dashboard_url: Optional[str] = None,
        editable: Optional[str] = None,
        filter: Optional[DashboardFilterArgs] = None,
        grid_column_count: Optional[int] = None,
        icon: Optional[str] = None,
        title: Optional[str] = None,
        visibility: Optional[str] = None,
        widgets: Optional[Sequence[DashboardWidgetArgs]] = None) -> Dashboard
func GetDashboard(ctx *Context, name string, id IDInput, state *DashboardState, opts ...ResourceOption) (*Dashboard, error)
public static Dashboard Get(string name, Input<string> id, DashboardState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

DashboardUrl string
The URL for viewing the dashboard.
Editable string
Determines who can edit the dashboard in an account. Valid values are all, editable_by_all, editable_by_owner, or read_only. Defaults to editable_by_all.
Filter Pulumi.NewRelic.Inputs.DashboardFilterArgs
A nested block that describes a dashboard filter. Exactly one nested filter block is allowed. See Nested filter block below for details.
GridColumnCount int
The number of columns to use when organizing and displaying widgets. New Relic One supports a 3 column grid and a 12 column grid. New Relic Insights supports a 3 column grid.
Icon string
The icon for the dashboard. Valid values are adjust, archive, bar-chart, bell, bolt, bug, bullhorn, bullseye, clock-o, cloud, cog, comments-o, crosshairs, dashboard, envelope, fire, flag, flask, globe, heart, leaf, legal, life-ring, line-chart, magic, mobile, money, none, paper-plane, pie-chart, puzzle-piece, road, rocket, shopping-cart, sitemap, sliders, tablet, thumbs-down, thumbs-up, trophy, usd, user, and users. Defaults to bar-chart.
Title string
The title of the dashboard.
Visibility string
Determines who can see the dashboard in an account. Valid values are all or owner. Defaults to all.
Widgets List<Pulumi.NewRelic.Inputs.DashboardWidgetArgs>
A nested block that describes a visualization. Up to 300 widget blocks are allowed in a dashboard definition. See Nested widget blocks below for details.
DashboardUrl string
The URL for viewing the dashboard.
Editable string
Determines who can edit the dashboard in an account. Valid values are all, editable_by_all, editable_by_owner, or read_only. Defaults to editable_by_all.
Filter DashboardFilter
A nested block that describes a dashboard filter. Exactly one nested filter block is allowed. See Nested filter block below for details.
GridColumnCount int
The number of columns to use when organizing and displaying widgets. New Relic One supports a 3 column grid and a 12 column grid. New Relic Insights supports a 3 column grid.
Icon string
The icon for the dashboard. Valid values are adjust, archive, bar-chart, bell, bolt, bug, bullhorn, bullseye, clock-o, cloud, cog, comments-o, crosshairs, dashboard, envelope, fire, flag, flask, globe, heart, leaf, legal, life-ring, line-chart, magic, mobile, money, none, paper-plane, pie-chart, puzzle-piece, road, rocket, shopping-cart, sitemap, sliders, tablet, thumbs-down, thumbs-up, trophy, usd, user, and users. Defaults to bar-chart.
Title string
The title of the dashboard.
Visibility string
Determines who can see the dashboard in an account. Valid values are all or owner. Defaults to all.
Widgets []DashboardWidget
A nested block that describes a visualization. Up to 300 widget blocks are allowed in a dashboard definition. See Nested widget blocks below for details.
dashboardUrl string
The URL for viewing the dashboard.
editable string
Determines who can edit the dashboard in an account. Valid values are all, editable_by_all, editable_by_owner, or read_only. Defaults to editable_by_all.
filter DashboardFilterArgs
A nested block that describes a dashboard filter. Exactly one nested filter block is allowed. See Nested filter block below for details.
gridColumnCount number
The number of columns to use when organizing and displaying widgets. New Relic One supports a 3 column grid and a 12 column grid. New Relic Insights supports a 3 column grid.
icon string
The icon for the dashboard. Valid values are adjust, archive, bar-chart, bell, bolt, bug, bullhorn, bullseye, clock-o, cloud, cog, comments-o, crosshairs, dashboard, envelope, fire, flag, flask, globe, heart, leaf, legal, life-ring, line-chart, magic, mobile, money, none, paper-plane, pie-chart, puzzle-piece, road, rocket, shopping-cart, sitemap, sliders, tablet, thumbs-down, thumbs-up, trophy, usd, user, and users. Defaults to bar-chart.
title string
The title of the dashboard.
visibility string
Determines who can see the dashboard in an account. Valid values are all or owner. Defaults to all.
widgets DashboardWidgetArgs[]
A nested block that describes a visualization. Up to 300 widget blocks are allowed in a dashboard definition. See Nested widget blocks below for details.
dashboard_url str
The URL for viewing the dashboard.
editable str
Determines who can edit the dashboard in an account. Valid values are all, editable_by_all, editable_by_owner, or read_only. Defaults to editable_by_all.
filter DashboardFilterArgs
A nested block that describes a dashboard filter. Exactly one nested filter block is allowed. See Nested filter block below for details.
grid_column_count int
The number of columns to use when organizing and displaying widgets. New Relic One supports a 3 column grid and a 12 column grid. New Relic Insights supports a 3 column grid.
icon str
The icon for the dashboard. Valid values are adjust, archive, bar-chart, bell, bolt, bug, bullhorn, bullseye, clock-o, cloud, cog, comments-o, crosshairs, dashboard, envelope, fire, flag, flask, globe, heart, leaf, legal, life-ring, line-chart, magic, mobile, money, none, paper-plane, pie-chart, puzzle-piece, road, rocket, shopping-cart, sitemap, sliders, tablet, thumbs-down, thumbs-up, trophy, usd, user, and users. Defaults to bar-chart.
title str
The title of the dashboard.
visibility str
Determines who can see the dashboard in an account. Valid values are all or owner. Defaults to all.
widgets Sequence[DashboardWidgetArgs]
A nested block that describes a visualization. Up to 300 widget blocks are allowed in a dashboard definition. See Nested widget blocks below for details.

Supporting Types

DashboardFilter

EventTypes List<string>
(Optional) A list of event types to enable filtering for.
Attributes List<string>
(Optional) A list of attributes belonging to the specified event types to enable filtering for.
EventTypes []string
(Optional) A list of event types to enable filtering for.
Attributes []string
(Optional) A list of attributes belonging to the specified event types to enable filtering for.
eventTypes string[]
(Optional) A list of event types to enable filtering for.
attributes string[]
(Optional) A list of attributes belonging to the specified event types to enable filtering for.
event_types Sequence[str]
(Optional) A list of event types to enable filtering for.
attributes Sequence[str]
(Optional) A list of attributes belonging to the specified event types to enable filtering for.

DashboardWidget

Column int
(Required) Column position of widget from top left, starting at 1.
Row int
(Required) Row position of widget from top left, starting at 1.
Title string
The title of the dashboard.
Visualization string
(Required) How the widget visualizes data. Valid values are billboard, gauge, billboard_comparison, facet_bar_chart, faceted_line_chart, facet_pie_chart, facet_table, faceted_area_chart, heatmap, attribute_sheet, single_event, histogram, funnel, raw_json, event_feed, event_table, uniques_list, line_chart, comparison_line_chart, markdown, and metric_line_chart.
AccountId int
(Optional) The account ID to use when querying data. If account_id is omitted, the widget will use the account ID associated with the API key used in your provider configuration. You can also use account_id to configure cross-account widgets or simply to be explicit about which account the widget will be pulling data from.
CompareWiths List<Pulumi.NewRelic.Inputs.DashboardWidgetCompareWithArgs>
DrilldownDashboardId int

(Optional) The ID of a dashboard to link to from the widget’s facets.

  • attribute_sheet, comparison_line_chart, event_feed, event_table, funnel, histogram, line_chart, raw_json, single_event, or uniques_list:
Duration int
(Required) The duration, in ms, of the time window represented in the chart.
EndTime int
(Optional) The end time of the time window represented in the chart in epoch time. When not set, the time window will end at the current time.
EntityIds List<int>
(Required) A collection of entity IDs to display data. These are typically application IDs.
Facet string
(Optional) Can be set to “host” to facet the metric data by host.
Height int
(Optional) Height of the widget. Valid values are 1 to 3 inclusive. Defaults to 1.
Limit int
(Optional) The limit of distinct data series to display. Requires order_by to be set.
Metrics List<Pulumi.NewRelic.Inputs.DashboardWidgetMetricArgs>
(Required) A nested block that describes a metric. Nested metric blocks support the following arguments:
Notes string
(Optional) Description of the widget.
Nrql string

(Required) Valid NRQL query string. See Writing NRQL Queries for help.

  • markdown:
OrderBy string

(Optional) Set the order of the results. Required when using limit.

  • application_breakdown:
RawMetricName string
Source string

(Required) The markdown source to be rendered in the widget.

  • metric_line_chart:
ThresholdRed double
(Required) Threshold above which the displayed value will be styled with a red color.
ThresholdYellow double

(Optional) Threshold above which the displayed value will be styled with a yellow color.

  • facet_bar_chart, facet_pie_chart, facet_table, faceted_area_chart, faceted_line_chart, or heatmap:
WidgetId int
Width int
(Optional) Width of the widget. Valid values are 1 to 3 inclusive. Defaults to 1.
Column int
(Required) Column position of widget from top left, starting at 1.
Row int
(Required) Row position of widget from top left, starting at 1.
Title string
The title of the dashboard.
Visualization string
(Required) How the widget visualizes data. Valid values are billboard, gauge, billboard_comparison, facet_bar_chart, faceted_line_chart, facet_pie_chart, facet_table, faceted_area_chart, heatmap, attribute_sheet, single_event, histogram, funnel, raw_json, event_feed, event_table, uniques_list, line_chart, comparison_line_chart, markdown, and metric_line_chart.
AccountId int
(Optional) The account ID to use when querying data. If account_id is omitted, the widget will use the account ID associated with the API key used in your provider configuration. You can also use account_id to configure cross-account widgets or simply to be explicit about which account the widget will be pulling data from.
CompareWiths []DashboardWidgetCompareWith
DrilldownDashboardId int

(Optional) The ID of a dashboard to link to from the widget’s facets.

  • attribute_sheet, comparison_line_chart, event_feed, event_table, funnel, histogram, line_chart, raw_json, single_event, or uniques_list:
Duration int
(Required) The duration, in ms, of the time window represented in the chart.
EndTime int
(Optional) The end time of the time window represented in the chart in epoch time. When not set, the time window will end at the current time.
EntityIds []int
(Required) A collection of entity IDs to display data. These are typically application IDs.
Facet string
(Optional) Can be set to “host” to facet the metric data by host.
Height int
(Optional) Height of the widget. Valid values are 1 to 3 inclusive. Defaults to 1.
Limit int
(Optional) The limit of distinct data series to display. Requires order_by to be set.
Metrics []DashboardWidgetMetric
(Required) A nested block that describes a metric. Nested metric blocks support the following arguments:
Notes string
(Optional) Description of the widget.
Nrql string

(Required) Valid NRQL query string. See Writing NRQL Queries for help.

  • markdown:
OrderBy string

(Optional) Set the order of the results. Required when using limit.

  • application_breakdown:
RawMetricName string
Source string

(Required) The markdown source to be rendered in the widget.

  • metric_line_chart:
ThresholdRed float64
(Required) Threshold above which the displayed value will be styled with a red color.
ThresholdYellow float64

(Optional) Threshold above which the displayed value will be styled with a yellow color.

  • facet_bar_chart, facet_pie_chart, facet_table, faceted_area_chart, faceted_line_chart, or heatmap:
WidgetId int
Width int
(Optional) Width of the widget. Valid values are 1 to 3 inclusive. Defaults to 1.
column number
(Required) Column position of widget from top left, starting at 1.
row number
(Required) Row position of widget from top left, starting at 1.
title string
The title of the dashboard.
visualization string
(Required) How the widget visualizes data. Valid values are billboard, gauge, billboard_comparison, facet_bar_chart, faceted_line_chart, facet_pie_chart, facet_table, faceted_area_chart, heatmap, attribute_sheet, single_event, histogram, funnel, raw_json, event_feed, event_table, uniques_list, line_chart, comparison_line_chart, markdown, and metric_line_chart.
accountId number
(Optional) The account ID to use when querying data. If account_id is omitted, the widget will use the account ID associated with the API key used in your provider configuration. You can also use account_id to configure cross-account widgets or simply to be explicit about which account the widget will be pulling data from.
compareWiths DashboardWidgetCompareWithArgs[]
drilldownDashboardId number

(Optional) The ID of a dashboard to link to from the widget’s facets.

  • attribute_sheet, comparison_line_chart, event_feed, event_table, funnel, histogram, line_chart, raw_json, single_event, or uniques_list:
duration number
(Required) The duration, in ms, of the time window represented in the chart.
endTime number
(Optional) The end time of the time window represented in the chart in epoch time. When not set, the time window will end at the current time.
entityIds number[]
(Required) A collection of entity IDs to display data. These are typically application IDs.
facet string
(Optional) Can be set to “host” to facet the metric data by host.
height number
(Optional) Height of the widget. Valid values are 1 to 3 inclusive. Defaults to 1.
limit number
(Optional) The limit of distinct data series to display. Requires order_by to be set.
metrics DashboardWidgetMetricArgs[]
(Required) A nested block that describes a metric. Nested metric blocks support the following arguments:
notes string
(Optional) Description of the widget.
nrql string

(Required) Valid NRQL query string. See Writing NRQL Queries for help.

  • markdown:
orderBy string

(Optional) Set the order of the results. Required when using limit.

  • application_breakdown:
rawMetricName string
source string

(Required) The markdown source to be rendered in the widget.

  • metric_line_chart:
thresholdRed number
(Required) Threshold above which the displayed value will be styled with a red color.
thresholdYellow number

(Optional) Threshold above which the displayed value will be styled with a yellow color.

  • facet_bar_chart, facet_pie_chart, facet_table, faceted_area_chart, faceted_line_chart, or heatmap:
widgetId number
width number
(Optional) Width of the widget. Valid values are 1 to 3 inclusive. Defaults to 1.
column int
(Required) Column position of widget from top left, starting at 1.
row int
(Required) Row position of widget from top left, starting at 1.
title str
The title of the dashboard.
visualization str
(Required) How the widget visualizes data. Valid values are billboard, gauge, billboard_comparison, facet_bar_chart, faceted_line_chart, facet_pie_chart, facet_table, faceted_area_chart, heatmap, attribute_sheet, single_event, histogram, funnel, raw_json, event_feed, event_table, uniques_list, line_chart, comparison_line_chart, markdown, and metric_line_chart.
account_id int
(Optional) The account ID to use when querying data. If account_id is omitted, the widget will use the account ID associated with the API key used in your provider configuration. You can also use account_id to configure cross-account widgets or simply to be explicit about which account the widget will be pulling data from.
compare_withs Sequence[DashboardWidgetCompareWithArgs]
drilldown_dashboard_id int

(Optional) The ID of a dashboard to link to from the widget’s facets.

  • attribute_sheet, comparison_line_chart, event_feed, event_table, funnel, histogram, line_chart, raw_json, single_event, or uniques_list:
duration int
(Required) The duration, in ms, of the time window represented in the chart.
end_time int
(Optional) The end time of the time window represented in the chart in epoch time. When not set, the time window will end at the current time.
entity_ids Sequence[int]
(Required) A collection of entity IDs to display data. These are typically application IDs.
facet str
(Optional) Can be set to “host” to facet the metric data by host.
height int
(Optional) Height of the widget. Valid values are 1 to 3 inclusive. Defaults to 1.
limit int
(Optional) The limit of distinct data series to display. Requires order_by to be set.
metrics Sequence[DashboardWidgetMetricArgs]
(Required) A nested block that describes a metric. Nested metric blocks support the following arguments:
notes str
(Optional) Description of the widget.
nrql str

(Required) Valid NRQL query string. See Writing NRQL Queries for help.

  • markdown:
order_by str

(Optional) Set the order of the results. Required when using limit.

  • application_breakdown:
raw_metric_name str
source str

(Required) The markdown source to be rendered in the widget.

  • metric_line_chart:
threshold_red float
(Required) Threshold above which the displayed value will be styled with a red color.
threshold_yellow float

(Optional) Threshold above which the displayed value will be styled with a yellow color.

  • facet_bar_chart, facet_pie_chart, facet_table, faceted_area_chart, faceted_line_chart, or heatmap:
widget_id int
width int
(Optional) Width of the widget. Valid values are 1 to 3 inclusive. Defaults to 1.

DashboardWidgetCompareWith

DashboardWidgetCompareWithPresentation

Color string
Name string
(Required) The metric name to display.
Color string
Name string
(Required) The metric name to display.
color string
name string
(Required) The metric name to display.
color str
name str
(Required) The metric name to display.

DashboardWidgetMetric

Name string
(Required) The metric name to display.
Scope string
Units string
Values List<string>
(Required) The metric values to display.
Name string
(Required) The metric name to display.
Scope string
Units string
Values []string
(Required) The metric values to display.
name string
(Required) The metric name to display.
scope string
units string
values string[]
(Required) The metric values to display.
name str
(Required) The metric name to display.
scope str
units str
values Sequence[str]
(Required) The metric values to display.

Import

New Relic dashboards can be imported using their ID, e.g.

 $ pulumi import newrelic:index/dashboard:Dashboard my_dashboard 8675309

~> NOTE Due to API restrictions, importing a dashboard resource will set the grid_column_count attribute to 3. If your dashboard is a New Relic One dashboard and uses a 12 column grid, you will need to make sure grid_column_count is set to 12 in your configuration, then run terraform apply after importing to sync remote state with Terraform state. Also note, cross-account widgets cannot be imported due to API restrictions.

Package Details

Repository
https://github.com/pulumi/pulumi-newrelic
License
Apache-2.0
Notes
This Pulumi package is based on the newrelic Terraform Provider.