Skip to content

feat(observability): add Tencent Cloud CLS (AgentObs) integration via Langfuse SDK - #3165

Merged
Bosheng0422 merged 1 commit into
developfrom
feat/tencent-cls-observability
Nov 26, 2026
Merged

Bosheng0422 merged 1 commit into
developfrom
feat/tencent-cls-observability

Conversation

@Bosheng0422

Copy link
Copy Markdown
Collaborator

Summary

Add Tencent Cloud CLS (AgentObs) observability integration to Octop via the native Langfuse SDK OTLP/HTTP export path:

  • Control plane (CreateAgentApplication / DescribeAgentApplications): Use the customer's Tencent Cloud SecretId / SecretKey (encrypted at rest via SecretRepo) to auto-create or idempotently reuse a CLS AgentObs application in the target region and extract its trace TopicId.
  • Existing application / TopicId support: Users can list & pick an existing CLS application from their account or paste an existing trace TopicId directly (also supports push-only sub-accounts with only cls:pushLog permission).
  • Data plane (Langfuse SDK → CLS OTLP/HTTP): Exports traces via OTLPSpanExporter to https://{region}.cls.tencentcs.com/v1/traces (or internal cls.tencentyun.com) with Authorization: Basic base64("{SecretId}:{SecretKey}") and topic_id header.
    • AccessType="Langfuse" (default): preserves native Langfuse OTLP attributes, with an optional content-masking toggle (mask_content) to strip prompts/responses.
    • AccessType="Agent": maps spans to redacted OpenTelemetry gen_ai.* monitoring attributes.
    • Preserves deployment-level OCTOP_AGENTOBS_ENABLED env-var fallback when neither CLS nor Langfuse is enabled in Dashboard settings.
  • Runtime hot-reload & Admin API: Wires ClsObservabilitySettingsStore into AgentManager with hot reload (set_langfuse) and adds permission-gated endpoints under /api/admin/observability/cls*.
  • Dashboard UI: Upgrades Settings → Advanced → Observability with a Tencent Cloud CLS / Langfuse switcher, auto-create vs existing app/Topic ID modes, OTLP endpoint preview, internal endpoint & content masking toggles, and connection verification.

Target branch

  • Base is develop (feature / fix — default)
  • Base is main (release/* or hotfix/* only)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / chore
  • Release / hotfix

Test plan

  • Backend unit tests: pytest -q tests/unit/test_cls_observability.py tests/unit/test_langfuse_settings.py tests/unit/test_langfuse_env_names.py tests/unit/api/test_acl_gate_coverage.py (22 passed)
  • Backend lint & typecheck: ruff check, ruff format --check, mypy on modified observability modules
  • Frontend checks: prettier, eslint, tsc --noEmit -p dashboard/tsconfig.app.json, and vite build
  • Added/updated tests (tests/unit/test_cls_observability.py)

Checklist

  • README / docs updated (if needed) (.env.example, CHANGELOG.md, openapi_meta.py)

@Bosheng0422
Bosheng0422 merged commit 10504f8 into develop Nov 26, 2026
6 checks passed
@Bosheng0422
Bosheng0422 deleted the feat/tencent-cls-observability branch November 26, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants