Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3e69ec2
feat(observability): add managed monitoring stack and diagnostics
happy-v587 Oct 22, 2026
8c44446
fix(ci): check observability resource licenses
happy-v587 Nov 2, 2026
5fa867f
fix(ci): keep OTLP checks optional after master rebase
happy-v587 Nov 2, 2026
fdb7b1a
fix(ci): align observability fixtures and worker diagnostics
happy-v587 Nov 3, 2026
3489cd7
test(zcode): verify durable pause after scope timeout
happy-v587 Nov 3, 2026
2ee2cbb
fix(packaging): declare psutil as a server dependency
happy-v587 Nov 3, 2026
03efa42
fix(observability): repair reference demo signal correlation
happy-v587 Nov 3, 2026
9dfd1be
fix(observability): color status output and send valid TraceQL explor…
happy-v587 Nov 3, 2026
e319e85
fix(observability): reject log-specific exporter overrides
happy-v587 Nov 3, 2026
01ebe73
fix(ci): retry busy macOS image detach failures
happy-v587 Nov 3, 2026
a60e8e2
test(zcode): allow bounded initial recall timeouts
happy-v587 Nov 3, 2026
5eebbb6
fix(runtime): retain failure evidence across policy blocks
happy-v587 Nov 4, 2026
f999706
fix(ci): qualify merged ownership and observability contracts
happy-v587 Nov 4, 2026
8fa87c4
docs(desktop): record merged source evidence qualification
happy-v587 Nov 4, 2026
f969713
test(logging): accept declared service owner identity
happy-v587 Nov 4, 2026
e60384d
fix(ci): budget complete backend acceptance lifecycles
happy-v587 Nov 4, 2026
23bbf41
test(ci): isolate nested pytest runtime options
happy-v587 Nov 4, 2026
75239cf
chore(desktop): regenerate statistics observation bindings
happy-v587 Nov 4, 2026
581cf26
fix(desktop): accept optional statistics observations
happy-v587 Nov 4, 2026
e4d5e87
test(desktop): qualify combined statistics protocol
happy-v587 Nov 4, 2026
01dd266
docs(desktop): record statistics product qualification
happy-v587 Nov 4, 2026
63755a0
fix(ci): budget OceanBase clean migration lifecycles
happy-v587 Nov 4, 2026
06cff31
merge: sync master and preserve macOS DMG diagnostics
happy-v587 Nov 5, 2026
2722e8f
fix(ci): isolate macOS build retry fixtures after master sync
happy-v587 Nov 5, 2026
5e85e0f
merge: sync master and unify migration test budgets
happy-v587 Nov 5, 2026
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
Prev Previous commit
Next Next commit
fix(observability): reject log-specific exporter overrides
  • Loading branch information
happy-v587 committed Nov 4, 2026
commit e319e850bfc51584eaa2e778952d50530612cd09
3 changes: 3 additions & 0 deletions docs/en/docs/operate/reference-observability-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ Stop the old foreground process normally before running the second command. Reus
The CLI reads the file's bind/token settings but does not change it, restart the business process, or create a demo Server.
Without an environment file, use `observability up` and `server run --observability`. Use `--server-url` on first up for
another existing Server origin. Explicit conflicting telemetry settings are rejected without printing values.
Signal-specific `OTEL_EXPORTER_OTLP_{TRACES,LOGS}_{ENDPOINT,HEADERS,TIMEOUT}` settings and `OTEL_SDK_DISABLED`
are rejected in both environment files and the process environment. Remove these settings before using
`--observability`, or configure telemetry manually without that flag.

`--backend docker-compose` is the default. Only this backend is implemented; `local` and `kubernetes` are rejected.
The backend selects how monitoring runs, independently of how the business Server runs.
Expand Down
3 changes: 3 additions & 0 deletions docs/zh/docs/operate/reference-observability-stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ powercontext observability check --exercise
第一条命令读取已有配置中的地址、端口和 Bearer token,不修改该文件,也不启动第二个业务 Server。
第二条命令替代原来的 Server 启动命令;先正常停止旧进程,再使用相同配置、相同数据库启动。
CLI 不会自动停止业务进程。`--observability` 只加载遥测配置;显式遥测配置冲突时会报错,且不打印凭证。
环境文件和进程环境中的 `OTEL_EXPORTER_OTLP_{TRACES,LOGS}_{ENDPOINT,HEADERS,TIMEOUT}` 专用配置,
以及 `OTEL_SDK_DISABLED`,都会被拒绝。使用 `--observability` 前应移除这些设置;如需保留,
请手动配置遥测并省略该标志。
如果没有环境文件,使用 `observability up` 和 `server run --observability`。
非默认地址可通过首次 `up --server-url http://127.0.0.1:8000` 指定。

Expand Down
7 changes: 5 additions & 2 deletions src/powercontext/observability/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,16 @@ def profile_environment(existing: Mapping[str, str]) -> dict[str, str]:
raise ObservabilityError( # noqa: TRY003
f"Explicit {key} conflicts with the observability profile; remove the conflict or configure telemetry manually"
)
explicit_trace_overrides = {
explicit_signal_overrides = {
"OTEL_EXPORTER_OTLP_TRACES_ENDPOINT",
Comment thread
happy-v587 marked this conversation as resolved.
Resolved
"OTEL_EXPORTER_OTLP_TRACES_HEADERS",
"OTEL_EXPORTER_OTLP_TRACES_TIMEOUT",
"OTEL_EXPORTER_OTLP_LOGS_ENDPOINT",
"OTEL_EXPORTER_OTLP_LOGS_HEADERS",
"OTEL_EXPORTER_OTLP_LOGS_TIMEOUT",
"OTEL_SDK_DISABLED",
}
if explicit_trace_overrides & (file_values.keys() | process_values.keys()):
if explicit_signal_overrides & (file_values.keys() | process_values.keys()):
raise ObservabilityError( # noqa: TRY003
"Signal-specific OTLP settings or OTEL_SDK_DISABLED conflict with managed observability; configure telemetry manually"
)
Expand Down
27 changes: 27 additions & 0 deletions tests/test_observability_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from __future__ import annotations

import json
import os
import re
import shlex
import subprocess
Expand Down Expand Up @@ -431,6 +432,32 @@ def test_signal_specific_destination_cannot_silently_bypass_profile(deployment,
pass


@pytest.mark.usefixtures("otlp_exporter")
@pytest.mark.parametrize("source", ["file", "process"])
@pytest.mark.parametrize(
("name", "value"),
[
("OTEL_EXPORTER_OTLP_LOGS_ENDPOINT", "http://old-destination.invalid/v1/logs"),
("OTEL_EXPORTER_OTLP_LOGS_HEADERS", "Authorization=Bearer%20private-log-export-token"),
("OTEL_EXPORTER_OTLP_LOGS_TIMEOUT", "0.25"),
],
)
def test_log_exporter_overrides_cannot_silently_bypass_profile(deployment, monkeypatch, tmp_path, source, name, value):
for key in tuple(os.environ):
if key.startswith("OTEL_"):
monkeypatch.delenv(key)
config = tmp_path / "existing.env"
config.write_text(f"{name}={value}\n" if source == "file" else "")
if source == "process":
monkeypatch.setenv(name, value)
with (
pytest.raises(ServerConfigurationError, match="Signal-specific") as caught,
server_settings_context(env_file=config, observability=True, process_environment_overrides=True),
):
pass
assert value not in str(caught.value)


@pytest.mark.usefixtures("otlp_exporter")
def test_nested_explicit_tracing_disable_cannot_be_overwritten(deployment, tmp_path):
config = tmp_path / "existing.env"
Expand Down