> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-zh.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 查看组织内的追踪数量

<Note>
  此功能适用于 Helm chart 版本 0.9.5 及更高版本。
</Note>

LangSmith 会自动为自托管安装生成并同步组织使用量图表。

这些图表可在 `设置 > 使用量与计费 > 使用量图表` 下找到：

* 按工作区统计的使用量：此图表按工作区统计追踪（根运行）数量
* 组织使用量：此图表统计组织内所有追踪（根运行）数量

图表每 5 分钟刷新一次，以包含任何新的工作区。请注意，这些图表不可编辑。

## 以编程方式获取追踪数量

您可以使用两种不同的方法以编程方式获取追踪数量：

### 方法一：使用 LangSmith REST API

如果您的自托管安装使用在线密钥，可以使用 [LangSmith REST API](https://api.smith.langchain.com/redoc?_gl=1*w68t81*_gcl_au*MTgyNTQ5MDUxNy4xNzU2NzI3MDky*_ga*MTU3NDY5MzQyNC4xNzQyOTMyMTQ2*_ga_47WX3HKKY2*czE3NTgyMDAxMDAkbzM0MSRnMCR0MTc1ODIwMDEwMCRqNjAkbDAkaDA.#tag/orgs/operation/get_org_usage_api_v1_orgs_current_billing_usage_get) 来获取组织使用量数据。

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
curl -X GET "https://your-langsmith-instance.com/api/v1/orgs/current/billing/usage" \
  -H "Accept: application/json" \
  -H "X-API-Key: your-api-key" \
  -G \
  -d "starting_on=2025-09-01T00:00:00Z" \
  -d "ending_before=2025-10-01T00:00:00Z" \
  -d "on_current_plan=true"
```

### 方法二：使用 PostgreSQL 支持查询

对于使用离线密钥的安装，或者当您需要更详细的导出功能时，可以直接对 PostgreSQL 数据库运行支持查询。所有可用的脚本都在 [支持查询仓库](https://github.com/langchain-ai/helm/tree/main/charts/langsmith/scripts/support_queries/postgres) 中。

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
sh run_support_query_pg.sh "postgres://postgres:postgres@localhost:5432/postgres" \
  --input support_queries/pg_get_trace_counts_daily.sql \
  --output trace_counts.csv
```

有关运行支持查询的更多详细信息，请参阅 [对 PostgreSQL 运行支持查询](/langsmith/script-running-pg-support-queries) 指南。

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/i18n\zh-CN\langsmith\self-host-organization-charts.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
