指定されたオプションを使用してダッシュボードを作成します。ウィジェットでクエリを定義するときは、どのクエリに as_count() または as_rate() 修飾子を追加する必要があるかに注意してください。
これらの修飾子の詳細については、次のドキュメントを参照してください。
This endpoint requires the dashboards_write permission.
OAuth apps require the dashboards_write authorization scope to access this endpoint.
DEPRECATED: Whether this dashboard is read-only. If True, only the author and admins can make changes to it.
This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.
layout_type [required]
enum
Layout type of the dashboard.
Allowed enum values: ordered,free
modified_at
date-time
Modification date of the dashboard.
notify_list
[string]
List of handles of users to notify when changes are made to this dashboard.
reflow_type
enum
Reflow type for a new dashboard layout dashboard. Set this only when layout type is 'ordered'.
If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto',
widgets should not have layouts.
Allowed enum values: auto,fixed
restricted_roles
[string]
DEPRECATED: A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard.
This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.
tags
[string]
List of team names representing ownership of a dashboard.
template_variable_presets
[object]
Array of template variables saved views.
name
string
The name of the variable.
template_variables
[object]
List of variables.
name
string
The name of the variable.
value
string
DEPRECATED: (deprecated) The value of the template variable within the saved view. Cannot be used in conjunction with values.
values
[string]
One or many template variable values within the saved view, which will be unioned together using OR if more than one is specified. Cannot be used in conjunction with value.
template_variables
[object]
List of template variables for this dashboard.
available_values
[string]
The list of values that the template variable drop-down is limited to.
default
string
DEPRECATED: (deprecated) The default value for the template variable on dashboard load. Cannot be used in conjunction with defaults.
defaults
[string]
One or many default values for template variables on load. If more than one default is specified, they will be unioned together with OR. Cannot be used in conjunction with default.
name [required]
string
The name of the variable.
prefix
string
The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.
The layout for a widget on a free or new dashboard layout dashboard.
height [required]
int64
The height of the widget. Should be a non-negative integer.
is_column_break
boolean
Whether the widget should be the first one on the second column in high density or not.
Note: Only for the new dashboard layout and only one widget in the dashboard should have this property set to true.
width [required]
int64
The width of the widget. Should be a non-negative integer.
x [required]
int64
The position of the widget on the x (horizontal) axis. Should be a non-negative integer.
y [required]
int64
The position of the widget on the y (vertical) axis. Should be a non-negative integer.
{"title":"Example-Dashboard","widgets":[{"definition":{"title":"Example Cloud Cost Query","title_size":"16","title_align":"left","type":"timeseries","requests":[{"formulas":[{"formula":"query1"}],"queries":[{"data_source":"cloud_cost","name":"query1","query":"sum:aws.cost.amortized{*} by {aws_product}.rollup(sum, monthly)"}],"response_format":"timeseries","style":{"palette":"dog_classic","line_type":"solid","line_width":"normal"},"display_type":"bars"}],"time":{}}}],"layout_type":"ordered"}
A dashboard is Datadog’s tool for visually tracking, analyzing, and displaying
key performance metrics, which enable you to monitor the health of your infrastructure.
Expand All
フィールド
種類
説明
author_handle
string
Identifier of the dashboard author.
author_name
string
Name of the dashboard author.
created_at
date-time
Creation date of the dashboard.
description
string
Description of the dashboard.
id
string
ID of the dashboard.
is_read_only
boolean
DEPRECATED: Whether this dashboard is read-only. If True, only the author and admins can make changes to it.
This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.
layout_type [required]
enum
Layout type of the dashboard.
Allowed enum values: ordered,free
modified_at
date-time
Modification date of the dashboard.
notify_list
[string]
List of handles of users to notify when changes are made to this dashboard.
reflow_type
enum
Reflow type for a new dashboard layout dashboard. Set this only when layout type is 'ordered'.
If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto',
widgets should not have layouts.
Allowed enum values: auto,fixed
restricted_roles
[string]
DEPRECATED: A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard.
This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.
tags
[string]
List of team names representing ownership of a dashboard.
template_variable_presets
[object]
Array of template variables saved views.
name
string
The name of the variable.
template_variables
[object]
List of variables.
name
string
The name of the variable.
value
string
DEPRECATED: (deprecated) The value of the template variable within the saved view. Cannot be used in conjunction with values.
values
[string]
One or many template variable values within the saved view, which will be unioned together using OR if more than one is specified. Cannot be used in conjunction with value.
template_variables
[object]
List of template variables for this dashboard.
available_values
[string]
The list of values that the template variable drop-down is limited to.
default
string
DEPRECATED: (deprecated) The default value for the template variable on dashboard load. Cannot be used in conjunction with defaults.
defaults
[string]
One or many default values for template variables on load. If more than one default is specified, they will be unioned together with OR. Cannot be used in conjunction with default.
name [required]
string
The name of the variable.
prefix
string
The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.
The layout for a widget on a free or new dashboard layout dashboard.
height [required]
int64
The height of the widget. Should be a non-negative integer.
is_column_break
boolean
Whether the widget should be the first one on the second column in high density or not.
Note: Only for the new dashboard layout and only one widget in the dashboard should have this property set to true.
width [required]
int64
The width of the widget. Should be a non-negative integer.
x [required]
int64
The position of the widget on the x (horizontal) axis. Should be a non-negative integer.
y [required]
int64
The position of the widget on the y (vertical) axis. Should be a non-negative integer.
// Create a distribution widget using a histogram request containing a formulas and functions APM Stats query
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){body:=datadogV1.Dashboard{Title:"Example-Dashboard",Description:*datadog.NewNullableString(datadog.PtrString("")),Widgets:[]datadogV1.Widget{{Definition:datadogV1.WidgetDefinition{DistributionWidgetDefinition:&datadogV1.DistributionWidgetDefinition{Title:datadog.PtrString("APM Stats - Request latency HOP"),TitleSize:datadog.PtrString("16"),TitleAlign:datadogV1.WIDGETTEXTALIGN_LEFT.Ptr(),ShowLegend:datadog.PtrBool(false),Type:datadogV1.DISTRIBUTIONWIDGETDEFINITIONTYPE_DISTRIBUTION,Xaxis:&datadogV1.DistributionWidgetXAxis{Max:datadog.PtrString("auto"),IncludeZero:datadog.PtrBool(true),Scale:datadog.PtrString("linear"),Min:datadog.PtrString("auto"),},Yaxis:&datadogV1.DistributionWidgetYAxis{Max:datadog.PtrString("auto"),IncludeZero:datadog.PtrBool(true),Scale:datadog.PtrString("linear"),Min:datadog.PtrString("auto"),},Requests:[]datadogV1.DistributionWidgetRequest{{Query:&datadogV1.DistributionWidgetHistogramRequestQuery{FormulaAndFunctionApmResourceStatsQueryDefinition:&datadogV1.FormulaAndFunctionApmResourceStatsQueryDefinition{PrimaryTagValue:datadog.PtrString("*"),Stat:datadogV1.FORMULAANDFUNCTIONAPMRESOURCESTATNAME_LATENCY_DISTRIBUTION,DataSource:datadogV1.FORMULAANDFUNCTIONAPMRESOURCESTATSDATASOURCE_APM_RESOURCE_STATS,Name:"query1",Service:"azure-bill-import",GroupBy:[]string{"resource_name",},Env:"staging",PrimaryTagName:datadog.PtrString("datacenter"),OperationName:datadog.PtrString("universal.http.client"),}},RequestType:datadogV1.DISTRIBUTIONWIDGETHISTOGRAMREQUESTTYPE_HISTOGRAM.Ptr(),Style:&datadogV1.WidgetStyle{Palette:datadog.PtrString("dog_classic"),},},},}},Layout:&datadogV1.WidgetLayout{X:8,Y:0,Width:4,Height:2,},},},LayoutType:datadogV1.DASHBOARDLAYOUTTYPE_ORDERED,}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewDashboardsApi(apiClient)resp,r,err:=api.CreateDashboard(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DashboardsApi.CreateDashboard`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DashboardsApi.CreateDashboard`:\n%s\n",responseContent)}
// Create a distribution widget using a histogram request containing a formulas and functions events query
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){body:=datadogV1.Dashboard{Title:"Example-Dashboard",Description:*datadog.NewNullableString(datadog.PtrString("Example-Dashboard")),Widgets:[]datadogV1.Widget{{Definition:datadogV1.WidgetDefinition{DistributionWidgetDefinition:&datadogV1.DistributionWidgetDefinition{Title:datadog.PtrString("Events Platform - Request latency HOP"),TitleSize:datadog.PtrString("16"),TitleAlign:datadogV1.WIDGETTEXTALIGN_LEFT.Ptr(),ShowLegend:datadog.PtrBool(false),Type:datadogV1.DISTRIBUTIONWIDGETDEFINITIONTYPE_DISTRIBUTION,Xaxis:&datadogV1.DistributionWidgetXAxis{Max:datadog.PtrString("auto"),IncludeZero:datadog.PtrBool(true),Scale:datadog.PtrString("linear"),Min:datadog.PtrString("auto"),},Yaxis:&datadogV1.DistributionWidgetYAxis{Max:datadog.PtrString("auto"),IncludeZero:datadog.PtrBool(true),Scale:datadog.PtrString("linear"),Min:datadog.PtrString("auto"),},Requests:[]datadogV1.DistributionWidgetRequest{{Query:&datadogV1.DistributionWidgetHistogramRequestQuery{FormulaAndFunctionEventQueryDefinition:&datadogV1.FormulaAndFunctionEventQueryDefinition{Search:&datadogV1.FormulaAndFunctionEventQueryDefinitionSearch{Query:"",},DataSource:datadogV1.FORMULAANDFUNCTIONEVENTSDATASOURCE_EVENTS,Compute:datadogV1.FormulaAndFunctionEventQueryDefinitionCompute{Metric:datadog.PtrString("@duration"),Aggregation:datadogV1.FORMULAANDFUNCTIONEVENTAGGREGATION_MIN,},Name:"query1",Indexes:[]string{"*",},GroupBy:[]datadogV1.FormulaAndFunctionEventQueryGroupBy{},}},RequestType:datadogV1.DISTRIBUTIONWIDGETHISTOGRAMREQUESTTYPE_HISTOGRAM.Ptr(),},},}},Layout:&datadogV1.WidgetLayout{X:0,Y:0,Width:4,Height:2,},},},LayoutType:datadogV1.DASHBOARDLAYOUTTYPE_ORDERED,}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewDashboardsApi(apiClient)resp,r,err:=api.CreateDashboard(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DashboardsApi.CreateDashboard`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DashboardsApi.CreateDashboard`:\n%s\n",responseContent)}
// Create a distribution widget using a histogram request containing a formulas and functions metrics query
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){body:=datadogV1.Dashboard{Title:"Example-Dashboard",Widgets:[]datadogV1.Widget{{Definition:datadogV1.WidgetDefinition{DistributionWidgetDefinition:&datadogV1.DistributionWidgetDefinition{Title:datadog.PtrString("Metrics HOP"),TitleSize:datadog.PtrString("16"),TitleAlign:datadogV1.WIDGETTEXTALIGN_LEFT.Ptr(),ShowLegend:datadog.PtrBool(false),Type:datadogV1.DISTRIBUTIONWIDGETDEFINITIONTYPE_DISTRIBUTION,CustomLinks:[]datadogV1.WidgetCustomLink{{Label:datadog.PtrString("Example"),Link:datadog.PtrString("https://example.org/"),},},Xaxis:&datadogV1.DistributionWidgetXAxis{Max:datadog.PtrString("auto"),IncludeZero:datadog.PtrBool(true),Scale:datadog.PtrString("linear"),Min:datadog.PtrString("auto"),},Yaxis:&datadogV1.DistributionWidgetYAxis{Max:datadog.PtrString("auto"),IncludeZero:datadog.PtrBool(true),Scale:datadog.PtrString("linear"),Min:datadog.PtrString("auto"),},Requests:[]datadogV1.DistributionWidgetRequest{{Query:&datadogV1.DistributionWidgetHistogramRequestQuery{FormulaAndFunctionMetricQueryDefinition:&datadogV1.FormulaAndFunctionMetricQueryDefinition{Query:"histogram:trace.Load{*}",DataSource:datadogV1.FORMULAANDFUNCTIONMETRICDATASOURCE_METRICS,Name:"query1",}},RequestType:datadogV1.DISTRIBUTIONWIDGETHISTOGRAMREQUESTTYPE_HISTOGRAM.Ptr(),Style:&datadogV1.WidgetStyle{Palette:datadog.PtrString("dog_classic"),},},},}},Layout:&datadogV1.WidgetLayout{X:0,Y:0,Width:4,Height:2,},},},LayoutType:datadogV1.DASHBOARDLAYOUTTYPE_ORDERED,}ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewDashboardsApi(apiClient)resp,r,err:=api.CreateDashboard(ctx,body)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DashboardsApi.CreateDashboard`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DashboardsApi.CreateDashboard`:\n%s\n",responseContent)}
// Create a distribution widget using a histogram request containing a formulas and functions APM// Stats queryimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.DashboardsApi;importcom.datadog.api.client.v1.model.Dashboard;importcom.datadog.api.client.v1.model.DashboardLayoutType;importcom.datadog.api.client.v1.model.DistributionWidgetDefinition;importcom.datadog.api.client.v1.model.DistributionWidgetDefinitionType;importcom.datadog.api.client.v1.model.DistributionWidgetHistogramRequestQuery;importcom.datadog.api.client.v1.model.DistributionWidgetHistogramRequestType;importcom.datadog.api.client.v1.model.DistributionWidgetRequest;importcom.datadog.api.client.v1.model.DistributionWidgetXAxis;importcom.datadog.api.client.v1.model.DistributionWidgetYAxis;importcom.datadog.api.client.v1.model.FormulaAndFunctionApmResourceStatName;importcom.datadog.api.client.v1.model.FormulaAndFunctionApmResourceStatsDataSource;importcom.datadog.api.client.v1.model.FormulaAndFunctionApmResourceStatsQueryDefinition;importcom.datadog.api.client.v1.model.Widget;importcom.datadog.api.client.v1.model.WidgetDefinition;importcom.datadog.api.client.v1.model.WidgetLayout;importcom.datadog.api.client.v1.model.WidgetStyle;importcom.datadog.api.client.v1.model.WidgetTextAlign;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();DashboardsApiapiInstance=newDashboardsApi(defaultClient);Dashboardbody=newDashboard().title("Example-Dashboard").description("").widgets(Collections.singletonList(newWidget().definition(newWidgetDefinition(newDistributionWidgetDefinition().title("APM Stats - Request latency HOP").titleSize("16").titleAlign(WidgetTextAlign.LEFT).showLegend(false).type(DistributionWidgetDefinitionType.DISTRIBUTION).xaxis(newDistributionWidgetXAxis().max("auto").includeZero(true).scale("linear").min("auto")).yaxis(newDistributionWidgetYAxis().max("auto").includeZero(true).scale("linear").min("auto")).requests(Collections.singletonList(newDistributionWidgetRequest().query(newDistributionWidgetHistogramRequestQuery(newFormulaAndFunctionApmResourceStatsQueryDefinition().primaryTagValue("*").stat(FormulaAndFunctionApmResourceStatName.LATENCY_DISTRIBUTION).dataSource(FormulaAndFunctionApmResourceStatsDataSource.APM_RESOURCE_STATS).name("query1").service("azure-bill-import").groupBy(Collections.singletonList("resource_name")).env("staging").primaryTagName("datacenter").operationName("universal.http.client"))).requestType(DistributionWidgetHistogramRequestType.HISTOGRAM).style(newWidgetStyle().palette("dog_classic")))))).layout(newWidgetLayout().x(8L).y(0L).width(4L).height(2L)))).layoutType(DashboardLayoutType.ORDERED);try{Dashboardresult=apiInstance.createDashboard(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DashboardsApi#createDashboard");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Create a distribution widget using a histogram request containing a formulas and functions events// queryimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.DashboardsApi;importcom.datadog.api.client.v1.model.Dashboard;importcom.datadog.api.client.v1.model.DashboardLayoutType;importcom.datadog.api.client.v1.model.DistributionWidgetDefinition;importcom.datadog.api.client.v1.model.DistributionWidgetDefinitionType;importcom.datadog.api.client.v1.model.DistributionWidgetHistogramRequestQuery;importcom.datadog.api.client.v1.model.DistributionWidgetHistogramRequestType;importcom.datadog.api.client.v1.model.DistributionWidgetRequest;importcom.datadog.api.client.v1.model.DistributionWidgetXAxis;importcom.datadog.api.client.v1.model.DistributionWidgetYAxis;importcom.datadog.api.client.v1.model.FormulaAndFunctionEventAggregation;importcom.datadog.api.client.v1.model.FormulaAndFunctionEventQueryDefinition;importcom.datadog.api.client.v1.model.FormulaAndFunctionEventQueryDefinitionCompute;importcom.datadog.api.client.v1.model.FormulaAndFunctionEventQueryDefinitionSearch;importcom.datadog.api.client.v1.model.FormulaAndFunctionEventsDataSource;importcom.datadog.api.client.v1.model.Widget;importcom.datadog.api.client.v1.model.WidgetDefinition;importcom.datadog.api.client.v1.model.WidgetLayout;importcom.datadog.api.client.v1.model.WidgetTextAlign;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();DashboardsApiapiInstance=newDashboardsApi(defaultClient);Dashboardbody=newDashboard().title("Example-Dashboard").description("Example-Dashboard").widgets(Collections.singletonList(newWidget().definition(newWidgetDefinition(newDistributionWidgetDefinition().title("Events Platform - Request latency HOP").titleSize("16").titleAlign(WidgetTextAlign.LEFT).showLegend(false).type(DistributionWidgetDefinitionType.DISTRIBUTION).xaxis(newDistributionWidgetXAxis().max("auto").includeZero(true).scale("linear").min("auto")).yaxis(newDistributionWidgetYAxis().max("auto").includeZero(true).scale("linear").min("auto")).requests(Collections.singletonList(newDistributionWidgetRequest().query(newDistributionWidgetHistogramRequestQuery(newFormulaAndFunctionEventQueryDefinition().search(newFormulaAndFunctionEventQueryDefinitionSearch().query("")).dataSource(FormulaAndFunctionEventsDataSource.EVENTS).compute(newFormulaAndFunctionEventQueryDefinitionCompute().metric("@duration").aggregation(FormulaAndFunctionEventAggregation.MIN)).name("query1").indexes(Collections.singletonList("*")))).requestType(DistributionWidgetHistogramRequestType.HISTOGRAM))))).layout(newWidgetLayout().x(0L).y(0L).width(4L).height(2L)))).layoutType(DashboardLayoutType.ORDERED);try{Dashboardresult=apiInstance.createDashboard(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DashboardsApi#createDashboard");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Create a distribution widget using a histogram request containing a formulas and functions// metrics queryimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.DashboardsApi;importcom.datadog.api.client.v1.model.Dashboard;importcom.datadog.api.client.v1.model.DashboardLayoutType;importcom.datadog.api.client.v1.model.DistributionWidgetDefinition;importcom.datadog.api.client.v1.model.DistributionWidgetDefinitionType;importcom.datadog.api.client.v1.model.DistributionWidgetHistogramRequestQuery;importcom.datadog.api.client.v1.model.DistributionWidgetHistogramRequestType;importcom.datadog.api.client.v1.model.DistributionWidgetRequest;importcom.datadog.api.client.v1.model.DistributionWidgetXAxis;importcom.datadog.api.client.v1.model.DistributionWidgetYAxis;importcom.datadog.api.client.v1.model.FormulaAndFunctionMetricDataSource;importcom.datadog.api.client.v1.model.FormulaAndFunctionMetricQueryDefinition;importcom.datadog.api.client.v1.model.Widget;importcom.datadog.api.client.v1.model.WidgetCustomLink;importcom.datadog.api.client.v1.model.WidgetDefinition;importcom.datadog.api.client.v1.model.WidgetLayout;importcom.datadog.api.client.v1.model.WidgetStyle;importcom.datadog.api.client.v1.model.WidgetTextAlign;importjava.util.Collections;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();DashboardsApiapiInstance=newDashboardsApi(defaultClient);Dashboardbody=newDashboard().title("Example-Dashboard").widgets(Collections.singletonList(newWidget().definition(newWidgetDefinition(newDistributionWidgetDefinition().title("Metrics HOP").titleSize("16").titleAlign(WidgetTextAlign.LEFT).showLegend(false).type(DistributionWidgetDefinitionType.DISTRIBUTION).customLinks(Collections.singletonList(newWidgetCustomLink().label("Example").link("https://example.org/"))).xaxis(newDistributionWidgetXAxis().max("auto").includeZero(true).scale("linear").min("auto")).yaxis(newDistributionWidgetYAxis().max("auto").includeZero(true).scale("linear").min("auto")).requests(Collections.singletonList(newDistributionWidgetRequest().query(newDistributionWidgetHistogramRequestQuery(newFormulaAndFunctionMetricQueryDefinition().query("histogram:trace.Load{*}").dataSource(FormulaAndFunctionMetricDataSource.METRICS).name("query1"))).requestType(DistributionWidgetHistogramRequestType.HISTOGRAM).style(newWidgetStyle().palette("dog_classic")))))).layout(newWidgetLayout().x(0L).y(0L).width(4L).height(2L)))).layoutType(DashboardLayoutType.ORDERED);try{Dashboardresult=apiInstance.createDashboard(body);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DashboardsApi#createDashboard");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
"""
Create a distribution widget using a histogram request containing a formulas and functions APM Stats query
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.dashboards_apiimportDashboardsApifromdatadog_api_client.v1.model.dashboardimportDashboardfromdatadog_api_client.v1.model.dashboard_layout_typeimportDashboardLayoutTypefromdatadog_api_client.v1.model.distribution_widget_definitionimportDistributionWidgetDefinitionfromdatadog_api_client.v1.model.distribution_widget_definition_typeimportDistributionWidgetDefinitionTypefromdatadog_api_client.v1.model.distribution_widget_histogram_request_typeimport(DistributionWidgetHistogramRequestType,)fromdatadog_api_client.v1.model.distribution_widget_requestimportDistributionWidgetRequestfromdatadog_api_client.v1.model.distribution_widget_x_axisimportDistributionWidgetXAxisfromdatadog_api_client.v1.model.distribution_widget_y_axisimportDistributionWidgetYAxisfromdatadog_api_client.v1.model.formula_and_function_apm_resource_stat_nameimport(FormulaAndFunctionApmResourceStatName,)fromdatadog_api_client.v1.model.formula_and_function_apm_resource_stats_data_sourceimport(FormulaAndFunctionApmResourceStatsDataSource,)fromdatadog_api_client.v1.model.formula_and_function_apm_resource_stats_query_definitionimport(FormulaAndFunctionApmResourceStatsQueryDefinition,)fromdatadog_api_client.v1.model.widgetimportWidgetfromdatadog_api_client.v1.model.widget_layoutimportWidgetLayoutfromdatadog_api_client.v1.model.widget_styleimportWidgetStylefromdatadog_api_client.v1.model.widget_text_alignimportWidgetTextAlignbody=Dashboard(title="Example-Dashboard",description="",widgets=[Widget(definition=DistributionWidgetDefinition(title="APM Stats - Request latency HOP",title_size="16",title_align=WidgetTextAlign.LEFT,show_legend=False,type=DistributionWidgetDefinitionType.DISTRIBUTION,xaxis=DistributionWidgetXAxis(max="auto",include_zero=True,scale="linear",min="auto",),yaxis=DistributionWidgetYAxis(max="auto",include_zero=True,scale="linear",min="auto",),requests=[DistributionWidgetRequest(query=FormulaAndFunctionApmResourceStatsQueryDefinition(primary_tag_value="*",stat=FormulaAndFunctionApmResourceStatName.LATENCY_DISTRIBUTION,data_source=FormulaAndFunctionApmResourceStatsDataSource.APM_RESOURCE_STATS,name="query1",service="azure-bill-import",group_by=["resource_name",],env="staging",primary_tag_name="datacenter",operation_name="universal.http.client",),request_type=DistributionWidgetHistogramRequestType.HISTOGRAM,style=WidgetStyle(palette="dog_classic",),),],),layout=WidgetLayout(x=8,y=0,width=4,height=2,),),],layout_type=DashboardLayoutType.ORDERED,)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=DashboardsApi(api_client)response=api_instance.create_dashboard(body=body)print(response)
"""
Create a distribution widget using a histogram request containing a formulas and functions events query
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.dashboards_apiimportDashboardsApifromdatadog_api_client.v1.model.dashboardimportDashboardfromdatadog_api_client.v1.model.dashboard_layout_typeimportDashboardLayoutTypefromdatadog_api_client.v1.model.distribution_widget_definitionimportDistributionWidgetDefinitionfromdatadog_api_client.v1.model.distribution_widget_definition_typeimportDistributionWidgetDefinitionTypefromdatadog_api_client.v1.model.distribution_widget_histogram_request_typeimport(DistributionWidgetHistogramRequestType,)fromdatadog_api_client.v1.model.distribution_widget_requestimportDistributionWidgetRequestfromdatadog_api_client.v1.model.distribution_widget_x_axisimportDistributionWidgetXAxisfromdatadog_api_client.v1.model.distribution_widget_y_axisimportDistributionWidgetYAxisfromdatadog_api_client.v1.model.formula_and_function_event_aggregationimportFormulaAndFunctionEventAggregationfromdatadog_api_client.v1.model.formula_and_function_event_query_definitionimport(FormulaAndFunctionEventQueryDefinition,)fromdatadog_api_client.v1.model.formula_and_function_event_query_definition_computeimport(FormulaAndFunctionEventQueryDefinitionCompute,)fromdatadog_api_client.v1.model.formula_and_function_event_query_definition_searchimport(FormulaAndFunctionEventQueryDefinitionSearch,)fromdatadog_api_client.v1.model.formula_and_function_events_data_sourceimportFormulaAndFunctionEventsDataSourcefromdatadog_api_client.v1.model.widgetimportWidgetfromdatadog_api_client.v1.model.widget_layoutimportWidgetLayoutfromdatadog_api_client.v1.model.widget_text_alignimportWidgetTextAlignbody=Dashboard(title="Example-Dashboard",description="Example-Dashboard",widgets=[Widget(definition=DistributionWidgetDefinition(title="Events Platform - Request latency HOP",title_size="16",title_align=WidgetTextAlign.LEFT,show_legend=False,type=DistributionWidgetDefinitionType.DISTRIBUTION,xaxis=DistributionWidgetXAxis(max="auto",include_zero=True,scale="linear",min="auto",),yaxis=DistributionWidgetYAxis(max="auto",include_zero=True,scale="linear",min="auto",),requests=[DistributionWidgetRequest(query=FormulaAndFunctionEventQueryDefinition(search=FormulaAndFunctionEventQueryDefinitionSearch(query="",),data_source=FormulaAndFunctionEventsDataSource.EVENTS,compute=FormulaAndFunctionEventQueryDefinitionCompute(metric="@duration",aggregation=FormulaAndFunctionEventAggregation.MIN,),name="query1",indexes=["*",],group_by=[],),request_type=DistributionWidgetHistogramRequestType.HISTOGRAM,),],),layout=WidgetLayout(x=0,y=0,width=4,height=2,),),],layout_type=DashboardLayoutType.ORDERED,)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=DashboardsApi(api_client)response=api_instance.create_dashboard(body=body)print(response)
"""
Create a distribution widget using a histogram request containing a formulas and functions metrics query
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.dashboards_apiimportDashboardsApifromdatadog_api_client.v1.model.dashboardimportDashboardfromdatadog_api_client.v1.model.dashboard_layout_typeimportDashboardLayoutTypefromdatadog_api_client.v1.model.distribution_widget_definitionimportDistributionWidgetDefinitionfromdatadog_api_client.v1.model.distribution_widget_definition_typeimportDistributionWidgetDefinitionTypefromdatadog_api_client.v1.model.distribution_widget_histogram_request_typeimport(DistributionWidgetHistogramRequestType,)fromdatadog_api_client.v1.model.distribution_widget_requestimportDistributionWidgetRequestfromdatadog_api_client.v1.model.distribution_widget_x_axisimportDistributionWidgetXAxisfromdatadog_api_client.v1.model.distribution_widget_y_axisimportDistributionWidgetYAxisfromdatadog_api_client.v1.model.formula_and_function_metric_data_sourceimportFormulaAndFunctionMetricDataSourcefromdatadog_api_client.v1.model.formula_and_function_metric_query_definitionimport(FormulaAndFunctionMetricQueryDefinition,)fromdatadog_api_client.v1.model.widgetimportWidgetfromdatadog_api_client.v1.model.widget_custom_linkimportWidgetCustomLinkfromdatadog_api_client.v1.model.widget_layoutimportWidgetLayoutfromdatadog_api_client.v1.model.widget_styleimportWidgetStylefromdatadog_api_client.v1.model.widget_text_alignimportWidgetTextAlignbody=Dashboard(title="Example-Dashboard",widgets=[Widget(definition=DistributionWidgetDefinition(title="Metrics HOP",title_size="16",title_align=WidgetTextAlign.LEFT,show_legend=False,type=DistributionWidgetDefinitionType.DISTRIBUTION,custom_links=[WidgetCustomLink(label="Example",link="https://example.org/",),],xaxis=DistributionWidgetXAxis(max="auto",include_zero=True,scale="linear",min="auto",),yaxis=DistributionWidgetYAxis(max="auto",include_zero=True,scale="linear",min="auto",),requests=[DistributionWidgetRequest(query=FormulaAndFunctionMetricQueryDefinition(query="histogram:trace.Load{*}",data_source=FormulaAndFunctionMetricDataSource.METRICS,name="query1",),request_type=DistributionWidgetHistogramRequestType.HISTOGRAM,style=WidgetStyle(palette="dog_classic",),),],),layout=WidgetLayout(x=0,y=0,width=4,height=2,),),],layout_type=DashboardLayoutType.ORDERED,)configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=DashboardsApi(api_client)response=api_instance.create_dashboard(body=body)print(response)
# Create a distribution widget using a histogram request containing a formulas and functions APM Stats queryrequire"datadog_api_client"api_instance=DatadogAPIClient::V1::DashboardsAPI.newbody=DatadogAPIClient::V1::Dashboard.new({title:"Example-Dashboard",description:"",widgets:[DatadogAPIClient::V1::Widget.new({definition:DatadogAPIClient::V1::DistributionWidgetDefinition.new({title:"APM Stats - Request latency HOP",title_size:"16",title_align:DatadogAPIClient::V1::WidgetTextAlign::LEFT,show_legend:false,type:DatadogAPIClient::V1::DistributionWidgetDefinitionType::DISTRIBUTION,xaxis:DatadogAPIClient::V1::DistributionWidgetXAxis.new({max:"auto",include_zero:true,scale:"linear",min:"auto",}),yaxis:DatadogAPIClient::V1::DistributionWidgetYAxis.new({max:"auto",include_zero:true,scale:"linear",min:"auto",}),requests:[DatadogAPIClient::V1::DistributionWidgetRequest.new({query:DatadogAPIClient::V1::FormulaAndFunctionApmResourceStatsQueryDefinition.new({primary_tag_value:"*",stat:DatadogAPIClient::V1::FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,data_source:DatadogAPIClient::V1::FormulaAndFunctionApmResourceStatsDataSource::APM_RESOURCE_STATS,name:"query1",service:"azure-bill-import",group_by:["resource_name",],env:"staging",primary_tag_name:"datacenter",operation_name:"universal.http.client",}),request_type:DatadogAPIClient::V1::DistributionWidgetHistogramRequestType::HISTOGRAM,style:DatadogAPIClient::V1::WidgetStyle.new({palette:"dog_classic",}),}),],}),layout:DatadogAPIClient::V1::WidgetLayout.new({x:8,y:0,width:4,height:2,}),}),],layout_type:DatadogAPIClient::V1::DashboardLayoutType::ORDERED,})papi_instance.create_dashboard(body)
# Create a distribution widget using a histogram request containing a formulas and functions events queryrequire"datadog_api_client"api_instance=DatadogAPIClient::V1::DashboardsAPI.newbody=DatadogAPIClient::V1::Dashboard.new({title:"Example-Dashboard",description:"Example-Dashboard",widgets:[DatadogAPIClient::V1::Widget.new({definition:DatadogAPIClient::V1::DistributionWidgetDefinition.new({title:"Events Platform - Request latency HOP",title_size:"16",title_align:DatadogAPIClient::V1::WidgetTextAlign::LEFT,show_legend:false,type:DatadogAPIClient::V1::DistributionWidgetDefinitionType::DISTRIBUTION,xaxis:DatadogAPIClient::V1::DistributionWidgetXAxis.new({max:"auto",include_zero:true,scale:"linear",min:"auto",}),yaxis:DatadogAPIClient::V1::DistributionWidgetYAxis.new({max:"auto",include_zero:true,scale:"linear",min:"auto",}),requests:[DatadogAPIClient::V1::DistributionWidgetRequest.new({query:DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinition.new({search:DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionSearch.new({query:"",}),data_source:DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource::EVENTS,compute:DatadogAPIClient::V1::FormulaAndFunctionEventQueryDefinitionCompute.new({metric:"@duration",aggregation:DatadogAPIClient::V1::FormulaAndFunctionEventAggregation::MIN,}),name:"query1",indexes:["*",],group_by:[],}),request_type:DatadogAPIClient::V1::DistributionWidgetHistogramRequestType::HISTOGRAM,}),],}),layout:DatadogAPIClient::V1::WidgetLayout.new({x:0,y:0,width:4,height:2,}),}),],layout_type:DatadogAPIClient::V1::DashboardLayoutType::ORDERED,})papi_instance.create_dashboard(body)
# Create a distribution widget using a histogram request containing a formulas and functions metrics queryrequire"datadog_api_client"api_instance=DatadogAPIClient::V1::DashboardsAPI.newbody=DatadogAPIClient::V1::Dashboard.new({title:"Example-Dashboard",widgets:[DatadogAPIClient::V1::Widget.new({definition:DatadogAPIClient::V1::DistributionWidgetDefinition.new({title:"Metrics HOP",title_size:"16",title_align:DatadogAPIClient::V1::WidgetTextAlign::LEFT,show_legend:false,type:DatadogAPIClient::V1::DistributionWidgetDefinitionType::DISTRIBUTION,custom_links:[DatadogAPIClient::V1::WidgetCustomLink.new({label:"Example",link:"https://example.org/",}),],xaxis:DatadogAPIClient::V1::DistributionWidgetXAxis.new({max:"auto",include_zero:true,scale:"linear",min:"auto",}),yaxis:DatadogAPIClient::V1::DistributionWidgetYAxis.new({max:"auto",include_zero:true,scale:"linear",min:"auto",}),requests:[DatadogAPIClient::V1::DistributionWidgetRequest.new({query:DatadogAPIClient::V1::FormulaAndFunctionMetricQueryDefinition.new({query:"histogram:trace.Load{*}",data_source:DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource::METRICS,name:"query1",}),request_type:DatadogAPIClient::V1::DistributionWidgetHistogramRequestType::HISTOGRAM,style:DatadogAPIClient::V1::WidgetStyle.new({palette:"dog_classic",}),}),],}),layout:DatadogAPIClient::V1::WidgetLayout.new({x:0,y:0,width:4,height:2,}),}),],layout_type:DatadogAPIClient::V1::DashboardLayoutType::ORDERED,})papi_instance.create_dashboard(body)
// Create a distribution widget using a histogram request containing a formulas
// and functions APM Stats query
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_dashboards::DashboardsAPI;usedatadog_api_client::datadogV1::model::Dashboard;usedatadog_api_client::datadogV1::model::DashboardLayoutType;usedatadog_api_client::datadogV1::model::DistributionWidgetDefinition;usedatadog_api_client::datadogV1::model::DistributionWidgetDefinitionType;usedatadog_api_client::datadogV1::model::DistributionWidgetHistogramRequestQuery;usedatadog_api_client::datadogV1::model::DistributionWidgetHistogramRequestType;usedatadog_api_client::datadogV1::model::DistributionWidgetRequest;usedatadog_api_client::datadogV1::model::DistributionWidgetXAxis;usedatadog_api_client::datadogV1::model::DistributionWidgetYAxis;usedatadog_api_client::datadogV1::model::FormulaAndFunctionApmResourceStatName;usedatadog_api_client::datadogV1::model::FormulaAndFunctionApmResourceStatsDataSource;usedatadog_api_client::datadogV1::model::FormulaAndFunctionApmResourceStatsQueryDefinition;usedatadog_api_client::datadogV1::model::Widget;usedatadog_api_client::datadogV1::model::WidgetDefinition;usedatadog_api_client::datadogV1::model::WidgetLayout;usedatadog_api_client::datadogV1::model::WidgetStyle;usedatadog_api_client::datadogV1::model::WidgetTextAlign;#[tokio::main]asyncfnmain(){letbody=Dashboard::new(DashboardLayoutType::ORDERED,"Example-Dashboard".to_string(),vec![Widget::new(WidgetDefinition::DistributionWidgetDefinition(Box::new(DistributionWidgetDefinition::new(vec![DistributionWidgetRequest::new().query(DistributionWidgetHistogramRequestQuery::FormulaAndFunctionApmResourceStatsQueryDefinition(Box::new(FormulaAndFunctionApmResourceStatsQueryDefinition::new(FormulaAndFunctionApmResourceStatsDataSource::APM_RESOURCE_STATS,"staging".to_string(),"query1".to_string(),"azure-bill-import".to_string(),FormulaAndFunctionApmResourceStatName::LATENCY_DISTRIBUTION,).group_by(vec!["resource_name".to_string()]).operation_name("universal.http.client".to_string()).primary_tag_name("datacenter".to_string()).primary_tag_value("*".to_string()),),),).request_type(DistributionWidgetHistogramRequestType::HISTOGRAM).style(WidgetStyle::new().palette("dog_classic".to_string()))],DistributionWidgetDefinitionType::DISTRIBUTION,).show_legend(false).title("APM Stats - Request latency HOP".to_string()).title_align(WidgetTextAlign::LEFT).title_size("16".to_string()).xaxis(DistributionWidgetXAxis::new().include_zero(true).max("auto".to_string()).min("auto".to_string()).scale("linear".to_string()),).yaxis(DistributionWidgetYAxis::new().include_zero(true).max("auto".to_string()).min("auto".to_string()).scale("linear".to_string()),),),),).layout(WidgetLayout::new(2,4,8,0))],).description(Some("".to_string()));letconfiguration=datadog::Configuration::new();letapi=DashboardsAPI::with_config(configuration);letresp=api.create_dashboard(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
// Create a distribution widget using a histogram request containing a formulas
// and functions events query
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_dashboards::DashboardsAPI;usedatadog_api_client::datadogV1::model::Dashboard;usedatadog_api_client::datadogV1::model::DashboardLayoutType;usedatadog_api_client::datadogV1::model::DistributionWidgetDefinition;usedatadog_api_client::datadogV1::model::DistributionWidgetDefinitionType;usedatadog_api_client::datadogV1::model::DistributionWidgetHistogramRequestQuery;usedatadog_api_client::datadogV1::model::DistributionWidgetHistogramRequestType;usedatadog_api_client::datadogV1::model::DistributionWidgetRequest;usedatadog_api_client::datadogV1::model::DistributionWidgetXAxis;usedatadog_api_client::datadogV1::model::DistributionWidgetYAxis;usedatadog_api_client::datadogV1::model::FormulaAndFunctionEventAggregation;usedatadog_api_client::datadogV1::model::FormulaAndFunctionEventQueryDefinition;usedatadog_api_client::datadogV1::model::FormulaAndFunctionEventQueryDefinitionCompute;usedatadog_api_client::datadogV1::model::FormulaAndFunctionEventQueryDefinitionSearch;usedatadog_api_client::datadogV1::model::FormulaAndFunctionEventsDataSource;usedatadog_api_client::datadogV1::model::Widget;usedatadog_api_client::datadogV1::model::WidgetDefinition;usedatadog_api_client::datadogV1::model::WidgetLayout;usedatadog_api_client::datadogV1::model::WidgetTextAlign;#[tokio::main]asyncfnmain(){letbody=Dashboard::new(DashboardLayoutType::ORDERED,"Example-Dashboard".to_string(),vec![Widget::new(WidgetDefinition::DistributionWidgetDefinition(Box::new(DistributionWidgetDefinition::new(vec![DistributionWidgetRequest::new().query(DistributionWidgetHistogramRequestQuery::FormulaAndFunctionEventQueryDefinition(Box::new(FormulaAndFunctionEventQueryDefinition::new(FormulaAndFunctionEventQueryDefinitionCompute::new(FormulaAndFunctionEventAggregation::MIN,).metric("@duration".to_string()),FormulaAndFunctionEventsDataSource::EVENTS,"query1".to_string(),).group_by(vec![]).indexes(vec!["*".to_string()]).search(FormulaAndFunctionEventQueryDefinitionSearch::new("".to_string(),),),),),).request_type(DistributionWidgetHistogramRequestType::HISTOGRAM)],DistributionWidgetDefinitionType::DISTRIBUTION,).show_legend(false).title("Events Platform - Request latency HOP".to_string()).title_align(WidgetTextAlign::LEFT).title_size("16".to_string()).xaxis(DistributionWidgetXAxis::new().include_zero(true).max("auto".to_string()).min("auto".to_string()).scale("linear".to_string()),).yaxis(DistributionWidgetYAxis::new().include_zero(true).max("auto".to_string()).min("auto".to_string()).scale("linear".to_string()),),),),).layout(WidgetLayout::new(2,4,0,0))],).description(Some("Example-Dashboard".to_string()));letconfiguration=datadog::Configuration::new();letapi=DashboardsAPI::with_config(configuration);letresp=api.create_dashboard(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
// Create a distribution widget using a histogram request containing a formulas
// and functions metrics query
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_dashboards::DashboardsAPI;usedatadog_api_client::datadogV1::model::Dashboard;usedatadog_api_client::datadogV1::model::DashboardLayoutType;usedatadog_api_client::datadogV1::model::DistributionWidgetDefinition;usedatadog_api_client::datadogV1::model::DistributionWidgetDefinitionType;usedatadog_api_client::datadogV1::model::DistributionWidgetHistogramRequestQuery;usedatadog_api_client::datadogV1::model::DistributionWidgetHistogramRequestType;usedatadog_api_client::datadogV1::model::DistributionWidgetRequest;usedatadog_api_client::datadogV1::model::DistributionWidgetXAxis;usedatadog_api_client::datadogV1::model::DistributionWidgetYAxis;usedatadog_api_client::datadogV1::model::FormulaAndFunctionMetricDataSource;usedatadog_api_client::datadogV1::model::FormulaAndFunctionMetricQueryDefinition;usedatadog_api_client::datadogV1::model::Widget;usedatadog_api_client::datadogV1::model::WidgetCustomLink;usedatadog_api_client::datadogV1::model::WidgetDefinition;usedatadog_api_client::datadogV1::model::WidgetLayout;usedatadog_api_client::datadogV1::model::WidgetStyle;usedatadog_api_client::datadogV1::model::WidgetTextAlign;#[tokio::main]asyncfnmain(){letbody=Dashboard::new(DashboardLayoutType::ORDERED,"Example-Dashboard".to_string(),vec![Widget::new(WidgetDefinition::DistributionWidgetDefinition(Box::new(DistributionWidgetDefinition::new(vec![DistributionWidgetRequest::new().query(DistributionWidgetHistogramRequestQuery::FormulaAndFunctionMetricQueryDefinition(Box::new(FormulaAndFunctionMetricQueryDefinition::new(FormulaAndFunctionMetricDataSource::METRICS,"query1".to_string(),"histogram:trace.Load{*}".to_string(),),),),).request_type(DistributionWidgetHistogramRequestType::HISTOGRAM).style(WidgetStyle::new().palette("dog_classic".to_string()))],DistributionWidgetDefinitionType::DISTRIBUTION,).custom_links(vec![WidgetCustomLink::new().label("Example".to_string()).link("https://example.org/".to_string())],).show_legend(false).title("Metrics HOP".to_string()).title_align(WidgetTextAlign::LEFT).title_size("16".to_string()).xaxis(DistributionWidgetXAxis::new().include_zero(true).max("auto".to_string()).min("auto".to_string()).scale("linear".to_string()),).yaxis(DistributionWidgetYAxis::new().include_zero(true).max("auto".to_string()).min("auto".to_string()).scale("linear".to_string()),),),),).layout(WidgetLayout::new(2,4,0,0))],);letconfiguration=datadog::Configuration::new();letapi=DashboardsAPI::with_config(configuration);letresp=api.create_dashboard(body).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create a distribution widget using a histogram request containing a formulas and functions APM Stats query
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.DashboardsApi(configuration);constparams: v1.DashboardsApiCreateDashboardRequest={body:{title:"Example-Dashboard",description:"",widgets:[{definition:{title:"APM Stats - Request latency HOP",titleSize:"16",titleAlign:"left",showLegend: false,type:"distribution",xaxis:{max:"auto",includeZero: true,scale:"linear",min:"auto",},yaxis:{max:"auto",includeZero: true,scale:"linear",min:"auto",},requests:[{query:{primaryTagValue:"*",stat:"latency_distribution",dataSource:"apm_resource_stats",name:"query1",service:"azure-bill-import",groupBy:["resource_name"],env:"staging",primaryTagName:"datacenter",operationName:"universal.http.client",},requestType:"histogram",style:{palette:"dog_classic",},},],},layout:{x: 8,y: 0,width: 4,height: 2,},},],layoutType:"ordered",},};apiInstance.createDashboard(params).then((data: v1.Dashboard)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
/**
* Create a distribution widget using a histogram request containing a formulas and functions events query
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.DashboardsApi(configuration);constparams: v1.DashboardsApiCreateDashboardRequest={body:{title:"Example-Dashboard",description:"Example-Dashboard",widgets:[{definition:{title:"Events Platform - Request latency HOP",titleSize:"16",titleAlign:"left",showLegend: false,type:"distribution",xaxis:{max:"auto",includeZero: true,scale:"linear",min:"auto",},yaxis:{max:"auto",includeZero: true,scale:"linear",min:"auto",},requests:[{query:{search:{query:"",},dataSource:"events",compute:{metric:"@duration",aggregation:"min",},name:"query1",indexes:["*"],groupBy:[],},requestType:"histogram",},],},layout:{x: 0,y: 0,width: 4,height: 2,},},],layoutType:"ordered",},};apiInstance.createDashboard(params).then((data: v1.Dashboard)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
/**
* Create a distribution widget using a histogram request containing a formulas and functions metrics query
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.DashboardsApi(configuration);constparams: v1.DashboardsApiCreateDashboardRequest={body:{title:"Example-Dashboard",widgets:[{definition:{title:"Metrics HOP",titleSize:"16",titleAlign:"left",showLegend: false,type:"distribution",customLinks:[{label:"Example",link:"https://example.org/",},],xaxis:{max:"auto",includeZero: true,scale:"linear",min:"auto",},yaxis:{max:"auto",includeZero: true,scale:"linear",min:"auto",},requests:[{query:{query:"histogram:trace.Load{*}",dataSource:"metrics",name:"query1",},requestType:"histogram",style:{palette:"dog_classic",},},],},layout:{x: 0,y: 0,width: 4,height: 2,},},],layoutType:"ordered",},};apiInstance.createDashboard(params).then((data: v1.Dashboard)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
A dashboard is Datadog’s tool for visually tracking, analyzing, and displaying
key performance metrics, which enable you to monitor the health of your infrastructure.
Expand All
フィールド
種類
説明
author_handle
string
Identifier of the dashboard author.
author_name
string
Name of the dashboard author.
created_at
date-time
Creation date of the dashboard.
description
string
Description of the dashboard.
id
string
ID of the dashboard.
is_read_only
boolean
DEPRECATED: Whether this dashboard is read-only. If True, only the author and admins can make changes to it.
This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.
layout_type [required]
enum
Layout type of the dashboard.
Allowed enum values: ordered,free
modified_at
date-time
Modification date of the dashboard.
notify_list
[string]
List of handles of users to notify when changes are made to this dashboard.
reflow_type
enum
Reflow type for a new dashboard layout dashboard. Set this only when layout type is 'ordered'.
If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto',
widgets should not have layouts.
Allowed enum values: auto,fixed
restricted_roles
[string]
DEPRECATED: A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard.
This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.
tags
[string]
List of team names representing ownership of a dashboard.
template_variable_presets
[object]
Array of template variables saved views.
name
string
The name of the variable.
template_variables
[object]
List of variables.
name
string
The name of the variable.
value
string
DEPRECATED: (deprecated) The value of the template variable within the saved view. Cannot be used in conjunction with values.
values
[string]
One or many template variable values within the saved view, which will be unioned together using OR if more than one is specified. Cannot be used in conjunction with value.
template_variables
[object]
List of template variables for this dashboard.
available_values
[string]
The list of values that the template variable drop-down is limited to.
default
string
DEPRECATED: (deprecated) The default value for the template variable on dashboard load. Cannot be used in conjunction with defaults.
defaults
[string]
One or many default values for template variables on load. If more than one default is specified, they will be unioned together with OR. Cannot be used in conjunction with default.
name [required]
string
The name of the variable.
prefix
string
The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.
The layout for a widget on a free or new dashboard layout dashboard.
height [required]
int64
The height of the widget. Should be a non-negative integer.
is_column_break
boolean
Whether the widget should be the first one on the second column in high density or not.
Note: Only for the new dashboard layout and only one widget in the dashboard should have this property set to true.
width [required]
int64
The width of the widget. Should be a non-negative integer.
x [required]
int64
The position of the widget on the x (horizontal) axis. Should be a non-negative integer.
y [required]
int64
The position of the widget on the y (vertical) axis. Should be a non-negative integer.
"""
Get a dashboard returns "OK" response
"""fromosimportenvironfromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.dashboards_apiimportDashboardsApi# there is a valid "dashboard" in the systemDASHBOARD_ID=environ["DASHBOARD_ID"]configuration=Configuration()withApiClient(configuration)asapi_client:api_instance=DashboardsApi(api_client)response=api_instance.get_dashboard(dashboard_id=DASHBOARD_ID,)print(response)
# Get a dashboard returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::DashboardsAPI.new# there is a valid "dashboard" in the systemDASHBOARD_ID=ENV["DASHBOARD_ID"]papi_instance.get_dashboard(DASHBOARD_ID)
// Get a dashboard returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){// there is a valid "dashboard" in the system
DashboardID:=os.Getenv("DASHBOARD_ID")ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewDashboardsApi(apiClient)resp,r,err:=api.GetDashboard(ctx,DashboardID)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DashboardsApi.GetDashboard`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DashboardsApi.GetDashboard`:\n%s\n",responseContent)}
// Get a dashboard returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.DashboardsApi;importcom.datadog.api.client.v1.model.Dashboard;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();DashboardsApiapiInstance=newDashboardsApi(defaultClient);// there is a valid "dashboard" in the systemStringDASHBOARD_ID=System.getenv("DASHBOARD_ID");try{Dashboardresult=apiInstance.getDashboard(DASHBOARD_ID);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DashboardsApi#getDashboard");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get a dashboard returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_dashboards::DashboardsAPI;#[tokio::main]asyncfnmain(){// there is a valid "dashboard" in the system
letdashboard_id=std::env::var("DASHBOARD_ID").unwrap();letconfiguration=datadog::Configuration::new();letapi=DashboardsAPI::with_config(configuration);letresp=api.get_dashboard(dashboard_id.clone()).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get a dashboard returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.DashboardsApi(configuration);// there is a valid "dashboard" in the system
constDASHBOARD_ID=process.env.DASHBOARD_IDasstring;constparams: v1.DashboardsApiGetDashboardRequest={dashboardId: DASHBOARD_ID,};apiInstance.getDashboard(params).then((data: v1.Dashboard)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
"""
Get all dashboards returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v1.api.dashboards_apiimportDashboardsApiconfiguration=Configuration()withApiClient(configuration)asapi_client:api_instance=DashboardsApi(api_client)response=api_instance.list_dashboards(filter_shared=False,)print(response)
# Get all dashboards returns "OK" responserequire"datadog_api_client"api_instance=DatadogAPIClient::V1::DashboardsAPI.newopts={filter_shared:false,}papi_instance.list_dashboards(opts)
// Get all dashboards returns "OK" response
packagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV1")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()apiClient:=datadog.NewAPIClient(configuration)api:=datadogV1.NewDashboardsApi(apiClient)resp,r,err:=api.ListDashboards(ctx,*datadogV1.NewListDashboardsOptionalParameters().WithFilterShared(false))iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `DashboardsApi.ListDashboards`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `DashboardsApi.ListDashboards`:\n%s\n",responseContent)}
// Get all dashboards returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v1.api.DashboardsApi;importcom.datadog.api.client.v1.api.DashboardsApi.ListDashboardsOptionalParameters;importcom.datadog.api.client.v1.model.DashboardSummary;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();DashboardsApiapiInstance=newDashboardsApi(defaultClient);try{DashboardSummaryresult=apiInstance.listDashboards(newListDashboardsOptionalParameters().filterShared(false));System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling DashboardsApi#listDashboards");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// Get all dashboards returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV1::api_dashboards::DashboardsAPI;usedatadog_api_client::datadogV1::api_dashboards::ListDashboardsOptionalParams;#[tokio::main]asyncfnmain(){letconfiguration=datadog::Configuration::new();letapi=DashboardsAPI::with_config(configuration);letresp=api.list_dashboards(ListDashboardsOptionalParams::default().filter_shared(false)).await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Get all dashboards returns "OK" response
*/import{client,v1}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();constapiInstance=newv1.DashboardsApi(configuration);constparams: v1.DashboardsApiListDashboardsRequest={filterShared: false,};apiInstance.listDashboards(params).then((data: v1.DashboardSummary)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));
DEPRECATED: Whether this dashboard is read-only. If True, only the author and admins can make changes to it.
This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.
layout_type [required]
enum
Layout type of the dashboard.
Allowed enum values: ordered,free
modified_at
date-time
Modification date of the dashboard.
notify_list
[string]
List of handles of users to notify when changes are made to this dashboard.
reflow_type
enum
Reflow type for a new dashboard layout dashboard. Set this only when layout type is 'ordered'.
If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto',
widgets should not have layouts.
Allowed enum values: auto,fixed
restricted_roles
[string]
DEPRECATED: A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard.
This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.
tags
[string]
List of team names representing ownership of a dashboard.
template_variable_presets
[object]
Array of template variables saved views.
name
string
The name of the variable.
template_variables
[object]
List of variables.
name
string
The name of the variable.
value
string
DEPRECATED: (deprecated) The value of the template variable within the saved view. Cannot be used in conjunction with values.
values
[string]
One or many template variable values within the saved view, which will be unioned together using OR if more than one is specified. Cannot be used in conjunction with value.
template_variables
[object]
List of template variables for this dashboard.
available_values
[string]
The list of values that the template variable drop-down is limited to.
default
string
DEPRECATED: (deprecated) The default value for the template variable on dashboard load. Cannot be used in conjunction with defaults.
defaults
[string]
One or many default values for template variables on load. If more than one default is specified, they will be unioned together with OR. Cannot be used in conjunction with default.
name [required]
string
The name of the variable.
prefix
string
The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.
The layout for a widget on a free or new dashboard layout dashboard.
height [required]
int64
The height of the widget. Should be a non-negative integer.
is_column_break
boolean
Whether the widget should be the first one on the second column in high density or not.
Note: Only for the new dashboard layout and only one widget in the dashboard should have this property set to true.
width [required]
int64
The width of the widget. Should be a non-negative integer.
x [required]
int64
The position of the widget on the x (horizontal) axis. Should be a non-negative integer.
y [required]
int64
The position of the widget on the y (vertical) axis. Should be a non-negative integer.
{"layout_type":"ordered","title":"Example-Dashboard with list_stream widget","description":"Updated description","widgets":[{"definition":{"type":"list_stream","requests":[{"columns":[{"width":"auto","field":"timestamp"}],"query":{"data_source":"apm_issue_stream","query_string":""},"response_format":"event_list"}]}}]}
{"layout_type":"ordered","title":"Example-Dashboard with list_stream widget","description":"Updated description","tags":["team:foo","team:bar"],"widgets":[{"definition":{"type":"list_stream","requests":[{"columns":[{"width":"auto","field":"timestamp"}],"query":{"data_source":"apm_issue_stream","query_string":""},"response_format":"event_list"}]}}]}
A dashboard is Datadog’s tool for visually tracking, analyzing, and displaying
key performance metrics, which enable you to monitor the health of your infrastructure.
Expand All
フィールド
種類
説明
author_handle
string
Identifier of the dashboard author.
author_name
string
Name of the dashboard author.
created_at
date-time
Creation date of the dashboard.
description
string
Description of the dashboard.
id
string
ID of the dashboard.
is_read_only
boolean
DEPRECATED: Whether this dashboard is read-only. If True, only the author and admins can make changes to it.
This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.
layout_type [required]
enum
Layout type of the dashboard.
Allowed enum values: ordered,free
modified_at
date-time
Modification date of the dashboard.
notify_list
[string]
List of handles of users to notify when changes are made to this dashboard.
reflow_type
enum
Reflow type for a new dashboard layout dashboard. Set this only when layout type is 'ordered'.
If set to 'fixed', the dashboard expects all widgets to have a layout, and if it's set to 'auto',
widgets should not have layouts.
Allowed enum values: auto,fixed
restricted_roles
[string]
DEPRECATED: A list of role identifiers. Only the author and users associated with at least one of these roles can edit this dashboard.
This property is deprecated; please use the Restriction Policies API instead to manage write authorization for individual dashboards.
tags
[string]
List of team names representing ownership of a dashboard.
template_variable_presets
[object]
Array of template variables saved views.
name
string
The name of the variable.
template_variables
[object]
List of variables.
name
string
The name of the variable.
value
string
DEPRECATED: (deprecated) The value of the template variable within the saved view. Cannot be used in conjunction with values.
values
[string]
One or many template variable values within the saved view, which will be unioned together using OR if more than one is specified. Cannot be used in conjunction with value.
template_variables
[object]
List of template variables for this dashboard.
available_values
[string]
The list of values that the template variable drop-down is limited to.
default
string
DEPRECATED: (deprecated) The default value for the template variable on dashboard load. Cannot be used in conjunction with defaults.
defaults
[string]
One or many default values for template variables on load. If more than one default is specified, they will be unioned together with OR. Cannot be used in conjunction with default.
name [required]
string
The name of the variable.
prefix
string
The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.
The layout for a widget on a free or new dashboard layout dashboard.
height [required]
int64
The height of the widget. Should be a non-negative integer.
is_column_break
boolean
Whether the widget should be the first one on the second column in high density or not.
Note: Only for the new dashboard layout and only one widget in the dashboard should have this property set to true.
width [required]
int64
The width of the widget. Should be a non-negative integer.
x [required]
int64
The position of the widget on the x (horizontal) axis. Should be a non-negative integer.
y [required]
int64
The position of the widget on the y (vertical) axis. Should be a non-negative integer.