List an Organization's Trace Metrics
List trace metrics (name, type, unit, count, last seen) with optional context.
Path Parameters
organization_id_or_slug(string)REQUIREDThe ID or slug of the organization the resource belongs to.
Query Parameters:
project(array(undefined))The IDs or slugs of projects to filter by. Project slugs are unique within each organization. Omit this parameter to include all accessible projects.
-1is also accepted to include all accessible projects. For example, the following are valid parameters:/?project=1234&project=56789/?project=android&project=javascript-react/?project=-1
environment(array(string))The name of environments to filter by.
statsPeriod(string)The period of time for the query, will override the start & end parameters, a number followed by one of:
dfor dayshfor hoursmfor minutessfor secondswfor weeks
For example,
24h, to mean query data starting from 24 hours ago to now.start(string)The start of the period of time for the query, expected in ISO-8601 format. For example,
2001-12-14T12:34:56.7890.end(string)The end of the period of time for the query, expected in ISO-8601 format. For example,
2001-12-14T12:34:56.7890.query(string)Search query to filter metrics, using the same syntax as the metrics dataset.
sort(string)- choices:
- -count
- -lastSeen
- -name
- -type
- -unit
- count
- lastSeen
- name
- type
- unit
Response field to sort by, prefixed with
-for descending. Defaults to metric name ascending. expand(array(string))- choices:
- context
Optional fields to expand. Pass
contextto include each metric's authored context (brief and details), which describes what the metric measures. Requires thedata-browsing-attribute-contextfeature; without it thecontextfield is omitted. contextOnly(boolean)Return only metrics that have authored context, and include that context in the response. Use this to discover the metrics that are described well enough to query confidently. Requires the
data-browsing-attribute-contextfeature; without it this is a no-op.
Scopes
<auth_token> requires one of the following scopes:org:adminorg:readorg:write
curl https://sentry.io/api/0/organizations/{organization_id_or_slug}/trace-items/metrics/ \ -H 'Authorization: Bearer <auth_token>'
Copied[ { "name": "checkout.latency", "type": "distribution", "unit": "millisecond", "count": 1432, "lastSeen": 1735689600, "context": { "brief": "End-to-end latency of the checkout flow.", "details": [ "Recorded once per completed checkout, from cart submit to receipt." ] } }, { "name": "cart.items", "type": "gauge", "unit": null, "count": 87, "lastSeen": 1735686000 } ]