The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::DataDog::Dashboard - Interface to Dashboard/Timeboard functions in DataDog's API.

VERSION

Version 1.0.3

SYNOPSIS

This module allows you interact with the Dashboard endpoint of the DataDog API.

Per DataDog: "The Dashboards end point allow you to programmatically create, update delete and query dashboards."

METHODS

get_all_dashboards()

Deprecated. Please use retrieve_all() instead.

retrieve_all()

Retrieve details for all user-created dashboards/timeboards ( does not include system-generated or integration dashboards ).

        my $dashboard = $datadog->build('Dashboard');
        my $dashboard_list = $dashboard->retrieve_all();
        

Parameters: None

get_dashboard()

Deprecated. Please use retrieve() instead.

retrieve()

Retrieve details for specified user-created dashboards/timeboards ( does not work for system-generated or integration dashboards/timeboards ).

        my $dashboard = $datadog->build('Dashboard');
        my $dashboard_data = $dashboard->retrieve( id => $dash_id );
        

Parameters:

  • id

    Id of dashboard/timeboard you want to retrieve the details for.

update_dashboard()

Deprecated. Please use update() instead.

update()

Update details for specified user-created dashboard/timeboard ( does not work for system-generated or integration dashboards/timeboards ). Supply at least one of the arguments 'title', 'description', 'graphs'. Any argument not supplied will remain unchanged within the dashboard.

WARNING: If you only specify a new graph to add to the dashboard, you WILL LOSE ALL EXISTING GRAPHS. Your 'graphs' section must include ALL graphs that you want to be part of a dashboard.

        my $dashboard = $datadog->build('Dashboard');
        $dashboard->update(
                id          => $dash_id,
                title       => $dash_title,
                description => $dash_description,
                graphs      => $graphs,
        );
        

Parameters:

  • id

    Id of dashboard you want to update.

  • title

    Optional. Specify updated title for specified dashboard.

  • description

    Optional. Specify updated description for specified dashboard.

  • graphs

    Optional. Specify updated graph definition for specified dashboard.

create()

Create new DataDog dashboard/timeboard with 1+ graphs. If successful, returns created dashboard/timeboard id.

        my $dashboard = $datadog->build('Dashboard');
        my $dashboard_id = $dashboard->create(
                title       => $dash_title,
                description => $dash_description,
                graphs      => $graphs,
        );
        
        Example:
        my $new_dashboard_id = $dashboard->create(
                title       => "TEST DASH",
                description => "test dashboard",
                graphs      =>
                [
                        {
                                title => "Sum of Memory Free",
                                definition =>
                                {
                                        events   =>[],
                                        requests => [
                                                { q => "sum:system.mem.free{*}" }
                                        ]
                                },
                                viz => "timeseries"
                        },
                ],
        );
        

Parameters:

  • title

    Specify title for new dashboard.

  • description

    Specify description for new dashboard.

  • graphs

    Specify graph definition for new dashboard.

    • title

      Title of graph.

    • definition

      Definition of graph.

      • events

        Overlay any events from the event stream.

      • requests

        Metrics you want to graph.

    • viz

      Visualisation of graph. Valid values: timeseries (default), treemap.

delete_dashboard()

Deprecated. Please use delete() instead.

delete()

Delete specified user-created dashboard. NOTE: You cannot remove system-generated or integration dashboards.

        my $dashboard = $datadog->build('Dashboard');
        $dashboard->delete( id => $dash_id );
        
        

Parameters:

  • id

    Dashboard id you want to delete.

INTERNAL FUNCTIONS

_error_checks()

Common error checking for creating/updating dashboards/timeboards.