Each restricted dataset supports a maximum of 10 key:value pairs per product.
Tag key rules per telemetry type:
Only one tag key or attribute may be used to define access within a single telemetry type.
The same or different tag key may be used across different telemetry types.
Tag value uniqueness:
Tag values must be unique within a single dataset.
A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
attributes [required]
object
Dataset metadata and configurations.
name [required]
string
Name of the dataset.
principals [required]
[string]
List of access principals, formatted as principal_type:id. Principal can be 'team' or 'role'.
product_filters [required]
[object]
List of product-specific filters.
filters [required]
[string]
Defines the list of tag-based filters used to restrict access to telemetry data for a specific product.
These filters act as access control rules. Each filter must follow the tag query syntax used by
Datadog (such as @tag.key:value), and only one tag or attribute may be used to define the access strategy
per telemetry type.
product [required]
string
Name of the product the dataset is for. Possible values are 'apm', 'rum',
'metrics', 'logs', 'error_tracking', 'cloud_cost', and 'sd_repoinfo'.
type [required]
enum
Resource type, always set to dataset.
Allowed enum values: dataset
Each restricted dataset supports a maximum of 10 key:value pairs per product.
Tag Key Rules per Telemetry Type:
Only one tag key or attribute may be used to define access within a single telemetry type.
The same or different tag key may be used across different telemetry types.
Tag Value Uniqueness:
Tag values must be unique within a single dataset.
A tag value used in one dataset cannot be reused in another dataset of the same telemetry type.
attributes
object
Dataset metadata and configuration(s).
created_at
date-time
Timestamp when the dataset was created.
created_by
uuid
Unique ID of the user who created the dataset.
name
string
Name of the dataset.
principals
[string]
List of access principals, formatted as principal_type:id. Principal can be 'team' or 'role'.
product_filters
[object]
List of product-specific filters.
filters [required]
[string]
Defines the list of tag-based filters used to restrict access to telemetry data for a specific product.
These filters act as access control rules. Each filter must follow the tag query syntax used by
Datadog (such as @tag.key:value), and only one tag or attribute may be used to define the access strategy
per telemetry type.
product [required]
string
Name of the product the dataset is for. Possible values are 'apm', 'rum',
'metrics', 'logs', 'error_tracking', 'cloud_cost', and 'sd_repoinfo'.
id
string
Unique identifier for the dataset.
type
enum
Resource type, always set to dataset.
Allowed enum values: dataset
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* Create a dataset returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.createDataset"]=true;constapiInstance=newv2.DatasetsApi(configuration);constparams: v2.DatasetsApiCreateDatasetRequest={body:{data:{attributes:{name:"Security Audit Dataset",principals:["role:94172442-be03-11e9-a77a-3b7612558ac1"],productFilters:[{filters:["@application.id:ABCD"],product:"metrics",},],},type:"dataset",},},};apiInstance.createDataset(params).then((data: v2.DatasetResponseSingle)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));