以编程方式使用文档

自托管 LangSmith 实例在本地存储所有信息,绝不会将敏感信息发送到您的网络外部。但是,除非您在离线模式下运行,否则 LangSmith 需要出站流量到 https://beacon.langchain.com 用于以下目的:

  • 计费遥测 — License verification and subscription/usage reporting (required)
  • 运营遥测 — 用于支持诊断的日志、指标和追踪(可选,可禁用)
  • 使用遥测 — 用于产品洞察的匿名使用快照(可选,可禁用)

计费遥测

计费遥测是 **必需的** for self-hosted LangSmith instances that are not running in offline mode. This includes license verification and subscription/usage reporting.

功能说明

  • 许可证验证:在启动时和之后定期验证您的 LangSmith 许可证密钥。
  • Subscription/usage reporting:根据订单中的授权报告平台使用指标以用于计费。

我们收集的内容

  • - 许可证密钥验证请求
  • - 聚合使用计数(追踪数量、分配席位、使用席位)
  • - 组织和工作区标识符

示例负载

许可证验证

Endpoint: POST beacon.langchain.com/v1/beacon/verify

Request:

{
  "license": ""
}

Response:

{
  "token": "Valid JWT" //Short-lived JWT token to avoid repeated license checks
}

Subscription/usage reporting

Endpoint: POST beacon.langchain.com/v1/beacon/ingest-traces

Request:

{
  "license": "",
  "trace_transactions": [
    {
      "id": "af28dfea-5358-463d-a2dc-37df1da72498",
      "tenant_id": "3a1c2b6f-4430-4b92-8a5b-79b8b567bbc1",
      "session_id": "b26ae531-cdb3-42a5-8bcf-05355199fe27",
      "trace_count": 5,
      "start_insertion_time": "2025-01-06T10:00:00Z",
      "end_insertion_time": "2025-01-06T11:00:00Z",
      "start_interval_time": "2025-01-06T09:00:00Z",
      "end_interval_time": "2025-01-06T10:00:00Z",
      "status": "completed",
      "num_failed_send_attempts": 0,
      "transaction_type": "type1",
      "organization_id": "c5b5f53a-4716-4326-8967-d4f7f7799735"
    }
  ]
}

Response:

{
  "inserted_count": 1 //Number of transactions successfully ingested
}

运营遥测

从版本 **0.11**开始,LangSmith 部署默认发送运营遥测。此遥测数据可帮助 LangChain 团队为自托管实例提供主动支持和更快的故障排除。

功能说明

  • - 支持自托管实例的主动支持和更快故障排除
  • - 协助性能调优
  • - 帮助根据实际使用模式确定改进优先级

我们收集的内容

  • 请求元数据:匿名的请求计数、大小和持续时间
  • 数据库指标:查询持续时间、错误率和性能计数器
  • 运营追踪:高延迟或失败请求的时序和错误信息(这些是 **否** 客户追踪 — 它们是关于 LangSmith 实例本身运行的追踪)
  • 日志消息:仅警告和错误日志消息

如何禁用

您可以通过在您的 langsmith_config.yaml file:

config:
  telemetry:
    logs: false
    metrics: false
    traces: false

您也可以只设置特定值来禁用单个遥测类型 false.

示例负载

运营指标

Endpoint: POST beacon.langchain.com/v1/beacon/v1/metrics

Request:

{
  "resourceMetrics": [
    {
      "resource": {
        "attributes": [
          {
            "key": "resource.name",
            "value": { "stringValue": "langsmith-metrics" }
          },
          {
            "key": "env",
            "value": { "stringValue": "ls_self_hosted" }
          }
        ]
      },
      "scopeMetrics": [
        {
          "scope": {
            "name": "langsmith.metrics",
            "version": "0.1.0"
          },
          "metrics": [
            {
              "name": "langsmith_http_requests_latency",
              "unit": "seconds",
              "description": "Request latency of LangSmith services",
              "gauge": {
                "dataPoints": [
                  {
                    "asDouble": 12.34,
                    "startTimeUnixNano": 1678886400000000000,
                    "timeUnixNano": 1678886400000000000,
                    "attributes": [
                      {
                        "key": "endpoint",
                        "value": { "stringValue": "/sessions" }
                      },
                      { "key": "method", "value": { "stringValue": "GET" } },
                      {
                        "key": "service_name",
                        "value": { "stringValue": "langsmith_backend" }
                      }
                    ]
                  }
                ]
              }
            },
            {
              "name": "langsmith_http_requests_failed",
              "unit": "1",
              "description": "Counter of failed requests for LangSmith services",
              "sum": {
                "dataPoints": [
                  {
                    "asInt": 456,
                    "startTimeUnixNano": 1678886400000000000,
                    "timeUnixNano": 1678886400000000000,
                    "attributes": [
                      {
                        "key": "endpoint",
                        "value": { "stringValue": "/info" }
                      },
                      { "key": "method", "value": { "stringValue": "POST" } },
                      {
                        "key": "service_name",
                        "value": { "stringValue": "langsmith_platform_backend" }
                      }
                    ],
                    "aggregationTemporality": 2,
                    "isMonotonic": true
                  }
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}

运营追踪

Endpoint: POST beacon.langchain.com/v1/beacon/v1/traces

Request:

{
  "resourceSpans": [
    {
      "resource": {
        "attributes": [
          {
            "key": "env",
            "value": {
              "stringValue": "ls_self_hosted"
            }
          },
          {
            "key": "service.name",
            "value": {
              "stringValue": "langsmith_backend"
            }
          }
        ]
      },
      "scopeSpans": [
        {
          "scope": {},
          "spans": [
            {
              "traceId": "71699b6fe85982c7c8995ea3d9c95df2",
              "spanId": "3c191d03fa8be0",
              "parentSpanId": "",
              "name": "receive_request",
              "startTimeUnixNano": "1581452772000000321",
              "endTimeUnixNano": "1581452773000000789",
              "droppedAttributesCount": 1,
              "events": [
                {
                  "timeUnixNano": "1581452773000000123",
                  "name": "parse_request",
                  "attributes": [
                    {
                      "key": "request_size",
                      "value": {
                        "stringValue": "100"
                      }
                    }
                  ],
                  "droppedAttributesCount": 2
                },
                {
                  "timeUnixNano": "1581452773000000123",
                  "name": "event",
                  "droppedAttributesCount": 2
                }
              ],
              "droppedEventsCount": 1,
              "status": {
                "message": "status-cancelled",
                "code": 2
              }
            },
            {
              "traceId": "71699b6fe85982c7c8995ea3d9c95df2",
              "spanId": "0932ksdka12345",
              "parentSpanId": "3c191d03fa8be0",
              "name": "process_request",
              "startTimeUnixNano": "1581452772000000321",
              "endTimeUnixNano": "1581452773000000789",
              "links": [],
              "droppedLinksCount": 3,
              "status": {}
            }
          ]
        }
      ]
    }
  ]
}

运营日志消息

我们仅从自托管 LangSmith 实例导出错误日志消息。这允许 LangChain 团队排查应用程序错误,而无需与您的团队进行来回通信。

Endpoint: POST beacon.langchain.com/v1/beacon/v1/logs

Request:

{
  "resourceLogs": [
    {
      "resource": {
        "attributes": [
          {
            "key": "service.name",
            "value": {
              "stringValue": "langsmith_backend"
            }
          }
        ]
      },
      "scopeLogs": [
        {
          "scope": {},
          "logRecords": [
            {
              "timeUnixNano": "1581452773000009875",
              "severityNumber": 13,
              "severityText": "Warning",
              "body": {
                "stringValue": "Database connection pool approaching capacity"
              },
              "attributes": [
                {
                  "key": "component",
                  "value": {
                    "stringValue": "langsmith_backend"
                  }
                },
                {
                  "key": "pool_size",
                  "value": {
                    "intValue": "95"
                  }
                }
              ],
              "droppedAttributesCount": 0,
              "traceId": "08040201000000000000000000000000",
              "spanId": "0102040800000000"
            },
            {
              "timeUnixNano": "1581452773000000789",
              "severityNumber": 17,
              "severityText": "Error",
              "body": {
                "stringValue": "Failed to process trace batch"
              },
              "attributes": [
                {
                  "key": "component",
                  "value": {
                    "stringValue": "langsmith_queue_worker"
                  }
                },
                {
                  "key": "error_type",
                  "value": {
                    "stringValue": "timeout"
                  }
                }
              ],
              "droppedAttributesCount": 0,
              "traceId": "",
              "spanId": ""
            }
          ]
        }
      ]
    }
  ]
}

使用量遥测

使用量遥测收集您 LangSmith 实例使用量指标的匿名快照。这些数据有助于 LangChain 了解平台采用情况并为产品开发决策提供信息。

功能说明

  • - 按固定间隔捕获聚合的使用量指标
  • - 提供对功能采用和平台增长的洞察
  • - 帮助 LangChain 根据实际使用情况优先改进和新功能

我们收集的内容

  • 平台指标:工作区、项目、实验、数据集、评估器和其他平台资源的计数
  • 功能使用情况:运行规则、注释队列、提示和提示相关活动的计数
  • 用户:注册用户总数和过去 30 天内活跃 PAT(个人访问令牌)的数量
  • 时间戳: Time range for the snapshot (from/to timestamps in UTC)

示例负载

Endpoint: POST /v1/beacon/usage-snapshot

Request:

{
  "license_key": "",
  "from_timestamp": "2026-03-25T02:00:00+00:00",
  "to_timestamp": "2026-03-26T02:00:00+00:00",
  "measures": {
    "workspaces": 12,
    "users": 63,
    "projects": 87,
    "experiments": 34,
    "datasets": 15,
    "evaluators": 8,
    "run_rules": 5,
    "annotation_queues": 3,
    "prompts": 22,
    "prompt_commits": 156,
    "prompt_pulls": 1043,
    "active_pats_30d": 47
  }
}

如何禁用

您可以通过在部署配置中设置以下环境变量来禁用使用量遥测:

PHONE_HOME_USAGE_REPORTING_ENABLED: false

将此添加到您的 Helm 配置的 commonEnv 部分以永久禁用使用量遥测报告。

我们的承诺

LangChain will not store any sensitive information in billing or operational telemetry. Any data collected will not be shared with a third party. Log messages are filtered to only include error severity levels, and we do not capture log messages that could contain sensitive application data. If you have any concerns about the data being sent, disable telemetry and/or reach out to your account team.