Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ LANGFUSE_PUBLIC_KEY=
LANGFUSE_SECRET_KEY=
LANGFUSE_BASE_URL=

# Tencent Cloud CLS / AgentObs observability (optional env-var fallback).
# Prefer configuring in Dashboard → Settings → Advanced → Observability (supports
# encrypted SecretId/SecretKey storage, auto-creating CLS apps via CreateAgentApplication,
# or binding an existing Topic ID). Restart after changing env vars.
# OCTOP_AGENTOBS_ENABLED=true
# CLS_DEFAULT_REGION=ap-guangzhou
# CLS_TOPIC_ID=
# CLS_ACCESS_TYPE=Langfuse
# TENCENTCLOUD_SECRET_ID=
# TENCENTCLOUD_SECRET_KEY=
# TENCENTCLOUD_TOKEN= # Optional, required only for STS credentials

# ---------------------------------------------------------------------------
# Live integration tests (tests/live/*): REAL credentials.
#
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
## [Unreleased]

### 新增
- 可观测设置新增腾讯云 CLS(AgentObs)接入:支持填写腾讯云 SecretId / SecretKey 通过 Langfuse SDK(OTLP/HTTP Basic Auth)直接上报 Trace,支持自动调用 `CreateAgentApplication` 创建/复用 CLS 应用获取 Topic ID,也支持拉取或直接填写已有应用的 Topic ID,并提供内网接入点、内容脱敏及连通性校验。
- 知识库设置新增「分块与检索」标签页,可配置分块大小、分块重叠、默认检索条数和上下文字符预算。
- 用户管理支持创建限次邀请链接。链接在注册满员后自动停用,管理员也可以提前停用并查看已注册的用户。邀请管理 API 移除了 `used_at`、`used_by_user_id` 和 `revoked_at`,可通过注册记录和邀请状态查看使用情况。
- 自托管可用环境变量放行内网出站目标:`OCTOP_SSRF_ALLOWLIST`(主机名、`.后缀` 或 CIDR)让语音服务、OAuth MCP 发现与令牌请求等指向内网服务,`OCTOP_SSRF_ALLOW_HTTP` 允许这些目标走 http;仍做 DNS 解析并固定连接 IP 防重绑定,不配置时行为不变(#2016)
Expand Down
103 changes: 103 additions & 0 deletions dashboard/src/api/modules/observability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,64 @@ export interface LangfuseConfig {
configured: boolean;
}

export interface ClsTopicItem {
topic_id: string;
flag: string;
}

export interface ClsApplicationItem {
application_id: string;
application_name: string;
access_type: string;
region: string;
topic_id: string;
logset_id: string;
log_topics: ClsTopicItem[];
created: boolean;
}

export interface ClsConfig {
enabled: boolean;
region: string;
topic_id: string;
application_id: string;
application_name: string;
access_type: string;
use_internal_endpoint: boolean;
mask_content: boolean;
secret_id_masked: string;
secret_id_set: boolean;
secret_key_set: boolean;
configured: boolean;
endpoint: string;
active_backend: "cls" | "langfuse" | "cls_env" | "none" | string;
application_created?: boolean;
}

export interface ClsSavePayload {
enabled: boolean;
region: string;
topic_id?: string;
application_id?: string;
application_name?: string;
access_type?: string;
use_internal_endpoint?: boolean;
mask_content?: boolean;
secret_id?: string | null;
secret_key?: string | null;
auto_create_app?: boolean;
logset_id?: string | null;
reuse_existing?: boolean;
}

export interface ClsTestResult {
ok: boolean;
error?: string;
api_ok?: boolean | null;
otlp_ok?: boolean | null;
endpoint?: string;
}

export const observabilityApi = {
getLangfuse: () => request<LangfuseConfig>("/admin/observability/langfuse"),
saveLangfuse: (body: {
Expand All @@ -32,4 +90,49 @@ export const observabilityApi = {
body: JSON.stringify(body ?? {}),
},
),

getCls: () => request<ClsConfig>("/admin/observability/cls"),
saveCls: (body: ClsSavePayload) =>
request<ClsConfig>("/admin/observability/cls", {
method: "PUT",
body: JSON.stringify(body),
}),
listClsApplications: (body?: {
region?: string | null;
access_type?: string | null;
application_name?: string | null;
secret_id?: string | null;
secret_key?: string | null;
}) =>
request<{ applications: ClsApplicationItem[] }>(
"/admin/observability/cls/applications/list",
{
method: "POST",
body: JSON.stringify(body ?? {}),
},
),
createClsApplication: (body: {
region?: string | null;
application_name: string;
access_type?: string;
logset_id?: string | null;
reuse_existing?: boolean;
secret_id?: string | null;
secret_key?: string | null;
}) =>
request<ClsApplicationItem>("/admin/observability/cls/applications", {
method: "POST",
body: JSON.stringify(body),
}),
testCls: (body?: {
region?: string | null;
topic_id?: string | null;
use_internal_endpoint?: boolean | null;
secret_id?: string | null;
secret_key?: string | null;
}) =>
request<ClsTestResult>("/admin/observability/cls/test", {
method: "POST",
body: JSON.stringify(body ?? {}),
}),
};
49 changes: 48 additions & 1 deletion dashboard/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3555,8 +3555,12 @@
"runtimeHint": "Running agents reload automatically after save. Tool approval uses HITL; command guard blocks risky shell parameters before tools run."
},
"observability": {
"title": "Observability",
"description": "Export conversation traces via Langfuse SDK to Langfuse or Tencent Cloud CLS (AgentObs).",
"loading": "Loading observability settings…",
"loadError": "Failed to load observability settings",
"activeTag": "Active",
"envFallbackBanner": "Deployment environment variables (OCTOP_AGENTOBS_ENABLED) are currently active for Tencent Cloud CLS. Enabling a backend below takes precedence.",
"langfuseTitle": "Langfuse",
"langfuseDesc": "Send conversation traces to Langfuse for monitoring, debugging, and cost analysis.",
"enable": "Enable Langfuse tracing",
Expand All @@ -3572,7 +3576,50 @@
"saveFailed": "Failed to save settings",
"testConnection": "Test connection",
"testSuccess": "Langfuse connection successful",
"testFailed": "Langfuse connection failed"
"testFailed": "Langfuse connection failed",
"clsTitle": "Tencent Cloud CLS",
"clsEnable": "Enable Tencent Cloud CLS tracing",
"clsHint": "Report Langfuse SDK traces directly to Tencent Cloud CLS AgentObs via OTLP/HTTP Basic Auth using your Tencent Cloud SecretId / SecretKey. Auto-create an application via CreateAgentApplication or bind an existing Topic ID.",
"clsRegion": "Tencent Cloud Region",
"clsRegionRequired": "Region is required (e.g. ap-guangzhou)",
"clsSecretId": "Tencent Cloud SecretId",
"clsSecretIdRequired": "SecretId is required",
"clsSecretIdSet": "SecretId saved ({{masked}}). Leave blank to keep it.",
"clsSecretKey": "Tencent Cloud SecretKey",
"clsSecretKeyRequired": "SecretKey is required",
"clsSecretKeySet": "SecretKey is already saved. Leave blank to keep it.",
"clsMode": "Application Mode",
"clsModeCreate": "Auto-create Application",
"clsModeExisting": "Existing Application / Topic ID",
"clsAppName": "Application Name (service.name)",
"clsAppNameRequired": "Application name is required",
"clsAppNameInvalid": "Must not contain '|' and max 64 characters",
"clsAccessType": "Access Type",
"clsAccessTypeLangfuse": "Langfuse (Recommended, native Langfuse SDK semantics)",
"clsAccessTypeAgent": "Agent (OpenTelemetry GenAI redacted metrics)",
"clsLogsetId": "Logset ID (optional)",
"clsLogsetIdPlaceholder": "Leave empty to let CLS assign a logset automatically",
"clsCreateApp": "Create / Bind CLS Application",
"clsAppCreated": "Created CLS application. Topic ID: {{topicId}}",
"clsAppReused": "Bound existing CLS application. Topic ID: {{topicId}}",
"clsCreateAppFailed": "Failed to create CLS application",
"clsFetchApps": "Load Existing Apps",
"clsFetchAppsFailed": "Failed to fetch CLS applications",
"clsNoAppsFound": "No CLS Agent applications found in this region. Switch to Auto-create or enter a Topic ID manually.",
"clsSelectExistingApp": "Select Existing CLS Application",
"clsSelectExistingPlaceholder": "Click 'Load Existing Apps' first",
"clsTopicId": "Trace Topic ID",
"clsTopicIdRequired": "Topic ID is required (enter manually or create an app first)",
"clsTopicIdExtra": "You can paste an existing CLS Trace Topic ID directly (works with cls:pushLog-only sub-account keys).",
"clsApplicationId": "Bound Application ID",
"clsEndpointPreview": "OTLP Endpoint",
"clsInternalEndpoint": "Use Tencent Cloud internal endpoint (cls.tencentyun.com)",
"clsMaskContent": "Mask conversation content (omit prompts and responses)",
"clsSaved": "Tencent Cloud CLS settings saved",
"clsSavedWithCreate": "Created CLS application and saved settings (Topic ID: {{topicId}})",
"clsTestSuccess": "Tencent Cloud CLS connection verified",
"clsTestSuccessPushOnly": "OTLP ingestion verified (management API not permitted for this key; existing Topic reporting works)",
"clsTestFailed": "Tencent Cloud CLS connection test failed"
},
"mediaGeneration": {
"title": "Image and video generation",
Expand Down
49 changes: 48 additions & 1 deletion dashboard/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -3555,8 +3555,12 @@
"runtimeHint": "保存后运行中的专家会自动重载。工具审批通过 HITL 实现;命令防护在参数层拦截危险 shell 指令。"
},
"observability": {
"title": "可观测追踪",
"description": "通过 Langfuse SDK 将对话链路与模型调用数据上报至 Langfuse 或腾讯云 CLS(Agent 可观测)。",
"loading": "加载可观测配置…",
"loadError": "加载可观测配置失败",
"activeTag": "当前生效",
"envFallbackBanner": "当前正在使用部署环境变量(OCTOP_AGENTOBS_ENABLED)上报至腾讯云 CLS;在下方启用并保存配置后将优先使用页面配置。",
"langfuseTitle": "Langfuse",
"langfuseDesc": "将对话追踪数据发送到 Langfuse,用于监控、调试与成本分析。",
"enable": "启用 Langfuse 追踪",
Expand All @@ -3572,7 +3576,50 @@
"testConnection": "测试连接",
"testSuccess": "Langfuse 连接成功",
"testFailed": "Langfuse 连接失败",
"saveFailed": "保存失败"
"saveFailed": "保存失败",
"clsTitle": "腾讯云 CLS",
"clsEnable": "启用腾讯云 CLS 追踪",
"clsHint": "使用你的腾讯云 SecretId / SecretKey 通过 Langfuse SDK(OTLP/HTTP Basic Auth)直接将 Trace 上报至腾讯云 CLS Agent 可观测。支持自动调用 CreateAgentApplication 创建应用获取 Topic ID,或直接填写已有应用的 Topic ID。",
"clsRegion": "腾讯云地域(Region)",
"clsRegionRequired": "请选择或填写地域(如 ap-guangzhou)",
"clsSecretId": "腾讯云 SecretId",
"clsSecretIdRequired": "请填写腾讯云 SecretId",
"clsSecretIdSet": "已保存 SecretId({{masked}}),留空则不修改。",
"clsSecretKey": "腾讯云 SecretKey",
"clsSecretKeyRequired": "请填写腾讯云 SecretKey",
"clsSecretKeySet": "已保存 SecretKey,留空则不修改。",
"clsMode": "应用配置方式",
"clsModeCreate": "自动创建应用",
"clsModeExisting": "使用已有应用 / Topic ID",
"clsAppName": "应用名称(service.name)",
"clsAppNameRequired": "请填写应用名称",
"clsAppNameInvalid": "应用名称不能包含 | 且不超过 64 字符",
"clsAccessType": "接入类型(AccessType)",
"clsAccessTypeLangfuse": "Langfuse(推荐,原生 Langfuse SDK 语义)",
"clsAccessTypeAgent": "Agent(OpenTelemetry GenAI 脱敏指标)",
"clsLogsetId": "日志集 ID(可选)",
"clsLogsetIdPlaceholder": "留空则由 CLS 自动分配日志集",
"clsCreateApp": "创建 / 绑定 CLS 应用",
"clsAppCreated": "已创建 CLS 应用并获取 Topic ID:{{topicId}}",
"clsAppReused": "已复用同名 CLS 应用,Topic ID:{{topicId}}",
"clsCreateAppFailed": "创建 CLS 应用失败",
"clsFetchApps": "拉取已有应用",
"clsFetchAppsFailed": "拉取 CLS 应用列表失败",
"clsNoAppsFound": "当前地域下未找到 CLS Agent 应用,可切换为“自动创建应用”或手动填写 Topic ID。",
"clsSelectExistingApp": "选择已有 CLS 应用",
"clsSelectExistingPlaceholder": "先点击“拉取已有应用”加载列表",
"clsTopicId": "Trace 日志主题 ID(Topic ID)",
"clsTopicIdRequired": "请填写 Topic ID,或先点击创建应用",
"clsTopicIdExtra": "支持直接粘贴控制台已有的 Trace Topic ID(仅具 cls:pushLog 权限的子账号也可用)。",
"clsApplicationId": "已绑定应用 ID",
"clsEndpointPreview": "上报地址",
"clsInternalEndpoint": "使用腾讯云内网接入点(cls.tencentyun.com)",
"clsMaskContent": "隐私脱敏(不上报用户输入与模型输出正文)",
"clsSaved": "腾讯云 CLS 可观测配置已保存并生效",
"clsSavedWithCreate": "已自动创建 CLS 应用并保存配置(Topic ID:{{topicId}})",
"clsTestSuccess": "腾讯云 CLS 连接与上报校验成功",
"clsTestSuccessPushOnly": "OTLP 上报通道校验成功(当前密钥无应用管理权限,仅支持已有 Topic 上报)",
"clsTestFailed": "腾讯云 CLS 连接校验失败"
},
"mediaGeneration": {
"title": "图片与视频生成",
Expand Down
Loading
Loading