# projectTraceSpans

```graphql
query ProjectTraceSpans($input: ProjectTraceSpansInput!) {
  projectTraceSpans(input: $input) {
    data {
      spanId
      parentSpanId
      name
      service
      startedAt
      endedAt
      durationMs
      status
      statusMessage
      attributes
    }
    pageInfo {
      hasNextPage
      hasPreviousPage
      startCursor
      endCursor
    }
  }
}
```

List trace spans. Requires project.logs.read.

## Arguments

| Name                     | Type                    | Required | Description |
| ------------------------ | ----------------------- | -------- | ----------- |
| `input`                  | ProjectTraceSpansInput! | Yes      |             |
| `input.projectReference` | String!                 | Yes      |             |
| `input.traceId`          | String!                 | Yes      |             |
| `input.cursor`           | String                  |          |             |
| `input.limit`            | Int                     |          |             |
| `input.status`           | String                  |          |             |
| `input.sortOrder`        | String                  |          |             |

## Variables

```json
{
  "input": {
    "projectReference": "string",
    "traceId": "string"
  }
}
```

## Responses

| Status | Description                                       |
| ------ | ------------------------------------------------- |
| 200    | The TraceSpansPayload! in data.projectTraceSpans. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query ProjectTraceSpans($input: ProjectTraceSpansInput!) {\n  projectTraceSpans(input: $input) {\n    data {\n      spanId\n      parentSpanId\n      name\n      service\n      startedAt\n      endedAt\n      durationMs\n      status\n      statusMessage\n      attributes\n    }\n    pageInfo {\n      hasNextPage\n      hasPreviousPage\n      startCursor\n      endCursor\n    }\n  }\n}",
  "variables": {
    "input": {
      "projectReference": "string",
      "traceId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "projectTraceSpans": {
      "data": [
        {
          "spanId": "string",
          "parentSpanId": "string",
          "name": "string",
          "service": "string",
          "startedAt": "string",
          "endedAt": "string",
          "durationMs": 0,
          "status": "string",
          "statusMessage": "string",
          "attributes": {}
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "hasPreviousPage": false,
        "startCursor": "string",
        "endCursor": "string"
      }
    }
  }
}
```
