Query aggregated waterfall
https://api.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfallhttps://api.us3.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfallhttps://api.us5.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfallhttps://api.datadoghq.eu/api/v2/rum/query/insight/aggregated_waterfallhttps://api.ap1.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfallhttps://api.ap2.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfallhttps://api.uk1.datadoghq.com/api/v2/rum/query/insight/aggregated_waterfallhttps://api.ddog-gov.com/api/v2/rum/query/insight/aggregated_waterfallhttps://api.us2.ddog-gov.com/api/v2/rum/query/insight/aggregated_waterfallOverview
Get aggregated network resource waterfall data for a RUM view, sampled across multiple view instances.
Request
Body Data (required)
data [required]Data envelope for an aggregated waterfall request.
attributes [required]Attributes for an aggregated waterfall query.
application_id [required]The RUM application ID to analyze.
criteriaPerformance criteria to filter view instances by a metric threshold.
maxMaximum threshold in seconds (inclusive).
metric [required]Performance metric used to filter view instances by threshold.
loading_time, largest_contentful_paint, first_contentful_paint, interaction_to_next_paintminMinimum threshold in seconds (inclusive).
filterRUM query string to filter events (for example, @session.type:user @geo.country:US).
from [required]Start of the time range as a Unix timestamp in seconds.
include_global_appearanceWhen true, enriches each resource with cross-view appearance statistics.
sample_size [required]Number of view instances to sample, between 1 and 500.
to [required]End of the time range as a Unix timestamp in seconds.
view_name [required]The RUM view name to analyze (for example, /account/login).
type [required]The JSON:API type for aggregated waterfall requests.
aggregated_waterfall{
"data": {
"attributes": {
"application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
"criteria": {
"max": 5,
"metric": "largest_contentful_paint",
"min": 2.5
},
"filter": "@session.type:user",
"from": 1762437564,
"include_global_appearance": false,
"sample_size": 20,
"to": 1762523964,
"view_name": "/account/login(/:type)"
},
"type": "aggregated_waterfall"
}
}Response
Successful response
Response body for the aggregated waterfall endpoint.
data [required]Data envelope for an aggregated waterfall response.
attributes [required]Attributes of an aggregated waterfall response.
application_id [required]The RUM application ID that was analyzed.
criteria [required]Performance criteria used to filter view instances by a metric threshold, or null if no criteria were applied.
maxMaximum threshold in seconds (inclusive).
metric [required]Performance metric used to filter view instances by threshold.
loading_time, largest_contentful_paint, first_contentful_paint, interaction_to_next_paintminMinimum threshold in seconds (inclusive).
from [required]Start of the analyzed time range as a Unix timestamp in seconds.
resources [required]Network resources in chronological waterfall order.
avg_duration_ms [required]Average total duration in milliseconds.
avg_start_time_ms [required]Average start time relative to view start in milliseconds.
cache_hit_rate_pct [required]Cache hit rate as a percentage.
cached_count [required]Number of requests served from cache.
downloaded_count [required]Number of requests downloaded from the network.
global_p75_duration_ms75th percentile duration across all view names in the application, present when include_global_appearance is true.
global_view_name_countNumber of distinct view names in the application that load this resource, present when include_global_appearance is true.
global_view_name_pctPercentage of distinct view names in the application that load this resource, present when include_global_appearance is true.
http_method [required]HTTP method for the resource request.
load_frequency_pct [required]Percentage of sampled view instances that loaded this resource.
local_cache_count [required]Number of requests served from the local browser cache without a network round trip.
max_duration_ms [required]Maximum duration in milliseconds.
median_duration_ms [required]Median duration in milliseconds.
min_duration_ms [required]Minimum duration in milliseconds.
non_blocking_count [required]Number of requests reported by the browser as non-render-blocking.
p75_duration_ms [required]75th percentile duration in milliseconds.
p95_duration_ms [required]95th percentile duration in milliseconds.
render_blocking_count [required]Number of requests reported by the browser as render-blocking.
render_blocking_pct [required]Percentage of render-blocking requests among those reporting a render-blocking status.
resource_type [required]Resource type (JS, CSS, image, fetch, XHR, document, and so on).
resource_url_path_group [required]URL path group used to aggregate similar resources.
server_validated_cache_count [required]Number of cached requests revalidated by the server with a 304 response.
timing_breakdown [required]Average timing breakdown per network phase for a resource.
avg_connect_ms [required]Average TCP connect duration in milliseconds.
avg_dns_ms [required]Average DNS resolution duration in milliseconds.
avg_download_ms [required]Average download phase duration in milliseconds.
avg_first_byte_ms [required]Average time to first byte in milliseconds.
avg_redirect_ms [required]Average redirect phase duration in milliseconds.
avg_ssl_ms [required]Average SSL handshake duration in milliseconds.
total_requests [required]Total number of requests for this resource across all sampled views.
views_with_resource [required]Number of sampled view instances that loaded this resource.
sampled_view_ids [required]List of RUM view IDs sampled for this aggregation, capped at 50.
to [required]End of the analyzed time range as a Unix timestamp in seconds.
total_cache_hit_rate_pct [required]Overall cache hit rate across all sampled views.
view_count [required]Number of view instances included in the analysis.
view_name [required]The RUM view name that was analyzed.
id [required]Hash-based unique identifier for this aggregation.
type [required]The JSON:API type for aggregated waterfall requests.
aggregated_waterfall{
"data": {
"attributes": {
"application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
"criteria": {
"max": 5,
"metric": "largest_contentful_paint",
"min": 2.5
},
"from": 1762437564,
"resources": [
{
"avg_duration_ms": 839.1,
"avg_start_time_ms": 1486.3,
"cache_hit_rate_pct": 100,
"cached_count": 27,
"downloaded_count": 0,
"global_p75_duration_ms": 500,
"global_view_name_count": 3,
"global_view_name_pct": 30,
"http_method": "GET",
"load_frequency_pct": 54,
"local_cache_count": 20,
"max_duration_ms": 945.6,
"median_duration_ms": 836.2,
"min_duration_ms": 812.7,
"non_blocking_count": 23,
"p75_duration_ms": 844.1,
"p95_duration_ms": 861.8,
"render_blocking_count": 4,
"render_blocking_pct": 14.8,
"resource_type": "fetch",
"resource_url_path_group": "/api/gallery",
"server_validated_cache_count": 7,
"timing_breakdown": {
"avg_connect_ms": 20,
"avg_dns_ms": 10,
"avg_download_ms": 135,
"avg_first_byte_ms": 30,
"avg_redirect_ms": 0,
"avg_ssl_ms": 5
},
"total_requests": 27,
"views_with_resource": 27
}
],
"sampled_view_ids": [
"6fbf69b6-9455-436a-b894-a6bf64126d40",
"dfe318df-4ae5-44b8-9fe2-4107885e1a46"
],
"to": 1762523964,
"total_cache_hit_rate_pct": 0.677,
"view_count": 50,
"view_name": "/account/login(/:type)"
},
"id": "2f0b3455",
"type": "aggregated_waterfall"
}
}Bad Request
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Unauthorized
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort human-readable summary of the error.
{
"errors": [
{
"detail": "Missing required attribute in body",
"meta": {},
"source": {
"header": "Authorization",
"parameter": "limit",
"pointer": "/data/attributes/title"
},
"status": "400",
"title": "Bad Request"
}
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Code Example
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/query/insight/aggregated_waterfall" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
"criteria": {
"metric": "largest_contentful_paint",
"min": 0.3
},
"from": 1762437564,
"sample_size": 20,
"to": 1762523964,
"view_name": "/account/login(/:type)"
},
"type": "aggregated_waterfall"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/query/insight/aggregated_waterfall" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
"criteria": {
"metric": "largest_contentful_paint",
"min": 0.3
},
"from": 1762437564,
"sample_size": 20,
"to": 1762523964,
"view_name": "/account/login(/:type)"
},
"type": "aggregated_waterfall"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/query/insight/aggregated_waterfall" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
"criteria": {
"metric": "largest_contentful_paint",
"min": 0.3
},
"from": 1762437564,
"sample_size": 20,
"to": 1762523964,
"view_name": "/account/login(/:type)"
},
"type": "aggregated_waterfall"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/query/insight/aggregated_waterfall" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
"criteria": {
"metric": "largest_contentful_paint",
"min": 0.3
},
"from": 1762437564,
"sample_size": 20,
"to": 1762523964,
"view_name": "/account/login(/:type)"
},
"type": "aggregated_waterfall"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/query/insight/aggregated_waterfall" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
"criteria": {
"metric": "largest_contentful_paint",
"min": 0.3
},
"from": 1762437564,
"sample_size": 20,
"to": 1762523964,
"view_name": "/account/login(/:type)"
},
"type": "aggregated_waterfall"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/query/insight/aggregated_waterfall" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
"criteria": {
"metric": "largest_contentful_paint",
"min": 0.3
},
"from": 1762437564,
"sample_size": 20,
"to": 1762523964,
"view_name": "/account/login(/:type)"
},
"type": "aggregated_waterfall"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/query/insight/aggregated_waterfall" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
"criteria": {
"metric": "largest_contentful_paint",
"min": 0.3
},
"from": 1762437564,
"sample_size": 20,
"to": 1762523964,
"view_name": "/account/login(/:type)"
},
"type": "aggregated_waterfall"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/query/insight/aggregated_waterfall" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
"criteria": {
"metric": "largest_contentful_paint",
"min": 0.3
},
"from": 1762437564,
"sample_size": 20,
"to": 1762523964,
"view_name": "/account/login(/:type)"
},
"type": "aggregated_waterfall"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/rum/query/insight/aggregated_waterfall" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"data": {
"attributes": {
"application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
"criteria": {
"metric": "largest_contentful_paint",
"min": 0.3
},
"from": 1762437564,
"sample_size": 20,
"to": 1762523964,
"view_name": "/account/login(/:type)"
},
"type": "aggregated_waterfall"
}
}
EOF// Query aggregated waterfall returns "Successful response" response
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
"github.com/DataDog/datadog-api-client-go/v2/api/datadogV2"
)
func main() {
body := datadogV2.AggregatedWaterfallRequest{
Data: datadogV2.AggregatedWaterfallRequestData{
Attributes: datadogV2.AggregatedWaterfallRequestAttributes{
ApplicationId: "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
Criteria: &datadogV2.AggregatedWaterfallPerformanceCriteria{
Max: datadog.PtrFloat64(5.0),
Metric: datadogV2.AGGREGATEDWATERFALLPERFORMANCECRITERIAMETRIC_LARGEST_CONTENTFUL_PAINT,
Min: datadog.PtrFloat64(2.5),
},
Filter: datadog.PtrString("@session.type:user"),
From: 1762437564,
IncludeGlobalAppearance: datadog.PtrBool(false),
SampleSize: 20,
To: 1762523964,
ViewName: "/account/login(/:type)",
},
Type: datadogV2.AGGREGATEDWATERFALLREQUESTTYPE_AGGREGATED_WATERFALL,
},
}
ctx := datadog.NewDefaultContext(context.Background())
ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
configuration := datadog.NewConfiguration()
configuration.SetUnstableOperationEnabled("v2.QueryAggregatedWaterfall", true)
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewRUMInsightsApi(apiClient)
resp, r, err := api.QueryAggregatedWaterfall(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `RUMInsightsApi.QueryAggregatedWaterfall`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `RUMInsightsApi.QueryAggregatedWaterfall`:\n%s\n", responseContent)
}
Instructions
First install the library and its dependencies and then save the example to main.go and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// Query aggregated waterfall returns "Successful response" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.RumInsightsApi;
import com.datadog.api.client.v2.model.AggregatedWaterfallPerformanceCriteria;
import com.datadog.api.client.v2.model.AggregatedWaterfallPerformanceCriteriaMetric;
import com.datadog.api.client.v2.model.AggregatedWaterfallRequest;
import com.datadog.api.client.v2.model.AggregatedWaterfallRequestAttributes;
import com.datadog.api.client.v2.model.AggregatedWaterfallRequestData;
import com.datadog.api.client.v2.model.AggregatedWaterfallRequestType;
import com.datadog.api.client.v2.model.AggregatedWaterfallResponse;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
defaultClient.setUnstableOperationEnabled("v2.queryAggregatedWaterfall", true);
RumInsightsApi apiInstance = new RumInsightsApi(defaultClient);
AggregatedWaterfallRequest body =
new AggregatedWaterfallRequest()
.data(
new AggregatedWaterfallRequestData()
.attributes(
new AggregatedWaterfallRequestAttributes()
.applicationId("ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b")
.criteria(
new AggregatedWaterfallPerformanceCriteria()
.max(5.0)
.metric(
AggregatedWaterfallPerformanceCriteriaMetric
.LARGEST_CONTENTFUL_PAINT)
.min(2.5))
.filter("@session.type:user")
.from(1762437564L)
.includeGlobalAppearance(false)
.sampleSize(20)
.to(1762523964L)
.viewName("/account/login(/:type)"))
.type(AggregatedWaterfallRequestType.AGGREGATED_WATERFALL));
try {
AggregatedWaterfallResponse result = apiInstance.queryAggregatedWaterfall(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RumInsightsApi#queryAggregatedWaterfall");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Instructions
First install the library and its dependencies and then save the example to Example.java and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
Query aggregated waterfall returns "Successful response" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.rum_insights_api import RUMInsightsApi
from datadog_api_client.v2.model.aggregated_waterfall_performance_criteria import AggregatedWaterfallPerformanceCriteria
from datadog_api_client.v2.model.aggregated_waterfall_performance_criteria_metric import (
AggregatedWaterfallPerformanceCriteriaMetric,
)
from datadog_api_client.v2.model.aggregated_waterfall_request import AggregatedWaterfallRequest
from datadog_api_client.v2.model.aggregated_waterfall_request_attributes import AggregatedWaterfallRequestAttributes
from datadog_api_client.v2.model.aggregated_waterfall_request_data import AggregatedWaterfallRequestData
from datadog_api_client.v2.model.aggregated_waterfall_request_type import AggregatedWaterfallRequestType
body = AggregatedWaterfallRequest(
data=AggregatedWaterfallRequestData(
attributes=AggregatedWaterfallRequestAttributes(
application_id="ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
criteria=AggregatedWaterfallPerformanceCriteria(
max=5.0,
metric=AggregatedWaterfallPerformanceCriteriaMetric.LARGEST_CONTENTFUL_PAINT,
min=2.5,
),
filter="@session.type:user",
_from=1762437564,
include_global_appearance=False,
sample_size=20,
to=1762523964,
view_name="/account/login(/:type)",
),
type=AggregatedWaterfallRequestType.AGGREGATED_WATERFALL,
),
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["query_aggregated_waterfall"] = True
with ApiClient(configuration) as api_client:
api_instance = RUMInsightsApi(api_client)
response = api_instance.query_aggregated_waterfall(body=body)
print(response)
Instructions
First install the library and its dependencies and then save the example to example.py and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# Query aggregated waterfall returns "Successful response" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.query_aggregated_waterfall".to_sym] = true
end
api_instance = DatadogAPIClient::V2::RUMInsightsAPI.new
body = DatadogAPIClient::V2::AggregatedWaterfallRequest.new({
data: DatadogAPIClient::V2::AggregatedWaterfallRequestData.new({
attributes: DatadogAPIClient::V2::AggregatedWaterfallRequestAttributes.new({
application_id: "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
criteria: DatadogAPIClient::V2::AggregatedWaterfallPerformanceCriteria.new({
max: 5.0,
metric: DatadogAPIClient::V2::AggregatedWaterfallPerformanceCriteriaMetric::LARGEST_CONTENTFUL_PAINT,
min: 2.5,
}),
filter: "@session.type:user",
from: 1762437564,
include_global_appearance: false,
sample_size: 20,
to: 1762523964,
view_name: "/account/login(/:type)",
}),
type: DatadogAPIClient::V2::AggregatedWaterfallRequestType::AGGREGATED_WATERFALL,
}),
})
p api_instance.query_aggregated_waterfall(body)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// Query aggregated waterfall returns "Successful response" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_rum_insights::RUMInsightsAPI;
use datadog_api_client::datadogV2::model::AggregatedWaterfallPerformanceCriteria;
use datadog_api_client::datadogV2::model::AggregatedWaterfallPerformanceCriteriaMetric;
use datadog_api_client::datadogV2::model::AggregatedWaterfallRequest;
use datadog_api_client::datadogV2::model::AggregatedWaterfallRequestAttributes;
use datadog_api_client::datadogV2::model::AggregatedWaterfallRequestData;
use datadog_api_client::datadogV2::model::AggregatedWaterfallRequestType;
#[tokio::main]
async fn main() {
let body = AggregatedWaterfallRequest::new(AggregatedWaterfallRequestData::new(
AggregatedWaterfallRequestAttributes::new(
"ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b".to_string(),
1762437564,
20,
1762523964,
"/account/login(/:type)".to_string(),
)
.criteria(
AggregatedWaterfallPerformanceCriteria::new(
AggregatedWaterfallPerformanceCriteriaMetric::LARGEST_CONTENTFUL_PAINT,
)
.max(5.0 as f64)
.min(2.5 as f64),
)
.filter("@session.type:user".to_string())
.include_global_appearance(false),
AggregatedWaterfallRequestType::AGGREGATED_WATERFALL,
));
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.query_aggregated_waterfall", true);
let api = RUMInsightsAPI::with_config(configuration);
let resp = api.query_aggregated_waterfall(body).await;
if let Ok(value) = resp {
println!("{:#?}", value);
} else {
println!("{:#?}", resp.unwrap_err());
}
}
Instructions
First install the library and its dependencies and then save the example to src/main.rs and run following commands:
DD_SITE="datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run/**
* Query aggregated waterfall returns "Successful response" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration({
authMethods: {
AuthZ: {
accessToken: process.env.DD_BEARER_TOKEN as string,
},
},
});
configuration.unstableOperations["v2.queryAggregatedWaterfall"] = true;
const apiInstance = new v2.RUMInsightsApi(configuration);
const params: v2.RUMInsightsApiQueryAggregatedWaterfallRequest = {
body: {
data: {
attributes: {
applicationId: "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
criteria: {
max: 5.0,
metric: "largest_contentful_paint",
min: 2.5,
},
filter: "@session.type:user",
from: 1762437564,
includeGlobalAppearance: false,
sampleSize: 20,
to: 1762523964,
viewName: "/account/login(/:type)",
},
type: "aggregated_waterfall",
},
},
};
apiInstance
.queryAggregatedWaterfall(params)
.then((data: v2.AggregatedWaterfallResponse) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
Instructions
First install the library and its dependencies and then save the example to example.ts and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"