You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(trace,sls): differentiate serviceNamePrefix for user vs managed backends (#167)
Managed (inner) trace and log backends can now report under a distinct
service name from user backends, via a top-level `serviceNamePrefix` in
configs/inner/data_config.json. Falls back to the user prefix when unset,
so the default single-service-name behavior is unchanged.
- OTLP trace: convert once per distinct service.name and fan out each group
to its own backends (reuses the existing convertKey multi-state path).
- SLS: per-endpoint service name injected into the __service_name__ tag at
flush time.
- Dedup keys (OTLP + SLS) include serviceName so a shared URL under two
service names is kept as two distinct backends.
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/trace-output.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,10 +82,10 @@ Trace export sends the **same** converted spans to **every** configured backend
82
82
83
83
Backends are **deduplicated** by normalized endpoint URL + full request headers, so listing the same backend twice (e.g. once as a user backend and once as a managed backend) results in a single export. Two backends that share a URL but differ in auth headers / workspace / license are kept as distinct.
84
84
85
-
Shared vs. per-backend settings (because spans are converted once):
85
+
Shared vs. per-backend settings (spans are converted once per distinct `service.name`):
86
86
87
-
-**Shared across all backends:**`serviceName`, `resourceAttributes`, `captureMessageContent`, `resourceAttributeKeys`, `maxExportBatchBytes`, `turnIdleTimeoutMs`.
-**Shared across all backends:**`resourceAttributes`, `captureMessageContent`, `resourceAttributeKeys`, `maxExportBatchBytes`, `turnIdleTimeoutMs`.
88
+
-**Per-backend:** endpoint URL, headers, compression, and `service.name` (see below — user vs. managed backends can differ).
89
89
90
90
A failing backend is isolated — it does not block the healthy backends, and its failed spans are persisted separately under `~/.loongsuite-pilot/logs/otlp-failed/<service>-<agent>__<backend-name>.jsonl`.
91
91
@@ -96,6 +96,7 @@ Managed/hosted deployments can push extra trace backends via `~/.loongsuite-pilo
@@ -118,6 +119,7 @@ Managed/hosted deployments can push extra trace backends via `~/.loongsuite-pilo
118
119
119
120
| Field | Applies to | Description |
120
121
|-------|-----------|-------------|
122
+
|`serviceNamePrefix`| top-level | Service-name prefix for **all** managed backends — trace (`otlp[]`/`cms[]`, as `service.name`) and log (`sls[]`, as the `__service_name__` tag) — keeping them distinct from user backends. Optional; falls back to the user `serviceNamePrefix` when omitted (no differentiation). |
121
123
|`otlp[].name` / `cms[].name`| both | Label used in logs and in the per-backend failed-log filename. Optional (defaults to `inner-otlp-<i>` / `inner-cms-<i>`). |
122
124
|`otlp[].endpoint`| otlp | OTLP HTTP base URL (`/v1/traces` auto-appended). |
@@ -127,7 +129,7 @@ Managed/hosted deployments can push extra trace backends via `~/.loongsuite-pilo
127
129
|`cms[].project`| cms | Sent as `x-arms-project`. Extracted from the endpoint hostname if omitted. |
128
130
|`cms[].workspace`| cms | Sent as `x-cms-workspace`. |
129
131
130
-
Each `cms[]` entry is expanded into an OTLP endpoint with the corresponding `x-arms-*` / `x-cms-*` headers, and any CMS backend adds the `acs.arms.service.feature=genai_app` resource attribute (shared, as noted above). Malformed managed config (e.g. `otlp`/`cms` written as a non-array) is ignored rather than failing collection.
132
+
Each `cms[]` entry is expanded into an OTLP endpoint with the corresponding `x-arms-*` / `x-cms-*` headers, and any CMS backend adds the `acs.arms.service.feature=genai_app` resource attribute (shared, as noted above). When `serviceNamePrefix` is set here, managed backends report under `<serviceNamePrefix>-<agent>` while user backends keep the user prefix; spans are then converted once per distinct `service.name` (typically twice — user and managed). Malformed managed config (e.g. `otlp`/`cms` written as a non-array) is ignored rather than failing collection.
0 commit comments