For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/ko/api/latest/agent-observability/search-agent-observability-spans.md. A documentation index is available at /llms.txt.
Language
Datadog site

Agent Observability 스팬 검색

경고Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
POSThttps://api.datadoghq.com/api/v2/llm-obs/v1/spans/events/searchhttps://api.us3.datadoghq.com/api/v2/llm-obs/v1/spans/events/searchhttps://api.us5.datadoghq.com/api/v2/llm-obs/v1/spans/events/searchhttps://api.datadoghq.eu/api/v2/llm-obs/v1/spans/events/searchhttps://api.ap1.datadoghq.com/api/v2/llm-obs/v1/spans/events/searchhttps://api.ap2.datadoghq.com/api/v2/llm-obs/v1/spans/events/searchhttps://api.uk1.datadoghq.com/api/v2/llm-obs/v1/spans/events/searchhttps://api.ddog-gov.com/api/v2/llm-obs/v1/spans/events/searchhttps://api.us2.ddog-gov.com/api/v2/llm-obs/v1/spans/events/search

개요

요청 본문의 구조화된 필터를 사용하여 Agent Observability 스팬을 검색합니다.

요청

Body Data (required)

스팬 검색 페이로드입니다.

항목
유형
설명
data [required]
object

Agent Observability 스팬을 검색하기 위한 요청 본문입니다.

응답

OK

Response containing a list of Agent Observability spans.

항목
유형
설명
data [required]
[object]

List of spans matching the query.

links
object

Pagination links accompanying the spans response.

meta [required]
object

Metadata accompanying the spans response.

코드 예시

Agent Observability 스팬 검색
## Search spans for an ML app

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "ml_app": "my-llm-app",
        "span_kind": "llm",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 10
      }
    },
    "type": "spans"
  }
}
EOF

## Search all spans in a session

# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "query": "@session_id:abc123def456",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 50
      }
    },
    "type": "spans"
  }
}
EOF
## Search spans for an ML app

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "ml_app": "my-llm-app",
        "span_kind": "llm",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 10
      }
    },
    "type": "spans"
  }
}
EOF

## Search all spans in a session

# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "query": "@session_id:abc123def456",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 50
      }
    },
    "type": "spans"
  }
}
EOF
## Search spans for an ML app

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "ml_app": "my-llm-app",
        "span_kind": "llm",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 10
      }
    },
    "type": "spans"
  }
}
EOF

## Search all spans in a session

# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "query": "@session_id:abc123def456",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 50
      }
    },
    "type": "spans"
  }
}
EOF
## Search spans for an ML app

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "ml_app": "my-llm-app",
        "span_kind": "llm",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 10
      }
    },
    "type": "spans"
  }
}
EOF

## Search all spans in a session

# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "query": "@session_id:abc123def456",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 50
      }
    },
    "type": "spans"
  }
}
EOF
## Search spans for an ML app

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "ml_app": "my-llm-app",
        "span_kind": "llm",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 10
      }
    },
    "type": "spans"
  }
}
EOF

## Search all spans in a session

# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "query": "@session_id:abc123def456",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 50
      }
    },
    "type": "spans"
  }
}
EOF
## Search spans for an ML app

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "ml_app": "my-llm-app",
        "span_kind": "llm",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 10
      }
    },
    "type": "spans"
  }
}
EOF

## Search all spans in a session

# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "query": "@session_id:abc123def456",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 50
      }
    },
    "type": "spans"
  }
}
EOF
## Search spans for an ML app

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "ml_app": "my-llm-app",
        "span_kind": "llm",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 10
      }
    },
    "type": "spans"
  }
}
EOF

## Search all spans in a session

# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "query": "@session_id:abc123def456",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 50
      }
    },
    "type": "spans"
  }
}
EOF
## Search spans for an ML app

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "ml_app": "my-llm-app",
        "span_kind": "llm",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 10
      }
    },
    "type": "spans"
  }
}
EOF

## Search all spans in a session

# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "query": "@session_id:abc123def456",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 50
      }
    },
    "type": "spans"
  }
}
EOF
## Search spans for an ML app

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "ml_app": "my-llm-app",
        "span_kind": "llm",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 10
      }
    },
    "type": "spans"
  }
}
EOF

## Search all spans in a session

# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v2/llm-obs/v1/spans/events/search" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "filter": {
        "from": "now-900s",
        "query": "@session_id:abc123def456",
        "to": "now"
      },
      "options": {
        "include_attachments": true
      },
      "page": {
        "limit": 50
      }
    },
    "type": "spans"
  }
}
EOF