attribute
Explore span, log, and metric attributes
Commands
Section titled “Commands”sentry attribute list [<target>] [<filter>]
Section titled “sentry attribute list [<target>] [<filter>]”List attribute keys for spans, logs, or metrics
Arguments:
| Argument | Description |
|---|---|
[<target>] |
<org>/ (all projects), <org>/<project>, or <project> (search) |
[<filter>] |
Text in attribute names and/or has:<key> terms, e.g. 'gen_ai has:http.method' |
Options:
| Option | Description |
|---|---|
-d, --dataset <dataset> |
Dataset to list attributes for (spans, logs, metrics) (default: "spans") |
--type <type>... |
Only show attributes of these types: string, number, boolean, array. Repeat the flag for each type or pass a comma-separated list (e.g. --type string,number) |
-t, --period <period> |
Time range: "7d", "2024-01-01..2024-02-01", ">=2024-01-01" (default: "7d") |
-n, --limit <limit> |
Maximum number of attributes to list (default: "25") |
-f, --fresh |
Bypass cache, re-detect projects, and fetch fresh data |
-c, --cursor <cursor> |
Navigate pages: "next", "prev", "first" (or raw cursor string) |
Examples:
# List span attribute keys for a projectsentry attribute list my-org/my-project
# List log attribute keys across the whole organizationsentry attribute list my-org/ --dataset logs
# String attributes whose names contain gen_ai (case-sensitive)sentry attribute list my-org/ gen_ai --type string
# Discover candidates alongside an attributesentry attribute list my-org/ has:gen_ai.request.model
# Discover candidates alongside several keys (one quoted argument)sentry attribute list my-org/ 'has:gen_ai.request.model has:gen_ai.usage.input_tokens'
# Text and has: filters togethersentry attribute list my-org/ 'gen_ai has:http.method'
# Discover candidates using the last 24 hours (includes built-in and virtual keys)sentry attribute list my-org/ --period 24h
# Show more than the default 25sentry attribute list my-org/my-project -n 100
# Show the next page of the previous listing (same flags)sentry attribute list my-org/my-project -n 100 -c next
# Filter spans that have a discovered keysentry span list my-org/my-project -q 'has:gen_ai.request.model'
# Find a custom numeric attribute by namesentry attribute list my-org/my-project cart.total --type number
# Show a discovered typed key as a span columnsentry span list my-org/my-project --fields 'tags[cart.total,number]'
# Group a metric by a discovered attributesentry explore my-org/ --dataset metrics -m llm.token_usage -F gen_ai.request.model
# Select fields as JSONsentry attribute list my-org/ --json --fields key,type,sourceAll commands support --json for machine-readable output and --fields to select specific JSON fields.
Using Attribute Keys
Section titled “Using Attribute Keys”Attributes are the typed key-value data attached to spans, logs, and metric samples. Their keys can be passed to other commands like explore to filter, add columns, or group results.
Custom non-string attributes include their type in the key, e.g. tags[cart.total,number]. Search for the name (cart.total), then use the returned key in queries and fields. Quote these keys in the shell.
The endpoint returns discovery candidates, including built-in and virtual keys even when no matching item was observed. It does not provide an exhaustive inventory or proof that every candidate co-occurs with the has: keys.