From ea673c40e4cf11659b7b412914f6b8a1636f93ee Mon Sep 17 00:00:00 2001 From: Veeresh K Date: Fri, 5 Dec 2025 06:00:11 +0000 Subject: [PATCH 1/2] Fix: observability_exclude_paths env parsing issue --- .env.example | 16 ++++++++-------- mcpgateway/config.py | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.env.example b/.env.example index 910d31ca3..e164f4b33 100644 --- a/.env.example +++ b/.env.example @@ -1198,28 +1198,28 @@ PAGINATION_INCLUDE_LINKS=true # Enable observability tracing and metrics collection # When enabled, all HTTP requests will be traced with detailed timing, status codes, and context -# OBSERVABILITY_ENABLED=false +OBSERVABILITY_ENABLED=false # Automatically trace HTTP requests -# OBSERVABILITY_TRACE_HTTP_REQUESTS=true +OBSERVABILITY_TRACE_HTTP_REQUESTS=true # Number of days to retain trace data -# OBSERVABILITY_TRACE_RETENTION_DAYS=7 +OBSERVABILITY_TRACE_RETENTION_DAYS=7 # Maximum number of traces to retain (prevents unbounded growth) -# OBSERVABILITY_MAX_TRACES=100000 +OBSERVABILITY_MAX_TRACES=100000 # Trace sampling rate (0.0-1.0) - 1.0 means trace everything, 0.1 means trace 10% -# OBSERVABILITY_SAMPLE_RATE=1.0 +OBSERVABILITY_SAMPLE_RATE=1.0 # Paths to exclude from tracing (comma-separated regex patterns) -# OBSERVABILITY_EXCLUDE_PATHS=/health,/healthz,/ready,/metrics,/static/.* +OBSERVABILITY_EXCLUDE_PATHS='["/health", "/healthz", "/ready", "/metrics", "/static/.*"]' # Enable metrics collection -# OBSERVABILITY_METRICS_ENABLED=true +OBSERVABILITY_METRICS_ENABLED=true # Enable event logging within spans -# OBSERVABILITY_EVENTS_ENABLED=true +OBSERVABILITY_EVENTS_ENABLED=true ##################################### # Ed25519 Key Support diff --git a/mcpgateway/config.py b/mcpgateway/config.py index 9d3017876..ab16cb731 100644 --- a/mcpgateway/config.py +++ b/mcpgateway/config.py @@ -1102,6 +1102,7 @@ def _auto_enable_security_txt(cls, v: Any, info: ValidationInfo) -> bool: "sso_auto_admin_domains", "sso_github_admin_orgs", "sso_google_admin_domains", + "observability_exclude_paths", mode="before", ) @classmethod From 7d6fb374efd063bc40974141b5c3b68f0ee3052b Mon Sep 17 00:00:00 2001 From: Veeresh K Date: Fri, 5 Dec 2025 06:41:24 +0000 Subject: [PATCH 2/2] Fix: observability_exclude_paths env parsing issue Signed-off-by: Veeresh K --- mcpgateway/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcpgateway/config.py b/mcpgateway/config.py index ab16cb731..24c8bb46a 100644 --- a/mcpgateway/config.py +++ b/mcpgateway/config.py @@ -768,7 +768,7 @@ def _parse_allowed_origins(cls, v: Any) -> Set[str]: observability_sample_rate: float = Field(default=1.0, ge=0.0, le=1.0, description="Trace sampling rate (0.0-1.0)") # Exclude paths from tracing (regex patterns) - observability_exclude_paths: List[str] = Field(default_factory=lambda: ["/health", "/healthz", "/ready", "/metrics", "/static/.*"], description="Paths to exclude from tracing (regex)") + observability_exclude_paths: List[str] = Field(default_factory=lambda: ["/health", "/healthz", "/ready", "/metrics", "/static/.*"], description="Paths to exclude from tracing") # Enable performance metrics observability_metrics_enabled: bool = Field(default=True, description="Enable metrics collection")