* add staging ios app build script * feat(api): add OpenTelemetry LGTM stack for local observability Wire OTel traces, metrics, and logs through a collector to Tempo, Prometheus, and Loki, with custom LLM instrumentation, dev compose overlay, Grafana provisioning, env templates, and development.sh auto-start. * feat: expand observability, harden dev tooling, and fix expo staging UX Add business and LLM Prometheus metrics with Grafana dashboards, alerting, and a metrics verification script. Wire telemetry through adapters and core LLM paths, and document the local LGTM workflow. Fix development.sh for macOS bash 3.2, open Grafana and eval-web in Chrome, and repair eval-web auto-open (unbound EVAL_WEB_BROWSER_SCHEDULED). Merge internal-eval into the main dev script with improved compose handling. Require EXPO_PUBLIC_* at build time, improve iOS HTTP ATS for staging IPs, show memoir empty state instead of load errors when no chapters exist, and add jest env setup plus chapter list response normalization. * chore: enable Grafana Assistant Cursor plugin * fix: memoir empty state and repair withdrawn 0020_chapters_book_id stamp Show empty memoir UI when the chapter list succeeds with no items; treat auth/404 as non-fatal. Extend alembic revision repair so local dev DBs stamped with the removed 0020_chapters_book_id migration can roll back and upgrade to 0019. --------- Co-authored-by: Kevin <kevin@brighteng.org> Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -223,6 +223,36 @@ class Settings(BaseSettings):
|
||||
# 非空时额外写入 JSONL(serialize=True),便于 Loki/ELK;与 stderr 彩色控制台并存
|
||||
log_json_file: str = ""
|
||||
|
||||
# ── OpenTelemetry ─────────────────────────────────────────
|
||||
otel_enabled: bool = False
|
||||
otel_exporter_otlp_endpoint: str = "http://localhost:48317"
|
||||
otel_exporter_otlp_insecure: bool = True
|
||||
otel_service_name: str = ""
|
||||
otel_traces_sampler: str = Field(
|
||||
default="always_on",
|
||||
description="always_on | parentbased_traceidratio | always_off",
|
||||
)
|
||||
otel_traces_sampler_arg: float | None = Field(default=None, ge=0.0, le=1.0)
|
||||
otel_metric_export_interval_ms: int = Field(default=10_000, ge=1000, le=300_000)
|
||||
|
||||
@field_validator("otel_enabled", mode="before")
|
||||
@classmethod
|
||||
def _coerce_otel_enabled(cls, v: object) -> bool:
|
||||
if isinstance(v, bool):
|
||||
return v
|
||||
if v is None:
|
||||
return False
|
||||
return str(v).strip().lower() in ("1", "true", "yes", "on")
|
||||
|
||||
@field_validator("otel_exporter_otlp_insecure", mode="before")
|
||||
@classmethod
|
||||
def _coerce_otel_exporter_otlp_insecure(cls, v: object) -> bool:
|
||||
if isinstance(v, bool):
|
||||
return v
|
||||
if v is None:
|
||||
return True
|
||||
return str(v).strip().lower() in ("1", "true", "yes", "on")
|
||||
|
||||
@field_validator("celery_purge_broker_on_startup", mode="before")
|
||||
@classmethod
|
||||
def _coerce_celery_purge_broker_on_startup(cls, v: object) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user