Query aggregated signals and problems

Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.

POST https://api.ap1.datadoghq.com/api/v2/rum/query/insight/aggregated_signals_problemshttps://api.ap2.datadoghq.com/api/v2/rum/query/insight/aggregated_signals_problemshttps://api.datadoghq.eu/api/v2/rum/query/insight/aggregated_signals_problemshttps://api.ddog-gov.com/api/v2/rum/query/insight/aggregated_signals_problemshttps://api.us2.ddog-gov.com/api/v2/rum/query/insight/aggregated_signals_problemshttps://api.uk1.datadoghq.com/api/v2/rum/query/insight/aggregated_signals_problemshttps://api.datadoghq.com/api/v2/rum/query/insight/aggregated_signals_problemshttps://api.us3.datadoghq.com/api/v2/rum/query/insight/aggregated_signals_problemshttps://api.us5.datadoghq.com/api/v2/rum/query/insight/aggregated_signals_problems

Información general

Get aggregated performance signals and problem detections for a RUM view, sampled across multiple view instances. This endpoint requires the rum_apps_read permission.

Solicitud

Body Data (required)

Expand All

Campo

Tipo

Descripción

data [required]

object

Data envelope for an aggregated signals and problems request.

attributes [required]

object

Attributes for an aggregated signals and problems query.

application_id [required]

string

The RUM application ID to analyze.

criteria

object

Performance criteria to filter view instances by a metric threshold.

max

double

Maximum threshold in seconds (inclusive).

metric [required]

enum

Performance metric used to filter view instances by threshold. Allowed enum values: loading_time,largest_contentful_paint,first_contentful_paint,interaction_to_next_paint

min

double

Minimum threshold in seconds (inclusive).

detection_types

[string]

List of detection types to include in the response. When omitted, all types are returned.

filter

string

RUM query string to filter events (for example, @session.type:user @geo.country:US).

from [required]

int64

Start of the time range as a Unix timestamp in seconds.

sample_size [required]

int32

Number of view instances to sample, between 1 and 50.

to [required]

int64

End of the time range as a Unix timestamp in seconds.

view_name [required]

string

The RUM view name to analyze (for example, /account/login).

type [required]

enum

The JSON:API type for aggregated signals and problems requests. Allowed enum values: aggregated_signals_problems

{
  "data": {
    "attributes": {
      "application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
      "criteria": {
        "max": 5,
        "metric": "largest_contentful_paint",
        "min": 2.5
      },
      "detection_types": [
        "high_script_evaluations",
        "uncompressed_resources"
      ],
      "filter": "@session.type:user",
      "from": 1762437564,
      "sample_size": 30,
      "to": 1762523964,
      "view_name": "/account/login(/:type)"
    },
    "type": "aggregated_signals_problems"
  }
}

Respuesta

Successful response

Response body for the aggregated signals and problems endpoint.

Expand All

Campo

Tipo

Descripción

data [required]

object

Data envelope for an aggregated signals and problems response.

attributes [required]

object

Attributes of an aggregated signals and problems response.

application_id [required]

string

The RUM application ID that was analyzed.

criteria

object

Performance criteria to filter view instances by a metric threshold.

max

double

Maximum threshold in seconds (inclusive).

metric [required]

enum

Performance metric used to filter view instances by threshold. Allowed enum values: loading_time,largest_contentful_paint,first_contentful_paint,interaction_to_next_paint

min

double

Minimum threshold in seconds (inclusive).

from [required]

int64

Start of the analyzed time range as a Unix timestamp in seconds.

problem_detections [required]

object

Grouped detection results by detection type.

high_frozen_frame_rates

[object]

Detected high frozen frame rate issues.

avg_frozen_frame_rate [required]

double

Average frozen frame rate as a fraction of total frames.

avg_segment_duration [required]

int64

Average segment duration in nanoseconds.

avg_total_frozen_duration [required]

int64

Average total frozen duration in nanoseconds.

fingerprint [required]

string

Unique fingerprint identifying this detection group.

impact_score [required]

double

Impact score for this detection.

view_occurrences [required]

int32

Number of sampled views where this detection occurred.

high_script_evaluations

[object]

Detected high script evaluation issues.

avg_duration [required]

int64

Average script evaluation duration in nanoseconds.

avg_forced_style_layout [required]

int64

Average forced style/layout duration in nanoseconds.

fingerprint [required]

string

Unique fingerprint identifying this detection group.

impact_score [required]

double

Impact score combining view frequency and duration severity.

instance_count [required]

int32

Total number of detection instances across sampled views.

invoker_type [required]

string

Type of invoker that triggered the script evaluation.

source_category [required]

string

Category of the script source.

source_function_name [required]

string

Name of the function that triggered the high script evaluation.

source_url [required]

string

URL of the script that triggered the high script evaluation.

view_occurrences [required]

int32

Number of sampled views where this detection occurred.

low_cache_hit_rates

[object]

Detected low cache hit rate issues.

avg_cache_hit_rate [required]

double

Average cache hit rate across affected views.

avg_resource_download_size_bytes [required]

int64

Average total download size of uncached resources in bytes.

fingerprint [required]

string

Unique fingerprint identifying this detection group.

impact_score [required]

double

Impact score for this detection.

view_occurrences [required]

int32

Number of sampled views where this detection occurred.

mobile_scroll_frictions

[object]

Detected mobile scroll friction issues.

avg_scroll_frozen_frame_count [required]

int32

Average number of frozen frames during scroll interactions.

fingerprint [required]

string

Unique fingerprint identifying this detection group.

impact_score [required]

double

Impact score for this detection.

view_occurrences [required]

int32

Number of sampled views where this detection occurred.

slow_fcp_high_bytes

[object]

Detected slow first contentful paint with high byte count issues.

avg_bytes_before_fcp_bytes [required]

int64

Average total bytes loaded before first contentful paint.

avg_first_contentful_paint_ms [required]

int64

Average first contentful paint time in milliseconds.

avg_resource_count_before_fcp [required]

int64

Average number of resources loaded before first contentful paint.

fingerprint [required]

string

Unique fingerprint identifying this detection group.

impact_score [required]

double

Impact score for this detection.

platform [required]

string

Platform identifier for the affected views.

view_occurrences [required]

int32

Number of sampled views where this detection occurred.

slow_interaction_long_tasks

[object]

Detected slow interaction with long task issues.

action_type [required]

string

Type of user interaction that triggered the slow response.

avg_blocking_duration [required]

int64

Average long task blocking duration in nanoseconds.

avg_duration [required]

int64

Average total interaction duration in nanoseconds.

fingerprint [required]

string

Unique fingerprint identifying this detection group.

impact_score [required]

double

Impact score combining view frequency and blocking severity.

instance_count [required]

int32

Total number of detection instances across sampled views.

selector [required]

string

CSS selector of the element that was interacted with.

selector_normalized [required]

string

Normalized CSS selector with dynamic parts replaced.

view_occurrences [required]

int32

Number of sampled views where this detection occurred.

uncompressed_resources

[object]

Detected uncompressed resource issues.

avg_body_size [required]

int64

Average uncompressed body size in bytes.

avg_duration [required]

int64

Average resource loading duration in nanoseconds.

fingerprint [required]

string

Unique fingerprint identifying this detection group.

impact_score [required]

double

Impact score combining view frequency and resource size.

instance_count [required]

int32

Total number of detection instances across sampled views.

provider_type [required]

string

CDN or hosting provider type for the resource.

render_blocking [required]

string

Whether the resource is render-blocking.

resource_type [required]

string

Type of the resource (JS, CSS, image, fetch, and so on).

url_path_group [required]

string

Normalized URL path pattern for the uncompressed resource.

view_occurrences [required]

int32

Number of sampled views where this detection occurred.

sample_metadata [required]

object

Metadata about the sampling quality for a signals and problems query.

failed [required]

int32

Number of view instances that failed to process.

requested [required]

int32

Number of view instances requested for sampling.

sampled_view_ids [required]

[string]

List of RUM view IDs that were sampled.

succeeded [required]

int32

Number of view instances successfully processed.

success_rate [required]

double

Ratio of successfully processed views to requested views.

to [required]

int64

End of the analyzed time range as a Unix timestamp in seconds.

view_name [required]

string

The RUM view name that was analyzed.

id [required]

string

Hash-based unique identifier for this aggregation.

type [required]

enum

The JSON:API type for aggregated signals and problems requests. Allowed enum values: aggregated_signals_problems

{
  "data": {
    "attributes": {
      "application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
      "criteria": {
        "max": 5,
        "metric": "largest_contentful_paint",
        "min": 2.5
      },
      "from": 1710000000,
      "problem_detections": {
        "high_frozen_frame_rates": [
          {
            "avg_frozen_frame_rate": 0.15,
            "avg_segment_duration": 3000000000,
            "avg_total_frozen_duration": 500000000,
            "fingerprint": "v1$mno345",
            "impact_score": 14,
            "view_occurrences": 5
          }
        ],
        "high_script_evaluations": [
          {
            "avg_duration": 300000000,
            "avg_forced_style_layout": 0,
            "fingerprint": "v1$7766a8c2180aa153f5526ba8868999f8",
            "impact_score": 30,
            "instance_count": 3,
            "invoker_type": "user-callback",
            "source_category": "third-party",
            "source_function_name": "handleClick",
            "source_url": "https://cdn.example.com/app.js",
            "view_occurrences": 3
          }
        ],
        "low_cache_hit_rates": [
          {
            "avg_cache_hit_rate": 0.15,
            "avg_resource_download_size_bytes": 1048576,
            "fingerprint": "v1$abc123",
            "impact_score": 20,
            "view_occurrences": 5
          }
        ],
        "mobile_scroll_frictions": [
          {
            "avg_scroll_frozen_frame_count": 3,
            "fingerprint": "v1$ghi789",
            "impact_score": 12,
            "view_occurrences": 6
          }
        ],
        "slow_fcp_high_bytes": [
          {
            "avg_bytes_before_fcp_bytes": 2097152,
            "avg_first_contentful_paint_ms": 3500,
            "avg_resource_count_before_fcp": 25,
            "fingerprint": "v1$def456",
            "impact_score": 18,
            "platform": "browser",
            "view_occurrences": 4
          }
        ],
        "slow_interaction_long_tasks": [
          {
            "action_type": "click",
            "avg_blocking_duration": 250000000,
            "avg_duration": 320000000,
            "fingerprint": "v1$jkl012",
            "impact_score": 22,
            "instance_count": 9,
            "selector": "#submit-button",
            "selector_normalized": "button[data-action]",
            "view_occurrences": 7
          }
        ],
        "uncompressed_resources": [
          {
            "avg_body_size": 524288,
            "avg_duration": 0,
            "fingerprint": "v1$65e268e25cab3a1f6230405ccf011a68",
            "impact_score": 16.67,
            "instance_count": 1,
            "provider_type": "cloudfront",
            "render_blocking": "blocking",
            "resource_type": "image",
            "url_path_group": "/cdn/hero.jpg",
            "view_occurrences": 1
          }
        ]
      },
      "sample_metadata": {
        "failed": 2,
        "requested": 30,
        "sampled_view_ids": [
          "6fbf69b6-9455-436a-b894-a6bf64126d40"
        ],
        "succeeded": 28,
        "success_rate": 0.93
      },
      "to": 1710003600,
      "view_name": "/checkout"
    },
    "id": "2f0b3455",
    "type": "aggregated_signals_problems"
  }
}

Bad Request

API error response.

Expand All

Campo

Tipo

Descripción

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short 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.

Expand All

Campo

Tipo

Descripción

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short 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.

Expand All

Campo

Tipo

Descripción

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Ejemplo de código

                  ## default
# 

# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.uk1.datadoghq.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/rum/query/insight/aggregated_signals_problems" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "application_id": "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b", "from": 1762437564, "sample_size": 30, "to": 1762523964, "view_name": "/account/login(/:type)" }, "type": "aggregated_signals_problems" } } EOF
"""
Query aggregated signals and problems returns "Successful response" response
"""

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_signals_problems_request import AggregatedSignalsProblemsRequest
from datadog_api_client.v2.model.aggregated_signals_problems_request_attributes import (
    AggregatedSignalsProblemsRequestAttributes,
)
from datadog_api_client.v2.model.aggregated_signals_problems_request_data import AggregatedSignalsProblemsRequestData
from datadog_api_client.v2.model.aggregated_signals_problems_request_type import AggregatedSignalsProblemsRequestType
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,
)

body = AggregatedSignalsProblemsRequest(
    data=AggregatedSignalsProblemsRequestData(
        attributes=AggregatedSignalsProblemsRequestAttributes(
            application_id="ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
            criteria=AggregatedWaterfallPerformanceCriteria(
                max=5.0,
                metric=AggregatedWaterfallPerformanceCriteriaMetric.LARGEST_CONTENTFUL_PAINT,
                min=2.5,
            ),
            detection_types=[
                "high_script_evaluations",
                "uncompressed_resources",
            ],
            filter="@session.type:user",
            _from=1762437564,
            sample_size=30,
            to=1762523964,
            view_name="/account/login(/:type)",
        ),
        type=AggregatedSignalsProblemsRequestType.AGGREGATED_SIGNALS_PROBLEMS,
    ),
)

configuration = Configuration()
configuration.unstable_operations["query_aggregated_signals_problems"] = True
with ApiClient(configuration) as api_client:
    api_instance = RUMInsightsApi(api_client)
    response = api_instance.query_aggregated_signals_problems(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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" python3 "example.py"
# Query aggregated signals and problems returns "Successful response" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.unstable_operations["v2.query_aggregated_signals_problems".to_sym] = true
end
api_instance = DatadogAPIClient::V2::RUMInsightsAPI.new

body = DatadogAPIClient::V2::AggregatedSignalsProblemsRequest.new({
  data: DatadogAPIClient::V2::AggregatedSignalsProblemsRequestData.new({
    attributes: DatadogAPIClient::V2::AggregatedSignalsProblemsRequestAttributes.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,
      }),
      detection_types: [
        "high_script_evaluations",
        "uncompressed_resources",
      ],
      filter: "@session.type:user",
      from: 1762437564,
      sample_size: 30,
      to: 1762523964,
      view_name: "/account/login(/:type)",
    }),
    type: DatadogAPIClient::V2::AggregatedSignalsProblemsRequestType::AGGREGATED_SIGNALS_PROBLEMS,
  }),
})
p api_instance.query_aggregated_signals_problems(body)

Instructions

First install the library and its dependencies and then save the example to example.rb and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"
// Query aggregated signals and problems 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.AggregatedSignalsProblemsRequest{
		Data: datadogV2.AggregatedSignalsProblemsRequestData{
			Attributes: datadogV2.AggregatedSignalsProblemsRequestAttributes{
				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),
				},
				DetectionTypes: []string{
					"high_script_evaluations",
					"uncompressed_resources",
				},
				Filter:     datadog.PtrString("@session.type:user"),
				From:       1762437564,
				SampleSize: 30,
				To:         1762523964,
				ViewName:   "/account/login(/:type)",
			},
			Type: datadogV2.AGGREGATEDSIGNALSPROBLEMSREQUESTTYPE_AGGREGATED_SIGNALS_PROBLEMS,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.QueryAggregatedSignalsProblems", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewRUMInsightsApi(apiClient)
	resp, r, err := api.QueryAggregatedSignalsProblems(ctx, body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `RUMInsightsApi.QueryAggregatedSignalsProblems`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `RUMInsightsApi.QueryAggregatedSignalsProblems`:\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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" go run "main.go"
// Query aggregated signals and problems 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.AggregatedSignalsProblemsRequest;
import com.datadog.api.client.v2.model.AggregatedSignalsProblemsRequestAttributes;
import com.datadog.api.client.v2.model.AggregatedSignalsProblemsRequestData;
import com.datadog.api.client.v2.model.AggregatedSignalsProblemsRequestType;
import com.datadog.api.client.v2.model.AggregatedSignalsProblemsResponse;
import com.datadog.api.client.v2.model.AggregatedWaterfallPerformanceCriteria;
import com.datadog.api.client.v2.model.AggregatedWaterfallPerformanceCriteriaMetric;
import java.util.Arrays;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setUnstableOperationEnabled("v2.queryAggregatedSignalsProblems", true);
    RumInsightsApi apiInstance = new RumInsightsApi(defaultClient);

    AggregatedSignalsProblemsRequest body =
        new AggregatedSignalsProblemsRequest()
            .data(
                new AggregatedSignalsProblemsRequestData()
                    .attributes(
                        new AggregatedSignalsProblemsRequestAttributes()
                            .applicationId("ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b")
                            .criteria(
                                new AggregatedWaterfallPerformanceCriteria()
                                    .max(5.0)
                                    .metric(
                                        AggregatedWaterfallPerformanceCriteriaMetric
                                            .LARGEST_CONTENTFUL_PAINT)
                                    .min(2.5))
                            .detectionTypes(
                                Arrays.asList("high_script_evaluations", "uncompressed_resources"))
                            .filter("@session.type:user")
                            .from(1762437564L)
                            .sampleSize(30)
                            .to(1762523964L)
                            .viewName("/account/login(/:type)"))
                    .type(AggregatedSignalsProblemsRequestType.AGGREGATED_SIGNALS_PROBLEMS));

    try {
      AggregatedSignalsProblemsResponse result = apiInstance.queryAggregatedSignalsProblems(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RumInsightsApi#queryAggregatedSignalsProblems");
      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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"
// Query aggregated signals and problems returns "Successful response" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_rum_insights::RUMInsightsAPI;
use datadog_api_client::datadogV2::model::AggregatedSignalsProblemsRequest;
use datadog_api_client::datadogV2::model::AggregatedSignalsProblemsRequestAttributes;
use datadog_api_client::datadogV2::model::AggregatedSignalsProblemsRequestData;
use datadog_api_client::datadogV2::model::AggregatedSignalsProblemsRequestType;
use datadog_api_client::datadogV2::model::AggregatedWaterfallPerformanceCriteria;
use datadog_api_client::datadogV2::model::AggregatedWaterfallPerformanceCriteriaMetric;

#[tokio::main]
async fn main() {
    let body = AggregatedSignalsProblemsRequest::new(AggregatedSignalsProblemsRequestData::new(
        AggregatedSignalsProblemsRequestAttributes::new(
            "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b".to_string(),
            1762437564,
            30,
            1762523964,
            "/account/login(/:type)".to_string(),
        )
        .criteria(
            AggregatedWaterfallPerformanceCriteria::new(
                AggregatedWaterfallPerformanceCriteriaMetric::LARGEST_CONTENTFUL_PAINT,
            )
            .max(5.0 as f64)
            .min(2.5 as f64),
        )
        .detection_types(vec![
            "high_script_evaluations".to_string(),
            "uncompressed_resources".to_string(),
        ])
        .filter("@session.type:user".to_string()),
        AggregatedSignalsProblemsRequestType::AGGREGATED_SIGNALS_PROBLEMS,
    ));
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.QueryAggregatedSignalsProblems", true);
    let api = RUMInsightsAPI::with_config(configuration);
    let resp = api.query_aggregated_signals_problems(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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
/**
 * Query aggregated signals and problems returns "Successful response" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration();
configuration.unstableOperations["v2.queryAggregatedSignalsProblems"] = true;
const apiInstance = new v2.RUMInsightsApi(configuration);

const params: v2.RUMInsightsApiQueryAggregatedSignalsProblemsRequest = {
  body: {
    data: {
      attributes: {
        applicationId: "ccbc53b1-74f2-496b-bdd7-9a8fa7b7376b",
        criteria: {
          max: 5.0,
          metric: "largest_contentful_paint",
          min: 2.5,
        },
        detectionTypes: ["high_script_evaluations", "uncompressed_resources"],
        filter: "@session.type:user",
        from: 1762437564,
        sampleSize: 30,
        to: 1762523964,
        viewName: "/account/login(/:type)",
      },
      type: "aggregated_signals_problems",
    },
  },
};

apiInstance
  .queryAggregatedSignalsProblems(params)
  .then((data: v2.AggregatedSignalsProblemsResponse) => {
    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.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" tsc "example.ts"