spans_metrics
Creates, updates, deletes, gets or lists a spans_metrics resource.
Overview
| Name | spans_metrics |
| Type | Resource |
| Id | datadog.apm.spans_metrics |
Fields
The following fields are returned by SELECT queries:
- get_spans_metric
- list_spans_metrics
| Name | Datatype | Description |
|---|---|---|
id | string | The name of the span-based metric. (example: my.metric) |
attributes | object | The object describing a Datadog span-based metric. |
type | string | The type of resource. The value should always be spans_metrics. (spans_metrics) (default: spans_metrics, example: spans_metrics) |
| Name | Datatype | Description |
|---|---|---|
id | string | The name of the span-based metric. (example: my.metric) |
attributes | object | The object describing a Datadog span-based metric. |
type | string | The type of resource. The value should always be spans_metrics. (spans_metrics) (default: spans_metrics, example: spans_metrics) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_spans_metric | select | metric_id | Get a specific span-based metric from your organization. | |
list_spans_metrics | select | Get the list of configured span-based metrics with their definitions. | ||
create_spans_metric | insert | data | Create a metric based on your ingested spans in your organization.<br />Returns the span-based metric object from the request body when the request is successful. | |
update_spans_metric | update | metric_id, data | Update a specific span-based metric from your organization.<br />Returns the span-based metric object from the request body when the request is successful. | |
delete_spans_metric | delete | metric_id | Delete a specific span-based metric from your organization. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
metric_id | string | The name of the span-based metric. |
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
SELECT examples
- get_spans_metric
- list_spans_metrics
Get a specific span-based metric from your organization.
SELECT
id,
attributes,
type
FROM datadog.apm.spans_metrics
WHERE metric_id = '{{ metric_id }}' -- required
;
Get the list of configured span-based metrics with their definitions.
SELECT
id,
attributes,
type
FROM datadog.apm.spans_metrics
;
INSERT examples
- create_spans_metric
- Manifest
Create a metric based on your ingested spans in your organization.<br />Returns the span-based metric object from the request body when the request is successful.
INSERT INTO datadog.apm.spans_metrics (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: spans_metrics
props:
- name: data
description: |
The new span-based metric properties.
value:
attributes:
compute:
aggregation_type: "{{ aggregation_type }}"
include_percentiles: {{ include_percentiles }}
path: "{{ path }}"
filter:
query: "{{ query }}"
group_by:
- path: "{{ path }}"
tag_name: "{{ tag_name }}"
id: "{{ id }}"
type: "{{ type }}"
UPDATE examples
- update_spans_metric
Update a specific span-based metric from your organization.<br />Returns the span-based metric object from the request body when the request is successful.
UPDATE datadog.apm.spans_metrics
SET
data = '{{ data }}'
WHERE
metric_id = '{{ metric_id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;
DELETE examples
- delete_spans_metric
Delete a specific span-based metric from your organization.
DELETE FROM datadog.apm.spans_metrics
WHERE metric_id = '{{ metric_id }}' --required
;