# projectTrace

```graphql
query ProjectTrace($input: ProjectTraceInput!) {
  projectTrace(input: $input) {
    traceId
    rootSpanId
    rootSpanName
    rootService
    startedAt
    durationMs
    status
    spanCount
    services
    projectId
    projectSlug
    environment
    host
    spans {
      spanId
      parentSpanId
      name
      service
      startedAt
      endedAt
      durationMs
      status
      statusMessage
      attributes
    }
  }
}
```

Get a trace. Requires project.logs.read.

## Arguments

| Name                     | Type               | Required | Description |
| ------------------------ | ------------------ | -------- | ----------- |
| `input`                  | ProjectTraceInput! | Yes      |             |
| `input.projectReference` | String!            | Yes      |             |
| `input.traceId`          | String!            | Yes      |             |

## Variables

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

## Responses

| Status | Description                            |
| ------ | -------------------------------------- |
| 200    | The TraceDetail! in data.projectTrace. |

## 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 ProjectTrace($input: ProjectTraceInput!) {\n  projectTrace(input: $input) {\n    traceId\n    rootSpanId\n    rootSpanName\n    rootService\n    startedAt\n    durationMs\n    status\n    spanCount\n    services\n    projectId\n    projectSlug\n    environment\n    host\n    spans {\n      spanId\n      parentSpanId\n      name\n      service\n      startedAt\n      endedAt\n      durationMs\n      status\n      statusMessage\n      attributes\n    }\n  }\n}",
  "variables": {
    "input": {
      "projectReference": "string",
      "traceId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "projectTrace": {
      "traceId": "string",
      "rootSpanId": "string",
      "rootSpanName": "string",
      "rootService": "string",
      "startedAt": "string",
      "durationMs": 0,
      "status": "string",
      "spanCount": 0,
      "services": [
        "string"
      ],
      "projectId": "string",
      "projectSlug": "string",
      "environment": "string",
      "host": "string",
      "spans": [
        {
          "spanId": "string",
          "parentSpanId": "string",
          "name": "string",
          "service": "string",
          "startedAt": "string",
          "endedAt": "string",
          "durationMs": 0,
          "status": "string",
          "statusMessage": "string",
          "attributes": {}
        }
      ]
    }
  }
}
```
