Cette page n'est pas encore disponible en français, sa traduction est en cours.
Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.

Rum Metrics

Manage configuration of rum-based metrics for your organization.

GET https://api.ap1.datadoghq.com/api/v2/rum/config/metricshttps://api.datadoghq.eu/api/v2/rum/config/metricshttps://api.ddog-gov.com/api/v2/rum/config/metricshttps://api.datadoghq.com/api/v2/rum/config/metricshttps://api.us3.datadoghq.com/api/v2/rum/config/metricshttps://api.us5.datadoghq.com/api/v2/rum/config/metrics

Présentation

Get the list of configured rum-based metrics with their definitions.

Réponse

OK

All the available rum-based metric objects.

Expand All

Champ

Type

Description

data

[object]

A list of rum-based metric objects.

attributes

object

The object describing a Datadog rum-based metric.

compute

object

The compute rule to compute the rum-based metric.

aggregation_type

enum

The type of aggregation to use. Allowed enum values: count,distribution

include_percentiles

boolean

Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the aggregation_type is distribution.

path

string

The path to the value the rum-based metric will aggregate on (only used if the aggregation type is a "distribution").

event_type

enum

The type of RUM events to filter on. Allowed enum values: session,view,action,error,resource,long_task,vital

filter

object

The rum-based metric filter. RUM events matching this filter will be aggregated in this metric.

query

string

The search query - following the RUM search syntax.

group_by

[object]

The rules for the group by.

path

string

The path to the value the rum-based metric will be aggregated over.

tag_name

string

Eventual name of the tag that gets created. By default, the path attribute is used as the tag name.

uniqueness

object

The rule to count updatable events. Is only set if "event_type" is "sessions" or "views".

when

enum

When to count updatable events. "match" when the event is first seen, or "end" when the event is complete. Allowed enum values: match,end

id

string

The name of the rum-based metric.

type

enum

The type of the resource. The value should always be rum_metrics. Allowed enum values: rum_metrics

default: rum_metrics

{
  "data": [
    {
      "attributes": {
        "compute": {
          "aggregation_type": "distribution",
          "include_percentiles": true,
          "path": "@duration"
        },
        "event_type": "session",
        "filter": {
          "query": "service:web* AND @http.status_code:[200 TO 299]"
        },
        "group_by": [
          {
            "path": "@http.status_code",
            "tag_name": "status_code"
          }
        ],
        "uniqueness": {
          "when": "match"
        }
      },
      "id": "rum.sessions.webui.count",
      "type": "rum_metrics"
    }
  ]
}

Not Authorized

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

                  # Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/rum/config/metrics" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

POST https://api.ap1.datadoghq.com/api/v2/rum/config/metricshttps://api.datadoghq.eu/api/v2/rum/config/metricshttps://api.ddog-gov.com/api/v2/rum/config/metricshttps://api.datadoghq.com/api/v2/rum/config/metricshttps://api.us3.datadoghq.com/api/v2/rum/config/metricshttps://api.us5.datadoghq.com/api/v2/rum/config/metrics

Présentation

Create a metric based on your organization’s RUM data. Returns the rum-based metric object from the request body when the request is successful.

Requête

Body Data (required)

The definition of the new rum-based metric.

Expand All

Champ

Type

Description

data [required]

object

The new rum-based metric properties.

attributes [required]

object

The object describing the Datadog rum-based metric to create.

compute [required]

object

The compute rule to compute the rum-based metric.

aggregation_type [required]

enum

The type of aggregation to use. Allowed enum values: count,distribution

include_percentiles

boolean

Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the aggregation_type is distribution.

path

string

The path to the value the rum-based metric will aggregate on (only used if the aggregation type is a "distribution").

event_type [required]

enum

The type of RUM events to filter on. Allowed enum values: session,view,action,error,resource,long_task,vital

filter

object

The rum-based metric filter. Events matching this filter will be aggregated in this metric.

query [required]

string

The search query - following the RUM search syntax. Must include an @type facet query.

default: *

group_by

[object]

The rules for the group by.

path [required]

string

The path to the value the rum-based metric will be aggregated over.

tag_name

string

Eventual name of the tag that gets created. By default, the path attribute is used as the tag name.

uniqueness

object

The rule to count updatable events. Is only set if "event_type" is "sessions" or "views".

when [required]

enum

When to count updatable events. "match" when the event is first seen, or "end" when the event is complete. Allowed enum values: match,end

id [required]

string

The name of the rum-based metric.

type [required]

enum

The type of the resource. The value should always be rum_metrics. Allowed enum values: rum_metrics

default: rum_metrics

{
  "data": {
    "attributes": {
      "compute": {
        "aggregation_type": "distribution",
        "include_percentiles": true,
        "path": "@duration"
      },
      "event_type": "session",
      "filter": {
        "query": "@service:web-ui"
      },
      "group_by": [
        {
          "path": "@browser.name",
          "tag_name": "browser_name"
        }
      ],
      "uniqueness": {
        "when": "match"
      }
    },
    "id": "rum.sessions.webui.count",
    "type": "rum_metrics"
  }
}

Réponse

Created

The rum-based metric object.

Expand All

Champ

Type

Description

data

object

The rum-based metric properties.

attributes

object

The object describing a Datadog rum-based metric.

compute

object

The compute rule to compute the rum-based metric.

aggregation_type

enum

The type of aggregation to use. Allowed enum values: count,distribution

include_percentiles

boolean

Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the aggregation_type is distribution.

path

string

The path to the value the rum-based metric will aggregate on (only used if the aggregation type is a "distribution").

event_type

enum

The type of RUM events to filter on. Allowed enum values: session,view,action,error,resource,long_task,vital

filter

object

The rum-based metric filter. RUM events matching this filter will be aggregated in this metric.

query

string

The search query - following the RUM search syntax.

group_by

[object]

The rules for the group by.

path

string

The path to the value the rum-based metric will be aggregated over.

tag_name

string

Eventual name of the tag that gets created. By default, the path attribute is used as the tag name.

uniqueness

object

The rule to count updatable events. Is only set if "event_type" is "sessions" or "views".

when

enum

When to count updatable events. "match" when the event is first seen, or "end" when the event is complete. Allowed enum values: match,end

id

string

The name of the rum-based metric.

type

enum

The type of the resource. The value should always be rum_metrics. Allowed enum values: rum_metrics

default: rum_metrics

{
  "data": {
    "attributes": {
      "compute": {
        "aggregation_type": "distribution",
        "include_percentiles": true,
        "path": "@duration"
      },
      "event_type": "session",
      "filter": {
        "query": "service:web* AND @http.status_code:[200 TO 299]"
      },
      "group_by": [
        {
          "path": "@http.status_code",
          "tag_name": "status_code"
        }
      ],
      "uniqueness": {
        "when": "match"
      }
    },
    "id": "rum.sessions.webui.count",
    "type": "rum_metrics"
  }
}

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not Authorized

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Conflict

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/rum/config/metrics" \ -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": { "compute": { "aggregation_type": "distribution", "include_percentiles": true, "path": "@duration" }, "event_type": "session", "filter": { "query": "@service:web-ui" }, "group_by": [ { "path": "@browser.name", "tag_name": "browser_name" } ], "uniqueness": { "when": "match" } }, "id": "rum.sessions.webui.count", "type": "rum_metrics" } } EOF

GET https://api.ap1.datadoghq.com/api/v2/rum/config/metrics/{metric_id}https://api.datadoghq.eu/api/v2/rum/config/metrics/{metric_id}https://api.ddog-gov.com/api/v2/rum/config/metrics/{metric_id}https://api.datadoghq.com/api/v2/rum/config/metrics/{metric_id}https://api.us3.datadoghq.com/api/v2/rum/config/metrics/{metric_id}https://api.us5.datadoghq.com/api/v2/rum/config/metrics/{metric_id}

Présentation

Get a specific rum-based metric from your organization.

Arguments

Paramètres du chemin

Nom

Type

Description

metric_id [required]

string

The name of the rum-based metric.

Réponse

OK

The rum-based metric object.

Expand All

Champ

Type

Description

data

object

The rum-based metric properties.

attributes

object

The object describing a Datadog rum-based metric.

compute

object

The compute rule to compute the rum-based metric.

aggregation_type

enum

The type of aggregation to use. Allowed enum values: count,distribution

include_percentiles

boolean

Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the aggregation_type is distribution.

path

string

The path to the value the rum-based metric will aggregate on (only used if the aggregation type is a "distribution").

event_type

enum

The type of RUM events to filter on. Allowed enum values: session,view,action,error,resource,long_task,vital

filter

object

The rum-based metric filter. RUM events matching this filter will be aggregated in this metric.

query

string

The search query - following the RUM search syntax.

group_by

[object]

The rules for the group by.

path

string

The path to the value the rum-based metric will be aggregated over.

tag_name

string

Eventual name of the tag that gets created. By default, the path attribute is used as the tag name.

uniqueness

object

The rule to count updatable events. Is only set if "event_type" is "sessions" or "views".

when

enum

When to count updatable events. "match" when the event is first seen, or "end" when the event is complete. Allowed enum values: match,end

id

string

The name of the rum-based metric.

type

enum

The type of the resource. The value should always be rum_metrics. Allowed enum values: rum_metrics

default: rum_metrics

{
  "data": {
    "attributes": {
      "compute": {
        "aggregation_type": "distribution",
        "include_percentiles": true,
        "path": "@duration"
      },
      "event_type": "session",
      "filter": {
        "query": "service:web* AND @http.status_code:[200 TO 299]"
      },
      "group_by": [
        {
          "path": "@http.status_code",
          "tag_name": "status_code"
        }
      ],
      "uniqueness": {
        "when": "match"
      }
    },
    "id": "rum.sessions.webui.count",
    "type": "rum_metrics"
  }
}

Not Authorized

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

                  # Path parameters
export metric_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/rum/config/metrics/${metric_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

PATCH https://api.ap1.datadoghq.com/api/v2/rum/config/metrics/{metric_id}https://api.datadoghq.eu/api/v2/rum/config/metrics/{metric_id}https://api.ddog-gov.com/api/v2/rum/config/metrics/{metric_id}https://api.datadoghq.com/api/v2/rum/config/metrics/{metric_id}https://api.us3.datadoghq.com/api/v2/rum/config/metrics/{metric_id}https://api.us5.datadoghq.com/api/v2/rum/config/metrics/{metric_id}

Présentation

Update a specific rum-based metric from your organization. Returns the rum-based metric object from the request body when the request is successful.

Arguments

Paramètres du chemin

Nom

Type

Description

metric_id [required]

string

The name of the rum-based metric.

Requête

Body Data (required)

New definition of the rum-based metric.

Expand All

Champ

Type

Description

data [required]

object

The new rum-based metric properties.

attributes [required]

object

The rum-based metric properties that will be updated.

compute

object

The compute rule to compute the rum-based metric.

include_percentiles

boolean

Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the aggregation_type is distribution.

filter

object

The rum-based metric filter. Events matching this filter will be aggregated in this metric.

query [required]

string

The search query - following the RUM search syntax. Must include an @type facet query.

default: *

group_by

[object]

The rules for the group by.

path [required]

string

The path to the value the rum-based metric will be aggregated over.

tag_name

string

Eventual name of the tag that gets created. By default, the path attribute is used as the tag name.

id

string

The name of the rum-based metric.

type [required]

enum

The type of the resource. The value should always be rum_metrics. Allowed enum values: rum_metrics

default: rum_metrics

{
  "data": {
    "id": "rum.sessions.webui.count",
    "type": "rum_metrics",
    "attributes": {
      "compute": {
        "include_percentiles": false
      },
      "filter": {
        "query": "@service:rum-config"
      },
      "group_by": [
        {
          "path": "@browser.version",
          "tag_name": "browser_version"
        }
      ]
    }
  }
}

Réponse

OK

The rum-based metric object.

Expand All

Champ

Type

Description

data

object

The rum-based metric properties.

attributes

object

The object describing a Datadog rum-based metric.

compute

object

The compute rule to compute the rum-based metric.

aggregation_type

enum

The type of aggregation to use. Allowed enum values: count,distribution

include_percentiles

boolean

Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the aggregation_type is distribution.

path

string

The path to the value the rum-based metric will aggregate on (only used if the aggregation type is a "distribution").

event_type

enum

The type of RUM events to filter on. Allowed enum values: session,view,action,error,resource,long_task,vital

filter

object

The rum-based metric filter. RUM events matching this filter will be aggregated in this metric.

query

string

The search query - following the RUM search syntax.

group_by

[object]

The rules for the group by.

path

string

The path to the value the rum-based metric will be aggregated over.

tag_name

string

Eventual name of the tag that gets created. By default, the path attribute is used as the tag name.

uniqueness

object

The rule to count updatable events. Is only set if "event_type" is "sessions" or "views".

when

enum

When to count updatable events. "match" when the event is first seen, or "end" when the event is complete. Allowed enum values: match,end

id

string

The name of the rum-based metric.

type

enum

The type of the resource. The value should always be rum_metrics. Allowed enum values: rum_metrics

default: rum_metrics

{
  "data": {
    "attributes": {
      "compute": {
        "aggregation_type": "distribution",
        "include_percentiles": true,
        "path": "@duration"
      },
      "event_type": "session",
      "filter": {
        "query": "service:web* AND @http.status_code:[200 TO 299]"
      },
      "group_by": [
        {
          "path": "@http.status_code",
          "tag_name": "status_code"
        }
      ],
      "uniqueness": {
        "when": "match"
      }
    },
    "id": "rum.sessions.webui.count",
    "type": "rum_metrics"
  }
}

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not Authorized

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Conflict

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

                          # Path parameters
export metric_id="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/rum/config/metrics/${metric_id}" \ -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": { "id": "rum.sessions.webui.count", "type": "rum_metrics", "attributes": { "compute": { "include_percentiles": false }, "filter": { "query": "@service:rum-config" }, "group_by": [ { "path": "@browser.version", "tag_name": "browser_version" } ] } } } EOF

DELETE https://api.ap1.datadoghq.com/api/v2/rum/config/metrics/{metric_id}https://api.datadoghq.eu/api/v2/rum/config/metrics/{metric_id}https://api.ddog-gov.com/api/v2/rum/config/metrics/{metric_id}https://api.datadoghq.com/api/v2/rum/config/metrics/{metric_id}https://api.us3.datadoghq.com/api/v2/rum/config/metrics/{metric_id}https://api.us5.datadoghq.com/api/v2/rum/config/metrics/{metric_id}

Présentation

Delete a specific rum-based metric from your organization.

Arguments

Paramètres du chemin

Nom

Type

Description

metric_id [required]

string

The name of the rum-based metric.

Réponse

No Content

Not Authorized

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

                  # Path parameters
export metric_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/rum/config/metrics/${metric_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"