本节仅适用于未在离线模式下运行的客户,并假设您正在使用自托管的 LangSmith 实例,其版本为 0.9.0 或更高。LangSmith 的早期版本不具备此功能。
自托管的 LangSmith 实例将所有信息存储在本地,并且绝不会将敏感信息发送到您的网络之外。我们目前仅根据您的订单中的权利条款,为计费目的跟踪平台使用情况。为了更好地远程支持我们的客户,我们确实需要出口到 https://beacon.langchain.com。 将来,我们将引入支持诊断,以帮助我们确保 LangSmith 在您的环境中以最佳水平运行。这将需要您的网络出口到 https://beacon.langchain.com。如果需要,请参阅IP 地址白名单部分以获取静态 IP 地址。
通常,我们发送到 Beacon 的数据可分为以下几类
-
订阅指标
-
订阅指标用于确定 LangSmith 的访问级别和利用率。这包括但不限于
-
操作元数据
- 此元数据将包含并收集上述订阅指标,以协助远程支持,使 LangChain 团队能够更有效地和主动地诊断和解决性能问题。
LangSmith 遥测
从 0.11 版本开始,LangSmith 部署默认会将遥测数据发送回我们的后端。所有遥测数据都与组织和部署相关联,但绝不会与单个用户关联。我们 不收集 PII(个人身份信息)的任何形式。
我们使用它的目的
- 提供更主动的支持和更快地解决自托管实例的问题。
- 协助进行性能调优。
- 了解实际使用情况以优先进行改进。
我们收集什么
- 请求元数据:匿名化的请求计数、大小和持续时间。
- 数据库指标:查询持续时间、错误率和性能计数器。
- 分布式跟踪:对于高延迟或失败的请求,提供包含时间信息和错误信息的端到端跟踪。
我们不收集实际的有效载荷内容、数据库记录或任何可以识别您的最终用户或客户的数据。
如何禁用
在您的 langsmith_config.yaml 文件中设置以下值
config:
telemetry:
metrics: false
traces: false
示例负载
为了最大程度地透明化,我们在此处提供示例有效载荷
许可证验证
端点: POST beacon.langchain.com/v1/beacon/verify 请求:{
"license": "<YOUR_LICENSE_KEY>"
}
响应
{
"token": "Valid JWT" //Short-lived JWT token to avoid repeated license checks
}
使用情况报告
端点: POST beacon.langchain.com/v1/beacon/ingest-traces 请求:{
"license": "<YOUR_LICENSE_KEY>",
"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"
}
]
}
响应
{
"inserted_count": 1 //Number of transactions successfully ingested
}
遥测:指标
端点: POST beacon.langchain.com/v1/beacon/v1/metrics 请求:{
"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
}
]
}
}
]
}
]
}
]
}
遥测:跟踪
端点: POST beacon.langchain.com/v1/beacon/v1/traces 请求:{
"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": {}
}
]
}
]
}
]
}
我们的承诺
LangChain 不会在订阅指标或操作元数据中存储任何敏感信息。任何收集的数据都不会与第三方共享。如果您对发送的数据有任何疑虑,请联系您的客户团队。