# Get trace thread stats

GET http://localhost:5173/api/v1/private/traces/threads/stats

Get trace thread stats

Reference: https://www.comet.com/docs/opik/reference/rest-api/traces/get-trace-thread-stats

## OpenAPI Specification

```yaml
openapi: 3.1.1
info:
  title: Get trace thread stats
  version: endpoint_traces.getTraceThreadStats
paths:
  /v1/private/traces/threads/stats:
    get:
      operationId: get-trace-thread-stats
      summary: Get trace thread stats
      description: Get trace thread stats
      tags:
        - - subpackage_traces
      parameters:
        - name: project_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
        - name: project_name
          in: query
          required: false
          schema:
            type: string
        - name: filters
          in: query
          required: false
          schema:
            type: string
        - name: from_time
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: to_time
          in: query
          required: false
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Trace thread stats resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectStats_Public'
components:
  schemas:
    ProjectStatItemObjectPublicType:
      type: string
      enum:
        - value: COUNT
        - value: PERCENTAGE
        - value: AVG
    ProjectStatItemObject_Public:
      type: object
      properties:
        name:
          type: string
        type:
          $ref: '#/components/schemas/ProjectStatItemObjectPublicType'
    ProjectStats_Public:
      type: object
      properties:
        stats:
          type: array
          items:
            $ref: '#/components/schemas/ProjectStatItemObject_Public'

```

## SDK Code Examples

```python
import requests

url = "http://localhost:5173/api/v1/private/traces/threads/stats"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'http://localhost:5173/api/v1/private/traces/threads/stats';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "http://localhost:5173/api/v1/private/traces/threads/stats"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:5173/api/v1/private/traces/threads/stats")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
```

```java
HttpResponse<String> response = Unirest.get("http://localhost:5173/api/v1/private/traces/threads/stats")
  .asString();
```

```php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'http://localhost:5173/api/v1/private/traces/threads/stats');

echo $response->getBody();
```

```csharp
var client = new RestClient("http://localhost:5173/api/v1/private/traces/threads/stats");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:5173/api/v1/private/traces/threads/stats")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```